PDA

View Full Version : RA5/MCLR input in 16f88



kacho
- 4th April 2005, 14:48
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

Don Mario
- 4th April 2005, 15:25
NO ! Only software !

Don Mario

Dave
- 4th April 2005, 19:03
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

kacho
- 5th April 2005, 17:03
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

mister_e
- 5th April 2005, 17:06
i don't believe it's gonna work. These setting are only for the PIC programmer at programming time.

Acetronics2
- 5th April 2005, 17:21
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