WIZ811MJ and atmega8

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone,

I want to interface WIZ811MJ with Atmega8. I read the W5100 datasheet but couldn't communicate with the device using SPI.

Can anyone provide me with sample codes?

Thanks in advance...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

there are others out there that have the Wiz modules working, see https://www.avrfreaks.net/index.p... for one example (wiz810)

I'd go back to basics: do you know you have SPI working right? Do you have another SPI device you have previously had working?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://www.avrfreaks.net/index.p... and the linked page there may help too

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

812MJ is better since its pins are standard spacing. And has one bug fix

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I'd go back to basics: do you know you have SPI working right? Do you have another SPI device you have previously had working?

Thanks Pondy,
Yes I have used SPI and completely know how it works!!!!

Quote:
812MJ is better since its pins are standard spacing. And has one bug fix

I have bought 811MJ!

Basically I want to connect my uC to the internet..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suggest you start with the WIZnet 5100 driver software. You can get it from: [url]http://www.wiznet.co.kr/en/libra....

The driver is written for an ATmega128 but it'll give you a start.

WIZnet also has sample code you can download.

Start out simple: can you write/read a 5100 register?

I'm not sure you can squeeze a W5100 application into an ATmega8. I have work in progress (haven't worked on it in quite some time, I do need to get back to it) which uses an ATmega644. The application is incomplete - I do have some basics working - it is currently using 14,190 bytes of program memory.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A couple more tips:

As I recall, it wasn't real obvious from any of the WIZ811MJ or W5100 documentation exactly how to wire the module for SPI. Here's how I wired the WIZ811MJ:

  • SCLK to ATmega SCK (PCINT15/SCK)
  • /SCS to ATmega644 /SS (PCINT12/OC0B/~SS)
  • MOSI to ATmega644 MOSI (PCINT13/MOSI)
  • MISO to ATmega644 MISO (PCINT14/MISO)
  • /INT to ATmega644 INT2 (PCINT10/INT2/AIN0)
The /INT connection is optional - the WIZnet software can be compiled for polling instead of using the interrupt. /SCS is controlled by software (see IINCHIP_CSoff/IINCHIP_CSon in W5100.c and spi.h).

Okay, maybe this is obvious. What wasn't - and it took some experimentation and looking at other peoples work (e.g., Arduino Ethernet shield hardware and software) was what to do with /RESET. Originally, I had a pullup on /RESET. That didn't work. I then tried connecting it to the ATmega /RESET. That worked half the time. What I finally wound up doing was tying /RESET to an ATmega port (PB3) and doing the W5100 reset in software.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you donblake for your reply.
The problem I'm facing is that I don't know how to use 811MJ.

I would like to start from the very beginning. How can I use the TCP/IP stack on 811MJ.

How should I start learning this. Because at the end I want to connect it to the internet.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you probably need to read the code that the Wiznet link Don provided above. Also you might consider the code that the Wiz200web (based on W5300 not W5100) provides - at a high level, those code bases give you an idea about the general approach you might need to take. If you break the job down into small chunks, as Don suggests, you need to first make sure you can communicate to the W5100 chip from your uC. Then you want to take another piece of their sample code and make it work for you, don't go too deep at the start just make the basics work and then when you understand the code and the result, move to the next piece.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a couple of projects posted which use the WIZ810MJ. They were contest entries for a recent Circuit Cellar contest and the code is assembly language. They may or may not contain helpful information in the code and/or documentation.

one
the other one

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your code. I'm learning a lot from it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I a'm glad to tell you that I've communicated my uC with the PC over the Ethernet cable!!!!

Now my goal is to connect it to twitter.com.
First of all, I want an IP of my own... I mean I have to implement DHCP.

How do we do this thing? secondly, I'm using UDP, can I connect to the internet using this protocol?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kumailxp wrote:
First of all, I want an IP of my own... I mean I have to implement DHCP.
See the WIZnet DHCP application note:

[url]http://www.wiznet.co.kr/rg4_boar...

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Don, that was of great help.

Should I use TCP/IP or UDP to connect to the internet?
Which one is better for my task.(i.e. connecting to twitter.com)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Which one is better for my task.(i.e. connecting to twitter.com)

TCP, port 80

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kumailxp wrote:
Thanks Don, that was of great help.

Should I use TCP/IP or UDP to connect to the internet?
Which one is better for my task.(i.e. connecting to twitter.com)

Must use TCP for things like HTTP.
Rare use of UDP.

Depends on what you wish to do.