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
suggests that you haven't actually been able to set up an interrupt handler at all. You should look in the CC5X manual, which gives an example of how to set up an interrupt handler.
Here is a simple example of how to set up an interrupt handler in CC5X:
(this is for Timer0). You can't have any code before the interrupt handler