+ Post New Thread
Results 1 to 9 of 9
  1. #1
    Newbie level 3
    Points: 52, Level: 1

    Join Date
    Apr 2018
    Posts
    4
    Helped
    0 / 0
    Points
    52
    Level
    1

    [moved] how to reset ATmega32 with code?

    how to reset ATmega32 with code?

  2. #2
    Super Moderator
    Points: 60,116, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,276
    Helped
    2840 / 2840
    Points
    60,116
    Level
    59

    Re: [moved] how to reset ATmega32 with code?

    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
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   Alt10th June 2018, 14:36

      advertising

        
       

  3. #3
    Newbie level 3
    Points: 52, Level: 1

    Join Date
    Apr 2018
    Posts
    4
    Helped
    0 / 0
    Points
    52
    Level
    1

    Re: [moved] how to reset ATmega32 with code?

    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!



  4. #4
    Super Moderator
    Points: 60,116, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,276
    Helped
    2840 / 2840
    Points
    60,116
    Level
    59

    Re: [moved] how to reset ATmega32 with code?

    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
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   Alt10th June 2018, 14:50

      advertising

        
       

  5. #5
    Super Moderator
    Points: 244,634, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,495
    Helped
    12948 / 12948
    Points
    244,634
    Level
    100

    Re: [moved] how to reset ATmega32 with code?

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



  6. #6
    Advanced Member level 5
    Points: 8,392, Level: 21
    Easyrider83's Avatar
    Join Date
    Oct 2011
    Location
    Tallinn, Estonia
    Posts
    1,506
    Helped
    336 / 336
    Points
    8,392
    Level
    21

    Re: [moved] how to reset ATmega32 with code?

    It is not preferred, it is only one way to do that :)
    Love me or hate me. All infractions will be ignored.



  7. #7
    Super Moderator
    Points: 244,634, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,495
    Helped
    12948 / 12948
    Points
    244,634
    Level
    100

    Re: [moved] how to reset ATmega32 with code?

    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.



    •   Alt11th June 2018, 07:09

      advertising

        
       

  8. #8
    Super Moderator
    Points: 60,116, Level: 59
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,276
    Helped
    2840 / 2840
    Points
    60,116
    Level
    59

    Re: [moved] how to reset ATmega32 with code?

    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
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  9. #9
    Newbie level 3
    Points: 52, Level: 1

    Join Date
    Apr 2018
    Posts
    4
    Helped
    0 / 0
    Points
    52
    Level
    1

    Re: [moved] how to reset ATmega32 with code?

    WDRF!
    is this ur intention?



--[[ ]]--