Reset using an optoisolator

Hi there

My project is using an optoisolator package with a couple of spare channels. I was wondering if I were to use a channel to connect the reset to ground by setting a digital pin to HIGH.

What happens to the HIGH digital pin as the board resets? If it stays or goes HIGH at any point I guess the board will continually reset?

Is there a way to wire up some form of interrupt to the power supply provided externally to the VCC pin on the power jumper? I was thinking a relay or something, but the same problem would exist about the trigger pin staying HIGH.

nigeljohnson73:
Hi there

My project is using an optoisolator package with a couple of spare channels. I was wondering if I were to use a channel to connect the reset to ground by setting a digital pin to HIGH.

What happens to the HIGH digital pin as the board resets? If it stays or goes HIGH at any point I guess the board will continually reset?

Early in the reset process all the I/O pins go to high impedance input mode, so you lose the digital high and the reset process isn’t long enough to insure a proper reset process. Atmel recommends against trying to cause a reset based on using only a output pin to initiate the process. This topic comes up surprisingly often so there are lots of posts you can research if you wish more details.
Is there a way to wire up some form of interrupt to the power supply provided externally to the VCC pin on the power jumper? I was thinking a relay or something, but the same problem would exist about the trigger pin staying HIGH.

Yes, that would not solve the timing problem. One possible solution is to have a output pin initiate a 555 timer chip to generate the reset pulse with enough length to insure the proper reset process is completed.
Now is the time where one of the usual cast of software gurus would ask you why you need to initiate a reset as that is usually a case of not having proper program structure to begin with, as there is usually never a real need to perform a hardware reset that can’t be solved by proper software?
Lefty

Thanks for the feedback Lefty.

I did see a fair few articles, some using machine code JMP command, some hard-wiring pulses to things but this being bad… I was just wondering of an opto would work because of the complete circuit isolation.

I think I have an answer to the reset conundrum that’ll beat the software gurus though :slight_smile: I have implemented a serial protocol for setting and getting variables that control my application, also some command will interact with the bluetooth modem but require a restart to take effect. If you can justify having a reset button (instead of just removing power and re-applying it) then it would be nice to be able to call it remotely over the serial link :slight_smile:

Cheers
N.

It's nothing to do with isolation, more a timing thing so the optos won't help. Use

asm ("jmp 0");

To restart the chip, not quite the same as hard reset but usually good enough.

So I ask you why you need to initiate a reset as that is usually a case of not having proper program structure to begin with, as there is usually never a real need to perform a hardware reset that can't be solved by proper software?

Ooo, there's an echo in here :slight_smile:

some command will interact with the bluetooth modem but require a restart to take effect.

The Arduino is reset or the BT module? If the BT then none of the above applies. If the Arduino you must be storing information in EEPROM or other non-volatile memory or there is no point.


Rob

Yeah timing is important. Just a theoretical question I guess.

Graynomad:
The Arduino is reset or the BT module?

When I got the BT module I wanted to change the baud rate which required a reset on the BT module. After sending the comand from my PC via a serial terminal I reset the arduino then reconnected my serial terminal at the new baud rate and it worked. Thinking about it I'm not sure it should have worked, but that's how I think I remember it :slight_smile:

I agree though, the reset button is not the answer to bad code, but the device does have a reset button. Pulling the power cable and sticking it back in would have saved a few cents on the board so someone thought it important?? :slight_smile:

p.s. don't forget the immortal words... "You'l never need more than 640k". The fact that so many people are asking about it would indicate it mildly important to the community, even if that specific part of the community is a bunch of noobs.

p.p.s... got another one... having a software reset would allow the IDE to upload sketches over a bluetooth module without the need for flow control.