What do you expect from the code above? Resetting the Ethernet hardware (or the SD hardware)? If so, you want get what you intended. Pin 10 is the device select line of the SPI interface for the Ethernet chip (Wiz5100), pin 4 is the same for the SD card connector. Pulling the low for 250ms won't reset the devices.
Do stuff and periodically reset the Ethernet.
Why do you want to periodically reset the Ethernet? Is your hardware defect?
pylon:
What do you expect from the code above? Resetting the Ethernet hardware (or the SD hardware)? If so, you want get what you intended. Pin 10 is the device select line of the SPI interface for the Ethernet chip (Wiz5100), pin 4 is the same for the SD card connector. Pulling the low for 250ms won't reset the devices.
Do stuff and periodically reset the Ethernet.
Why do you want to periodically reset the Ethernet? Is your hardware defect?
Hi,
Thanks for the reply.
Essentially the sketch / device will work fine for days with no issues and then stop working, which I have tracked down to an issue with the Ethernet Chip.
I discovered that removing the Ethernet Cable , or power to the device fixes the issue. So I wanted to bring down the Ethernet chip in the code and start it again, effectively emulating a reset of the Ethernet device.
Are you sure it's a problem with the hardware? Have you checked the software? Post your sketch, maybe the forum finds an issue there. Which version of the IDE do you use?
pylon:
Are you sure it's a problem with the hardware? Have you checked the software? Post your sketch, maybe the forum finds an issue there. Which version of the IDE do you use?
It will go into a loop and not accept a DHCP Lease,
I can see the Router trying to send a valid response. It just doesn't accept / see it.
I am currently using 1.0.1
I assume it is not possible to enable a software reset of the Ethernet? Although I do see that pin 59 on the Wiznet is a Reset pin.
From their documentation.
RESET Pin# 59
This pin is active Low input to initialize or re-initialize
W5100.
By asserting this pin low for at least 2us, all internal
registers will be re-initialized to their default states.
DHCP was faulty in version 1.0 of the IDE, without a patch it would freezing during the DHCP request. This should be fixed in 1.0.1. Have you tried your sketch with the new IDE already?
It is possible but you have to change the board connections, disrupting the connection between the reset pin of the ATmega and the reset pin of the Wiz chip. Then you have to solder a connection from the reset pin of the Wiz chip to one of the digital outputs of the ATmega and you have to reset the Ethernet yourself after power up. I recommend against that because it's not solving your problem but giving you the chance of a few more.
pylon:
DHCP was faulty in version 1.0 of the IDE, without a patch it would freezing during the DHCP request. This should be fixed in 1.0.1. Have you tried your sketch with the new IDE already?
It is possible but you have to change the board connections, disrupting the connection between the reset pin of the ATmega and the reset pin of the Wiz chip. Then you have to solder a connection from the reset pin of the Wiz chip to one of the digital outputs of the ATmega and you have to reset the Ethernet yourself after power up. I recommend against that because it's not solving your problem but giving you the chance of a few more.
Thanks for the reply, the bug you refer to, what pull request was that?
As I applied most of them manually to 1.0.0, and have also tried it with 1.0.1 and it still occurs. Although less frequently admittedly.