Hi all
I'm trying to program a PIC16F631 and I need to wake up the pic from a sleep. This should be done from a PIN change (Interrupt), but I can't get it to work.
I have 2 Ports, when both Ports are HIGH the PIC goes to sleep. What I need the PIC to do is wake up if either of the 2 PORTS are HIGH for more than 3 seconds.
I tried setting RABIE to 0 and then setting it to 1 just before I call sleep, but this does not work.
I set GIE to 1 when i initialize the program.
I've also tried the #pragma origin 4 thing but CC5X complains and gives me this error.
So, what I was hoping was that one of you guys could point me in the right direction and tell me what's wrong
I'm trying to program a PIC16F631 and I need to wake up the pic from a sleep. This should be done from a PIN change (Interrupt), but I can't get it to work.
I have 2 Ports, when both Ports are HIGH the PIC goes to sleep. What I need the PIC to do is wake up if either of the 2 PORTS are HIGH for more than 3 seconds.
I tried setting RABIE to 0 and then setting it to 1 just before I call sleep, but this does not work.
I set GIE to 1 when i initialize the program.
I've also tried the #pragma origin 4 thing but CC5X complains and gives me this error.
Code:
Overlapping code
(The pointer to the next free location in each code page can not be
moved backwards (only forwards). This also applies if locations was
skipped by an earlier #pragma origin statement)
So, what I was hoping was that one of you guys could point me in the right direction and tell me what's wrong