mobrien99
Joined: 15 Apr 2013 Posts: 3 Location: Penn Yan, NY
|
Sleep mode on a 18F87J11 |
Posted: Tue Jul 23, 2013 9:43 am |
|
|
I would like to extend battery life by sleeping or idling the processor.
I have a 100 ms interrupt routine based on timer1 and an SPI interrupt that comes alive when a packet is received from my SiLabs transceiver tied to pin B0.
Code: |
// define for high to low transitions
ext_int_edge(0,H_TO_L);
enable_interrupts(int_ext); // enable Pin B0 for si4455 interrupts
|
What is the best way to set up the sleep mode? Will the interrupt overflow from the timer1 interrupt routine wake me up and if so would get_timer1 return the utilized ticks to get awake again? If an SPI interrupt would have occurred between the 100ms slices, will I miss that if I am sleeping?
Thanks
Mike O'Brien |
|