If sleep mode is entered by enabling both Sleep Timer, and external interrupt,
1) Is it possible to find out how much sleep time left, when wake up happens due to external interrupt??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
singam said:If sleep mode is entered by enabling both Sleep Timer, and external interrupt,
1) Is it possible to find out how much sleep time left, when wake up happens due to external interrupt??
I would presume that reading the WORTIME1, WORTIME0, WOREVT1 and WOREVT0 would tell you how much time was left.
time left = (WOREVT1:WOREVT0) - (WORTIME1:WORTIME0) ;
When (WORTIME1:WORTIME0) is read without aligning to +pve edge of slow clock, after external interrupt wakeup, the values are not consistant. When read by aligning to +ve edge of slow clock, the value seems to be consistant, but it takes more than 2ms to align to +ve edge.
I am looking for some sleep/wake up logic, which uses 32.768K crystal OSC, and at the same time can wake up using external interrupt, and timing align to listen to beacon.
Also in the spec 10.2.3.3 of the CC2510 spec, It says CLKCON is retained after PM2, and in the CLKCON register description, OSC32K is not retained. Does that mean, after wake up from PM2, the slowclock is set back to RC??
Appreciate any help/direction to find a solution for above issue!!
Thanks!!