WIZnet W5100 and the Propeller - not working....yet
Timothy D. Swieter
Posts: 1,613
I have had the WIZnet W5100 and WIZ810MJ prototype board since the·middle of October.· These are items I got when applying for the Circuit Cellar contest (see other thread on the forum).
Sadly they have been sitting in my 'to do' heap since I received them.· Yesterday I finally dug them out and took time to wirewrap the 2mm header and attach it to my Prop demo board.· I whipped up some code, well, ok I didn't just whip it up, but I have a good start for a driver and a file to test the driver.· The first goal was to write data for the Gateway Address, MAC Address, Subnet Mask, & IP Address and then ping the device.· The program is all in SPIN but in the future I will convert to ASM for speed once the core parts are working.
I loaded up the program to the Prop, worked out a few bugs.· I have a hyper terminal providing feedback. The top file, the file testing the driver, basically intializes the I/O, resets the chip with a software reset then loads the addresses in the proper registers.· Next it reads the addresses out to verify the read and write routines work.· The good news (I think) is that the data is written and read from the chip just fine.· (Oh I am using SPI mode)· The sad news is that I can't seem to ping the device via ethernet.
According to the article on CC and other posts I have seen on the net I should be able to ping the device once those few things are configured.· Am I missing something?·
Anyone else out there have a WIZnet W5100 module wired to a Prop?· Anyone have code they would like to share?· If no code to share, can you review my code and let me know if you see something wrong?· Better yet, download my code,·put it on your setup and see if it works?··Then tell me if·it does or doesn't.·
I spent enough time staring at the code my eyes are crossing.· I also tried·different ethernet cables, various combinations of·IP addresses (to ensure my routines aren't transposing or adding header or trailing bits)· Time for the forum to help.·
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
Sadly they have been sitting in my 'to do' heap since I received them.· Yesterday I finally dug them out and took time to wirewrap the 2mm header and attach it to my Prop demo board.· I whipped up some code, well, ok I didn't just whip it up, but I have a good start for a driver and a file to test the driver.· The first goal was to write data for the Gateway Address, MAC Address, Subnet Mask, & IP Address and then ping the device.· The program is all in SPIN but in the future I will convert to ASM for speed once the core parts are working.
I loaded up the program to the Prop, worked out a few bugs.· I have a hyper terminal providing feedback. The top file, the file testing the driver, basically intializes the I/O, resets the chip with a software reset then loads the addresses in the proper registers.· Next it reads the addresses out to verify the read and write routines work.· The good news (I think) is that the data is written and read from the chip just fine.· (Oh I am using SPI mode)· The sad news is that I can't seem to ping the device via ethernet.
According to the article on CC and other posts I have seen on the net I should be able to ping the device once those few things are configured.· Am I missing something?·
Anyone else out there have a WIZnet W5100 module wired to a Prop?· Anyone have code they would like to share?· If no code to share, can you review my code and let me know if you see something wrong?· Better yet, download my code,·put it on your setup and see if it works?··Then tell me if·it does or doesn't.·
I spent enough time staring at the code my eyes are crossing.· I also tried·different ethernet cables, various combinations of·IP addresses (to ensure my routines aren't transposing or adding header or trailing bits)· Time for the forum to help.·
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
zip
12K
Comments
I wirewrapped my module as follows:
P0 to /SS
P1 to SCLK
P2 to MOSI
P3 to MISO
VCC to VDD (3.3V) on demo board
GND to VSS
SPI_EN tied high
/reset at one point I had it tied high, but I don't think it is needed because right now I am 'running' without it tied high.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
First, ping your device (obviously replace the ip with your device ip):
Then check your arp table:
You should see something like:
If you see your device in the list (10.10.1.4 in my case), then it is set up correctly. Once you get ARP working, you can start trying to figure out how to configure the module for ICMP (Ping).
If you don't get an ARP response then try setting the MAC address to something trivial (I recommend 10-00-00-00-00-01, 10-00-00-00-00-02, ..etc..). 10-00-00 is the private OUI (at least it's supposed to be) and the last 3 octets can be whatever you want. Be careful with the first octet (10 in this case) since the 2 least significant bits have special meaning.
Harrison
Post Edited (Harrison.) : 12/8/2007 3:14:04 AM GMT
Thank you for the advice Harrison. I remember seeing some similar advice on another website or forum. I just tried what you wrote. My device's IP is configured for 192.168.0.32. I sent a ping to the device, but all four messages have a "Request timed out.". I then checked the arp table and the only thing I see is my router/switch/WIFI device at 192.168.0.1.
I took the next step and made my MAC address using 10-00-00-00-00-01. Same results.
At the moment I see two options, my module or chip is bad. I am not sure how to test this because it is responding to SPI commands and the LEDs on the jack are flickering.
The other option is that thers is some totally obvious and simple wrong in my problem. Next time I open my code (tonight?) I think I will see if I am reading and writing the bits backwards into the registers or something similar. Maybe I will even dig out my DSO to be sure I don't have something transposed. As I mentioned above I am writting to a register and then reading out of it. It could be possible that my bits are backwards in both cases. Then again if my bits were backwards how could I be reading or writing? Hmmm....
I hope those finals are done soon so we can work together to get the device working.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
I set up the unit as you indicated (except for your typo where, I believe, /SS should have read /SCS).
At first, I was getting the exact same results across the board that you get - no ping reply - no entry in the arp table. The parameters appear to be getting set correctly (they were coming back as all zero's when I had P0 hooked to /CS) as you noted so that part is working. The green LED was flashing.
I then tried it with SPI_EN removed and all parameters were coming back Zero. I shut it down, hooked up SPI_EN again, restarted everything and plugged in the net cable LAST (after I started the Prop) and things changed! Green and Yellow leds are now on, I can now PING the WIznet and there is an entry in the arp table. When yours is hooked up, do you get a flashing green LED?
I don't have time to do much more right now, but I would say you are heading in the right direction!
Paul
I need to run out the door somewhere, but I will try what you did when I return. Thank you for taking the time to look at it and validate (rather invalidate) the results I got. I have more confidence in my work now that someone has gotten it to ping.
Sometimes I left the cable plug in other times I hadn't. I will pay attention to the LEDs next time I power it up. In the past I ignored them because, to me, they are difficult to distinguish in color. (Yes, I have some color blindness)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
So I think maybe I have a faulty connection - maybe. I was still reading and writing serial I/O fine, so I am not positive. Oh well - I will try a better wire wrap scheme next time I power it up, maybe later this week because my other project needs to get done soon.
Thank you everyone for the help! I will post up my results as soon as I get back to the device. There is much more coding to be done for the driver. First I will get some SPIN code working and then I will translate it into ASM for speed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
I just reattached the module to my demo board. This time I used wire wrap and a socket instead of pushing the wire wrap wires into the protoboard. This new method uses a header. I wire wrapped to the pins on the WIZnet module and to the header and the header is mounted in the protoboard.
Tada! The code posted above works just like Paul Sr. proved. I blame my previous failed attempts on malpractice hardware wiring. Thank you guys for duplicaitng my setup and trying out the code.
Stay tuned for more advanced driver code. This week I may have sometime. At the end of this week I will return to the States for Christmas with the family so I may go quite for a while and not post any updates. I will start a new thread when I have some significant code to share.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH - Electronics: Engineer - Programming: Professional
Funny you should bring this up Quantum. I have been wanting to get back to this, it has almost been a year, but unfortunately I don't have any updates. I recently picked up a WIZ830MJ module with the W5300 chip. I am contemplating spinning a board for attaching this to a Propeller and taking some serious time to write a driver for it. It will have to wait in line though with several other projects - isn't that always the case?
What application are you considering the WIZnet for? I like the simplicity of the W5100 and it appears the W5300 is more poweful, but takes several more I/O. I hope to use the WIZnet IC in a product someday.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
Initially i did not get any arp entries .
After changing my MAC , I get my default gateway address in the arp table and not my device address..
any possible reason??