PDA

View Full Version : Reset Button



burak450
- 28th February 2009, 10:41
Hi,
I designed a program but there are some infinite loops.I have a button.I wanna the program will reset itself (I think pic will reset itself) and will go start point when I push this button.How can I do that?

mat janssen
- 28th February 2009, 10:45
No code !
No Help .

Jumper
- 28th February 2009, 11:01
If you use external MCLR you can always connect a push button and a 100 ohm resistor to gnd. Close the button and MCLR is held low and the PIC will reset and when you release the button the PIC will start from the top of your program again.

Do not pull MCLR directly to GND without a 100 ohm resistor or something similar because too big currents on this pin might cause latch up and then the PIC will stay off. This is mentioned in the datasheet for you PIC usually in the MCLR section.

If you have an 18-series PIC you can just add a button in your normal code and then when it is pushed you do @RESET and then it will restart. But this way you need to make sure you can always scan the button from inside every loop. Using the PB on MCLR will allow you to reset the PIC even if the software has hung up on some unexpected event.

burak450
- 28th February 2009, 11:01
Can I not use MCLR pin :confused:


Edit:I just said that thanks...

bogdan
- 28th February 2009, 20:13
why you didn't use interrupts ?