-
RA5/MCLR input in 16f88
Hi ,I have an simple question for 16F88
Could I change RA5/MCLR pin from reset function to input function using an switch ?
For example:
If button is low for more that 5 seconds set RA5 as input
If button is low for more that 10 seconds set RA5 as MCLR
Any help ?
Thanks
-
NO ! Only software !
Don Mario
-
Kacho, you can produce what looks like a reset by inserting these lines of code where you need the reset to occur:
clear
@ clrf PCLATH
@ goto 0
It will nor reset the hardware registers but clear all user variables and start the probram from scratch as if it was just reset.
Dave Purola,
N8NTA
-
Thanks Dave,
the question is that :could I change with
if button > 5 sec then @DEVICE MCLR_OFF .... and later
If button > 10 sec. then @DEVICE MCLR_ON
...
or this is possible only in the initial declarations ?
Thxs
-
i don't believe it's gonna work. These setting are only for the PIC programmer at programming time.
-
A simple clear is to jump to the beginning of the program if pin 5 = xxx
with very little work , you do what you want for clearing registers ...
Now, If your program fails, then it's a programming problem ... not a hardware problem.
Remenber chips never do errors ...
Alain