How to reset an Atmel AT90CAN128 from software?

Jun 20, 2008 1 Replies

First reply

Rich Webb

The watchdog is your friend and really, really ought to be part of your toolkit. That said, the only other way to make it appear as if the power-on reset has occurred is ... to cause a POR. A "soft" reset by forcing a jump the reset vector will cause the code-side to be…

Read the full reply

Hello all. I'm looking for a relatively clean way to code a software reset for an AT90CAN128 or ATMEGA128 microcontroller using C code (or C with assemby embedded) that will compile under the avr-gcc 3.4.6 compiler chain. Essentially, I want a function softReset() that I can call from my program when appropriate that will reset and reinitialize everything, just as if a POR had occurred or the reset pin had been pulled low. I am ok with the MCUSR register containing garbage after coming out of this reset. I'm trying to avoid using the hardware watchdog and just not petting it, since I think it has to be always on or always off, and I don't want to have to "pet" it while the rest of my program is running. Ideas?



-Will


The watchdog is your friend and really, really ought to be part of your toolkit.

That said, the only other way to make it appear as if the power-on reset has occurred is ... to cause a POR. A "soft" reset by forcing a jump the reset vector will cause the code-side to be reinitialized but the processor's registers and peripherals won't be reset.

You can hook up an inexpensive supervisory IC (Microchip's MCP-130 is one example of many out there) to force a reset of known duration by triggering it from one of your processor's output pins.

Rich Webb Norfolk, VA

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required