Working P2/Spin2 example of W5500 Wiznet adapter?
kwagner
Posts: 48
in Propeller 2
Hi all,
I'm probably doing something stupid but I can't determine what. I have a W5500 click that I have in the eval click adapter. I changed the pin assignments in W5500.spin to match, but when I run the UdpSocketClientDemo from https://github.com/jbkim/Parallax_W5500 (with my attempts to modify it for Spin2), I see no output in Wireshark. Has anyone else already adapted the code that can share the result?
Thanks
Comments
Do you have a logic analyzer you can attach to the pins? If not, I highly recommend one. The "8ch 24MHz" Saleae clones that cost ~$10 work very well with Pulseview.
I don't, but that's a great idea. I'll check it out, thanks.
I was able to get it working. The end culprit was not waiting enough between opening the connection and transmitting packets, so the first however many disappeared never to be sent. The original version apparently either didn't have this issue, or its timing logic was different because of spin1. It seems to work for my purposes for now. I have to add a bit to my main program to fit it in and see how robust it is long-term.
When you get this working, would you be willing to post your code? I’m about to travel the W5500 road and could use some code that I know works.
My example code changes attached.
Caveats:
My code sends 2500 UDP messages with the last two bytes set as counters (first 1-10, second 1-250) so I could see what packets come through when. It's not super robust but it's a starting point. Modify addresses/pinouts as necessary for your application.
You could speed up your SPI transfers with a small change in the transfer routine. Using inline PASM2, you could push the W5500 as fast as it will go.
Then you could do something like this:
Thank you for this! Muchly appreciated.
Once my Click arrives, I’ll start the deconstruction process. My end goal is to morph this into pure FlexBASIC. No particular reason, except it forces me to dig-in deeper and really understand the module.
Thanks JonnyMac. I modified the routines in W5500 (attached, would welcome a second set of eyes for verification), and compared with the old. The results were interesting:
I was unable to test W5500_jm on FlexProp on default optimization, as for some reason it "optimized out" the ReadByte function, which results in a compile error. As far as I can tell, packets look identical on all versions. It's obvious the modified SPI routines are an improvement as they increase transfer at each optimization level. I'm curious as to the differences in performance between the Propeller Tool and no optimization FlexProp.