Go Down

Topic: Reset the board automatically (Read 2 times) previous topic - next topic

Coding Badly

Quote
DON'T do this one.  Neither the reset nor the arduino bootloader does not reset the watchdog


That's a bit strong given the fact that it's fairly easy to shut off the watchdog at the top of setup.

- Brian

madworm

How about  using a big cap + resistor on the reset line ?

       5V
        |
        |
        |
      |   |
      |   |  10k
      |   |
      |   |
        |
        |
        +---------- reset pin
        |
        |
      -----  47µF
      -----
        |
        |
        |
      GND
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

westfw

Quote
Quote
DON'T do this one.  Neither the reset nor the arduino bootloader does not reset the watchdog
That's a bit strong given the fact that it's fairly easy to shut off the watchdog at the top of setup.

But it's not.  Depending on the bootload, the arduino spends several seconds flashing the leds in a "healthy" sequence and/or checking for serial traffic to see whether it should upload a new sketch or start the existing one.  If you've gotten it to reset by setting a short watchdog timeout and going into a  loop, you might never get to the setup in your sketch before the next watchdog reset happens.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234876699
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234338562

Coding Badly

Quote
DON'T do this one.  Neither the reset nor the arduino bootloader does not reset the watchdog
Quote
That's a bit strong given the fact that it's fairly easy to shut off the watchdog at the top of setup.
Quote
But it's not.


Ah.  Got it.  I'm using an Arduino compatible board that doesn't have this problem.  I assumed all boards behaved like mine.

It may be possible to avoid this problem by using the "Interrupt and System Reset Mode".  It all depends on how the processor behaves if the watchdog is turned off in the ISR.

- Brian

estranged

If I understand the reset correctly, the physical button resets it by bringing the RESET pin LOW.  Is it possible to connect the reset pin to one of the digital IO pins and use a digitalWrite(connect_to_reset_pin, LOW) ?

Go Up