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

    Join Date
    Apr 2018
    Location
    iran-tehran
    Posts
    7
    Helped
    0 / 0
    Points
    75
    Level
    1

    [moved] how to reset ATmega32 with code?

    how to reset ATmega32 with code?

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 66,089, Level: 62
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,437
    Helped
    3101 / 3101
    Points
    66,089
    Level
    62

    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.

  3. #3
    Newbie level 4
    Points: 75, Level: 1

    Join Date
    Apr 2018
    Location
    iran-tehran
    Posts
    7
    Helped
    0 / 0
    Points
    75
    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: 66,089, Level: 62
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,437
    Helped
    3101 / 3101
    Points
    66,089
    Level
    62

    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.



    •   AltAdvertisment

        
       

  5. #5
    Super Moderator
    Points: 248,140, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,155
    Helped
    13131 / 13131
    Points
    248,140
    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,703, Level: 22
    Achievements:
    7 years registered
    Easyrider83's Avatar
    Join Date
    Oct 2011
    Location
    Tallinn, Estonia
    Posts
    1,546
    Helped
    352 / 352
    Points
    8,703
    Level
    22

    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: 248,140, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,155
    Helped
    13131 / 13131
    Points
    248,140
    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.



    •   AltAdvertisment

        
       

  8. #8
    Super Moderator
    Points: 66,089, Level: 62
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,437
    Helped
    3101 / 3101
    Points
    66,089
    Level
    62

    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 4
    Points: 75, Level: 1

    Join Date
    Apr 2018
    Location
    iran-tehran
    Posts
    7
    Helped
    0 / 0
    Points
    75
    Level
    1

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

    WDRF!
    is this ur intention?



--[[ ]]--