Hi All!
I have a PIC16f877a. I want to work with the device mainly in sleep, wake on RB change, do some stuff (say led blink) and go back to sleep.
This code works fine if i put the blink code in the ISR. How do i use this code in the main program in C? I tried :- main() { // initialization of interrupts etc...
s1 :asm("SLEEP"); asm("NOP"); RE0=0x1; delay(); a fn. for 1s delay RE0=0; goto s1; }
The code works one the first run. Then the device doesnt go back to sleep i.e it keeps blinkin LED after 1st interrupt (it should blink just once right?)
Devyn