w5100 reset idea

So I'm running a home theater pc that handles all my entertainment needs/media for my TV. I am part way through integrating some RGB LED lighting controls in this system, and I have the system sending commands to my ProMini328 which i've got connected to a w5100 shield.

In the breadboarding phase I thought I solved my "requires reset press" problem by using a better power supply and adding a 250ms delay in the code before initializing the shield. It tested fantastic, with many boots, never failing to initialize properly.

Now I've built the thing onto a pcb, along with some FETs and control circuity (all powered from the htpc's internal 450W psu), but the ethernet keeps failing to start unless i go press the reset button. Now, before I get the "google is your friend" hate, I have been googling and looking at spec sheets for a couple of hours, trying to find a solution. I found the resistor/capacitor trick, but some people are reporting that doesn't work...

I'm wondering if I can tie a digital output line from the Arduino (say pin 6) to the reset line of the shield, and force the output low for 50ms in my setup() function, to force reboot the shield. then initialize it.

I can't find anything about anyone trying this method, so that has me thinking it won't work, but thought I'd ask. The thing is installed in a closet in another room now and its a pain in the butt to go open the case and hit reset every time.

You might check the below concerning a possible reset race between the arduino and the Ethernet shield.

Thanks for the reply, but that was one of the sites i'd found when googling.
Some more searching led me to discover that solution may not work for every board, and since i'd like to make this a repeatable project, i'd like a sure-fire way to make it work.

The race, I hope, would be solved by powering up the arduino and e-net shield, then waiting 250ms and resetting the shield by pulling an output low... Just looking for input on whether that's a decent idea or if there's a reason I shouldn't do that.

Sounds like it may be power related. Have you tried waiting longer than 250ms? Maybe the ht power supply is not powering up fast enough?

I assume that the mini and the shield are now permenantly connected to your pcb; if not though, can you go back & retest them standalone? It rather sounds as though the cause is elsewhere in your system.

I'm wondering if I can tie a digital output line from the Arduino (say pin 6) to the reset line of the shield, and force the output low for 50ms in my setup() function, to force reboot the shield. then initialize it.

Sounds very plausible - try it?

I did this with several boards a few years ago (previous version of the board). My problem was that it would take several minutes, yes minutes, for the board to properly join the in-house network. I searched for software solutions, but finding none, I wired up the board reset to an arduino pin. I also took a wire to one of the lights and counted pulses in a short period of time to decide if I needed to do the reset since, once in a while, the board would actually work the first time.

You have to isolate the board reset from the arduino first though which will require a magnifying glass and a good exacto knife. If you want to see pics and a description, it's on my thermostat page on my blog at:

This little kludge has been in place for years working its little heart out without problems.

Have fun.

wildbill:
I assume that the mini and the shield are now permenantly connected to your pcb; if not though, can you go back & retest them standalone? It rather sounds as though the cause is elsewhere in your system.

Yes, sorta... the ProMini is soldered to a pcb, but the shield is flipped upside down and connected via jumpers inside the abs case. So I can sort of seperate the two if I needed to.

Do you guys think the htpc psu is not getting up to voltage quick enough and that's my problem? Would it be better for me to use a 7805 off the 12V rail and create my own 5V rail to work with?

I'll try the digital I/O line reset trick tonight and see if I can get it to work, but I'd still like to explore the problem and understand it better.

Do you guys think the htpc psu is not getting up to voltage quick enough and that's my problem? Would it be better for me to use a 7805 off the 12V rail and create my own 5V rail to work with?

If that is basically the only thing that changed as far as connections go, I suspect that may be part of it. It sounds like the rest of your circuit is the same except the new power supply, so I suspect the new power supply. Try using a different power supply.

I like the WIZnet modules, which have the reset brought out to a pin which I connect to an MCU pin. I've used the WIZ811MJ (W5100 chip) and WIZ820io (W5200 chip) with good results.

Sorry for the delay (in case anyone was following my plight).

I got sidetracked with other projects and once you install something in a closet behind some stuff, its just a pain to make yourself go uninstall it.. even if I used terminal strips to speed up the connections..

Anyway - I clipped the wire that connected the w5100 board's reset and the arduino, and instead connected it to digital pin 7 on the Pro Mini. Added the code below at the top of my setup() function and now it seems to be working like a champ on the bench.

  delay(50);             //wait for voltage to stabilize
  pinMode(7, OUTPUT);   //pin connected to w5100 shield's reset
  digitalWrite(7, LOW);  //pull line low for 100ms to reset ethernet shield
  delay(100);
  digitalWrite(7, HIGH);  //set line high and now ignore pin the rest of the time

Thanks for the help and guidance guys!

There is simple solution. In the W5100 datasheet is written:
MR (Mode register) Bit 7 RST (S/W reset) If this bit is ‘1’, internal register will be initialized. It will be automatically cleared after reset.
It means chip is finished with software reset when this bit is = 0.
Modify the w5100.cpp (part of Ethernet library) and add

uint8_t resetState;
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
do {
resetState = readMR();
} while ((resetState & (1<<RST)) != 0);
SPI.endTransaction();

at the end of void W5100Class::init(void) function.

I was able to add the code as you said to the ethernet library but it didn't resolve the reset issue. Do I need to do anything other than add the code to the library, save, and then verify and upload the project?