W5500 quits working

I have a w5500 module connected to a custom board. I program the board with MAC address, IP address, subnet mask, and gateway IP. After the network parameters are setup I then open Socket 0 in TCP mode on port 5000.

After setup, I am able to ping the board and when I telnet to the board on port 5000, it answers. I can send characters to the board and they arrive in the receive buffer. Apparently everything is working as it should.

The problem is after about 15 minutes of no activity everything quits working. Ping no longer works and the board no longer responds to telnet on port 5000. Powering the board down and back up is the only thing that will restore operation to normal for another 15 minutes or so.

Do I need to be sending some kind of signal to the board to keep it alive? The data sheet doesn’t mention having to do anything like that. Once the board is configured, should it not continue to run forever?

When it “hangs” read registers back (socket registers and common registers), display them and compare to ones you wrote in to see if anything got corrupt. Which MAC address you programmed board with?

I will have to modify the code to read the registers each time through my main loop. All the loop is doing now is blinking an LED when a counter hits a certain value. I did have temporary code in to read the Socket 0 RX buffer to confirm the telnet data was being received. I have now removed that code and am not accessing the w5500 at all once it is setup.

I disconnected the module and connected it to an Arduino board I have. I programmed the board with a w5500 shield sketch and it continues to run. I let it run for 6 hours and could still ping it.

I am going to look at the Arduino underlying code to see how they program the w5500. I am not really familiar with Arduino and do not like the Arduino environment because it hides too much from you.

I am using a PIC16F chip running at 32 MHz. All I am doing is setting up the network parameters and opening Socket 0 in TCP mode. I am not doing anything with the other sockets or accessing the RX buffer while the code is running. Do I need to do anything with the other sockets or are the default settings sufficient?

I would think that once the MAC data is programmed and the network parameters are setup, the w5500 would just keep running. Is that not correct? The MAC address I am using is 00:08:DC:01:02:0B. There are no conflicting MAC addresses on my network.

I will add code to read the registers each time through my main loop and write the contents to a set of buffers. I will run the PIC in debug mode so I can stop it and view the buffer contents when the w5500 quits responding.

I thought it is totally transparent platform to learn programming with :laughing:

There’re required settings - MAC address, own IP address, network mask and gateway IP address. For ping to work there should be some bit set in MR register. And of course chip should be logically reachable on the network using these parameters.

Should be.

OK.

Yes, that is the problem, you don’t know what the underlying code is doing. I’m used to dealing directly with hardware registers and manually setting up the MCU peripherals. I’ve been programming MCUs for over 20 years and don’t need transparency. That is one of the big problems with Microchip’s new Harmony environment.

You can disable ping by setting the PB bit is the MR register. It is enabled by default.

That is also what I thought. If it works for the first 15 minutes it should keep working with no further intervention.

The w5500 data sheet certainly leaves a lot to be desired. They could get a larger market share by describing everything in detail. As is, it takes a lot of testing/experimenting to figure out what they are trying to say.

Good point. Please look into W5100 datasheet, as whole W5x00 family has same functional principles, W5100’s applies, and you will find much more useful programming information in there.