Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[moved] how to reset ATmega32 with code?

Status
Not open for further replies.
Hi,

Please give useful informations: You ask for code, thus we need to know:
* what programming language
* what compiler

*****
Generally there are several options:
* add external hardware to temporarily pull down the RESET line. (This may also reset external devices)
* enable the watchdog and wait for the watchdog timeout ( this just resets the microcontroller)
* jump to the reset vector location (this just restarts the software without resetting periferal registers)

Klaus
 
  • Like
Reactions: disjk

    disjk

    Points: 2
    Helpful Answer Positive Rating
c language.
with atmel studio app.
but i cant use hardware for reset mcu!
and my code have a few while(1)! so i cant use watchdog!
 

Hi,

my code have a few while(1)! so i cant use watchdog!
You want to reset the microcontroller with code. A watchdog generates a true microcontroller reset. I don't see why this can't be used.
I don't see what this has to do with while(1) loops.

Klaus
 

AVR watchdog can be enabled at any time by control register. It's the preferred way to perform a programmed reset.
 

It is not preferred, it is only one way to do that :)
Almost agreed. It's a more theoretical option to set all processor register to reset state and jump to reset vector.
 

Hi,

Almost agreed. It's a more theoretical option to set all processor register to reset state and jump to reset vector.
If it's not possible to activate the RESET pin, then it's the only way for a true microcontroller RESET.
Or is there any other solution (that I don't know yet)?

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top