When (WORTIME1:WORTIME0) is read without aligning to +pve edge of slow clock, after external interrupt wakeup from PM2, the values are not consistent. When read after aligning to +ve edge of slow clock, the value seems to be consistent, but it takes any where from "100us to 3ms" to align to +ve edge. Is there any particular order to do this??
If I have the following code Immediately after wake up from PM2 due to external interrupt,
temp1lsb = WORTIME0;
temp1msb = WORTIME1;
char temp = WORTIME0;
while(temp == WORTIME0);
temp2lsb = WORTIME0;
temp2msb = WORTIME1;
The temp2lsb, and temp2msb are correct relative to the time it entered in to sleep mode.
temp1lsb is read as "4", and temp1msb is read as "0"
The problem is it takes any where from 100us to 3.2ms for the loop.
Any Ideas what is going on??
Thanks!!