Hello all,
CODE:
You can see the following code in the datasheet, in SimpliciTI software and in other software examples at the init of sleep timer:
char
while (temp == WORTIME0); // Wait until a positive 32 kHz edge
DATASHEET:
The datasheet states: 'Entering PM{0 - 2} and/or updating EVENT0 and has to be aligned to a positive edge on the 32 kHz clock source.'
PROBLEM:
The comment reflects what the datasheet states. But the code does not exactly mean that.
It is only true if the WOR_RES is set to 00. If WOR_RES is set to 11, you are waiting in the while cycle for 1 second not for a 32 kHz clock edge.
Which is true?
A) We have to wait for a 32 kHz edge.
B) We have to wait for a change in WORTIME.