Reset MCU by itself.
-
- Posts: 149
- http://meble-kuchenne.info.pl
- Joined: Tue Oct 19, 2021 9:31 am
- Has thanked: 75 times
- Been thanked: 5 times
Reset MCU by itself.
Sometimes I need to refresh algorithm from any point to Start. I made pinout logical "1" with resistor 240 Ohm to RST pin. When counter counts to some value, program make RST to zero by this pinout put in logical "0" and MCU starts working from begin. Is this way correct or may it call any problems in future?
-
- Valued Contributor
- Posts: 1066
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 201 times
- Been thanked: 225 times
Re: Reset MCU by itself.
Hi Sergejs
What kind of processor do you have?
Many have a command for reset. So you can use a C command.
Or you can use a watch dog that you don't reset anymore. Then your processor will restart.
regards
Stefan
What kind of processor do you have?
Many have a command for reset. So you can use a C command.
Or you can use a watch dog that you don't reset anymore. Then your processor will restart.
regards
Stefan
Re: Reset MCU by itself.
Hello, I use Arduino Nano. I don't know any program language. When I turn On WDT it restarts every time, just MCU not started yet WDT make reseting all the time and MCU never start working. I don't know why but it happen on all my projects with any PIC or Atmega.
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: Reset MCU by itself.
HI
then you need to pull the MCLR pin up to VDD if not the mcu will also reset all the time ,
If you pull MCLR up you can add a buton as reset button if you want to reset the mcu as one way the second is using the Reset command
Well that is the job of the WDT to reset the microcontroller and you need to clear it in Code or swith it off ,if not the mcu will always reset.When I turn On WDT it restarts every time, just MCU not started yet WDT make reseting all the time and MCU never start working.
then you need to pull the MCLR pin up to VDD if not the mcu will also reset all the time ,
If you pull MCLR up you can add a buton as reset button if you want to reset the mcu as one way the second is using the Reset command
Regards Peter - QME Electronics
-
- Valued Contributor
- Posts: 1066
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 201 times
- Been thanked: 225 times
Re: Reset MCU by itself.
Hi Peter, Hi Sergejs
There is a command but I dont now how to insert it in Flowcode.
It is okay to use a reset switch or a resistor from a port. But you can also try to improve your program so that no reset is necessary.
regards
Stefan
There is a command but I dont now how to insert it in Flowcode.
It is okay to use a reset switch or a resistor from a port. But you can also try to improve your program so that no reset is necessary.
regards
Stefan
The easiest way to reset Arduino through programming is to use the built-in reset function resetFunc (), which is available in the Arduino libraries. All you need to do is write the code and call the reset function at address location 0. This code will reset your Arduino board and start executing the program from the first line of code
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: Reset MCU by itself.
Hi Guys,
I never used this Reset function on either PIC or AVR however I know the XC8 for PIC has Reset() Macro which can be called.
Calling the reset macro from a C Icon seems to compile fine and is generated in the C code so I would think that it will work
for XC8 it is Reset();
Maybe some one can try it

I never used this Reset function on either PIC or AVR however I know the XC8 for PIC has Reset() Macro which can be called.
Calling the reset macro from a C Icon seems to compile fine and is generated in the C code so I would think that it will work
for XC8 it is Reset();
Maybe some one can try it


Regards Peter - QME Electronics