W5500 on Teensy 3.5 randomly fails on startup

airpanther

Active member
Good day,

I'm running a Teensy 3.5 with a W5500, and it communicates with other network devices very well! About 80% of the time, everything boots up perfectly, the board gets an IP address, and communications work perfectly. But about 1 in every 5 times of powering up the board, the W5500 module will fail with the same light pattern. The red light will light for about a half a second, then the green light for a split second, then both lights extinguish. About 3 seconds later, the same pattern happens again. This happens over and over again. However, once power to the board is cycled, everything boots up and works perfectly.

Any idea what I'm doing wrong?

Pin 2 below is the reset pin. 1,3,4,5 are the MOSI, MISO, SCLK and SS and are connected to the Teensy.

W5500image1.jpg

Here is the code I'm using to initialize the board. When the board fails, the code doesn't seem to get past this point

Code:
void InitializeComms()
{
// start the Ethernet connection:
    int iLoop = 0;

    while (iLoop == 0) // Keep trying forever until a MAC address is received
    {
        if (Ethernet.begin(myMac) == 0)
        {
            Serial.println("Failed to configure Ethernet using DHCP trying again");
        }
        else
            iLoop = 1;
    }

    Udp.begin(UDPPort);
}
 
Please supply your dull code. There is nothing in your sample code turning on any "lights".
 
However, once power to the board is cycled, everything boots up and works perfectly.

Blind guess - W5500 chip is probably getting stuck in some state the software can't handle.

Solution is probably to remove the resistor & capacitor reset and wire the reset signal to a pin, so you can give the W5500 a reset pulse if (when) it's stuck.


And yeah, full code. You can get better help if you post a complete program and enough hardware detail that anyone with the same hardware could copy the program in Arduino IDE and upload to a Teensy to reproduce the problem.
 
Blind guess - W5500 chip is probably getting stuck in some state the software can't handle.

Solution is probably to remove the resistor & capacitor reset and wire the reset signal to a pin, so you can give the W5500 a reset pulse if (when) it's stuck.


And yeah, full code. You can get better help if you post a complete program and enough hardware detail that anyone with the same hardware could copy the program in Arduino IDE and upload to a Teensy to reproduce the problem.

Thanks all for the responses, and I'll keep in mind to post full code. Paul, I think you are right... I think wiring the reset to a Teensy pin would be helpful, as it would be really easy to reset the chip if the board can't get an IP address after a period of time.

Just to make sure I've got this right, I can just configure a Teensy pin as an output with a 220ohm resistor, and connect to the W5500 reset pin.... then pull the output high to run the network card, or cycle it off, then back on to reset it?

W55002.jpg

And sorry if this is a rookie question, but is there a software equivalent to using the Reset pin to reset the Teensy 3.6?
 
Using SCB_AIRCR will cause Teensy to reboot. But the W5500 chip will just sit there in the same state while Teensy resets and restarts.

Yes, you can just wire the W5500 reset pin to a Teensy pin. A 220 ohm resistor is not needed, but wouldn't hurt anything either.

If the hardware you're using does not have a pullup resistor, I would recommend putting a 10K resistor from the W5500 pin to 3.3V. Before Teensy boots us, and while you're uploading code, the I/O pin will be high impedance. A real pullup resistor keeps the signal at logic high. Maybe it is overly paranoid, but adding any length of wire can slightly increase your chances of picking up noise or radio interference. Usually it's not a big problem if the wire is short and located physically close to a GND wire or plane. But having a real pullup resistor adds some safety, so unless you're sure there is one already on the module you're using (the PJRC adaptor board definitely has a real pullup resistor on pin 9) you probably should add a pullup resistor if your main goal is improving robustness.
 
Back
Top