W5500 communication problem Atmega 328 [SOLVED]
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5500 communication problem Atmega 328 [SOLVED]
by scott WIZnet ·
Hi jan-jelle
Can you get the RJ45 part schematic?
Thank you.
Scott
RE: RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Ofcourse! apologies I forgot this. The schematics is mainly copied from the Arduino ethernet shield but modified for the correct RJ45 connector I use.
connector used:
RE: W5500 communication problem Atmega 328 [SOLVED]
by Mxyxixptlick ·
That depends on which chip features you use. I posted an issue at Some common register addresses in W5100.h are incorrect for W5500 · Issue #84 · arduino-libraries/Ethernet · GitHub noting that some common W5500 registers have different addresses than the corresponding W5100 registers.
RE: RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Hi Mxyxixptlick
Thanks for the response. in that particular article it doesn’t really tell which library it uses as far as I can see? as far as I understand the conversion for the registers should be solved in the ethernet2.h library. however the issue with client::connect changing to 5ms might be something I could try… see if that will help the issue. my main code does hang in a while() loop until a connection is established though, so I wonder if it shouldn’t just pick it up in a second or third attempt then…
If any other ideas pop up please let me know!
RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
small update.
I just took a scope to measure the SPI signals and conclude that the Slave Select only goes LOW on communication requests. is this usual, or should I pull it low constantly?
furthermore the MOSI is sending out data, (converted from 5V to 3.3V ofcourse) and the MISO is sending data back (just 3.3V since the uC accepts this as logic 1) but the speed in which the slave (W5500) is responding is a lot faster than the master is transmitting, or the bits are more 0 than 1 but that seems unlikely…
in any case, the uC is communicating with the W5500…
RE: W5500 communication problem Atmega 328 [SOLVED]
by Mxyxixptlick ·
Slave Select should only go LOW on comm requests, so that’s good. If you have any other SPI devices connected their slave selects should be pulled high when not in use.
The datasheet says the W5500 is stable at SPI speeds up to 33.3MHz. If you’re running faster you may want to try dialing it back. (ref datasheet 5.5.4 SPI Timing).
That library is the Arduino Ethernet2 library posted at GitHub - arduino-libraries/Ethernet: Ethernet Library for Arduino.
I found that while it has many nice features, it’s not bullet-proof. I particularly had problems with connections. I forked a copy that I modified for my own use and posted it at GitHub - SapientHetero/Ethernet: Ethernet Library for Arduino.
I’m using a W5500 with a Cortex-M4 MCU that has more processor power and RAM than your 328, so my version may not be useful to you as-is. But you may want to fork the official Ethernet2 library and make similar changes to improve reliability.
README.rtf explains the changes I’ve made.
But your problem may have nothing to do with software. Another poster here had issues when his W5500 was overheated when soldering it to his board. Did you comply with the recommendation in Chapter 6 (IR Reflow Temperature Profile (Lead-Free) of the Datasheet when assembling your board?
Another poster had issues with electrical noise causing their W5500 to reset randomly on their custom boards.
RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Alright, another update. sorry guys at the moment I am messing around with the scope and such. after a few resets (and this happened before as well) suddenly the ACT led also lights up. during this stage I measured the SPI comms again and there is now a constant stream of communication. where in the previous case, there was only communication every 5 seconds (this is the delay between retries in connecting between the uC and W5500). but now, appearantly the connection is established since the rest of my main code is also running. however, the MQTT messages do not process correctly, so I still do not have a proper ethernet connection. also when pinging the W5500 it does not reply as it should in CMD. when pinging, the ACT LED does start blinking more frequently…
so some progress, but still no idea how to proceed… any help is much appreciated!
RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Hi Mxyxixptlick,
Thanks for the help. I will check the SPI speed but since it is sharing the same CLK signal I recon the MISO and MOSI are running at similar speed, but the bit pattern obviously is different which caught me off guard.
Regarding the soldering, I didn’t necessarily comply to any IR reflow since I soldered by hand. this obviously creates the discussion of possibly overheating however I got quite good at soldering .5mm pitch pretty fast, so I only applied the iron at 400 degrees in under .5s per 2 pins. I seriously doubt that it is fried due to soldering. SPI does seem to function steady, but the messages don’t come through properly. I am seriously questioning the connector I used and how I connected it to the W5500, since it is different than the reference schematics of the W5500. I didn’t notice this before because I went by the Arduino ethernet shield but this is again, a different connector…
Would it be possible for someone to tell me if my RJ45 connector setup in the picture above makes any sense? If I look at the W5500 reference there are 49.9R resistors on the TXP/TXN which I used as well, but I used 10K on RXP/RXN while reference sheet uses 49.9 there as well…
Your remark on the ethernet2.h library is noted, and I will take a look at this as well in the mean time.
furthermore the SPI clock signal shows 1 puls in roughly 100ns, so that would be 10MHz if I am correct… that should be fine then I recon.
RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Ok guys sorry for all the fuss. I just took my chances and changed out the resistors according to the W5500 reference schematics which eventually turned out to solve the issue. Don’t really understand why the Arduino shield has 10K’s there as per pictures below (R4, R5):
while the W5500 has them like this (R6, R7):
after changing them out it worked instantly.
thanks again for all the help!
RE: W5500 communication problem Atmega 328 [SOLVED]
by Mxyxixptlick ·
So, as we software guys like to say, “it’s probably a hardware problem”
RE: W5500 communication problem Atmega 328 [SOLVED]
by jan-jelle ·
Haha yeah… wel it was a human problem as most of the time.