Reset Under Software Control

Combining the power of the ATmega2560 MCU with onboard Ethernet, a microSD card slot, an efficient switchmode power supply, and a small prototyping area. [Product page]
Post Reply
JamesBrown
Posts: 7
Joined: Fri Apr 12, 2013 6:27 pm

Reset Under Software Control

Post by JamesBrown » Tue Jul 30, 2013 3:21 am

I need to have a way that the EtherMega can be reset under software control.
I need this to allow the board to run in a network that may power off and off at random times and would require Ethernet boards to reconnect themselves automatically.

I have seen reference to connecting a IO pin to the Reset line and then pulling it HIGH at Startup but this seems like a dangerous hack on the board.

Is there a better way to do this with the EtherMega?

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Reset Under Software Control

Post by andrew » Tue Jul 30, 2013 11:04 pm

Create a simple 555 timer monostable circuit that runs for about half a second when triggered by a digital output pin of choice, then put the output through a 74HC14 to invert it - the output connected to the reset pin.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Reset Under Software Control

Post by angusgr » Wed Jul 31, 2013 3:52 am

Hi James,

There's a link to a previous discussion of this problem here, with a circuit diagram of what John is referring to:
viewtopic.php?f=4&t=4940&start=10#p9423

- Angus

JamesBrown
Posts: 7
Joined: Fri Apr 12, 2013 6:27 pm

Re: Reset Under Software Control

Post by JamesBrown » Wed Jul 31, 2013 6:10 pm

Johnb and angusgr - Thanks for the link. I'll give it a try.
I'm not sure if it will reset the Ethernet link as well though. Any ideas?

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Reset Under Software Control

Post by angusgr » Wed Jul 31, 2013 11:50 pm

If you toggle the Reset line this will also reset the W5100 Ethernet chip.

However, re-reading the question - are you talking about just the network going down and coming back up, while the EtherMega remains powered? If so then it may be enough to just perform a software reset of the EtherMega rather than a hardware reset, and have it reestablish the connection. One way to do a software-only reset like that is via the internal "watchdog" reset, take a look at the bottom of this blog post under "To add the remote reset functionality..."
http://www.freetronics.com/pages/how-to ... -a-network
(That shows how to use the network to trigger a software reset, but you could do something similar to trigger a reset if the link goes down or if no communications have been received for some time.)

You'll need to do some experimenting yourself to work out which of the software or hardware reset methods works better for your purposes. The hardware reset is probably more reliable in the long term.

- Angus

Post Reply