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.

CC2530: Wake up from sleep

Part Number: CC2530

Dear TI,

Here is one thing that puzzles me, hope you can help me to sort it out.

I am using PM2 with the sleep timer set to wake up every two seconds. That part works fine, but occasionally, the MCU wakes up before the sleep timer expires. Not very often, maybe a few times per hour (which makes it such a delight to debug). According to the datasheet:

"The system goes to active mode on reset, an external interrupt, or when the Sleep Timer expires."

I am using the suggested assembler routine in the datasheet to enter sleep mode. I'm also using CLR EA to be able to trace what made the MCU wake up.

It is not reset, and by reading the interrupt flags, I can clearly see it is not the sleep timer. This leaves the external interrupts left, and the only external int that is enabled and has an asserted interrupt flag is timer 4, which I use to create a periodic system tick every ms.

BUT, what I don't get is how this interrupt can be set during sleep? The 32 MHz timer is supposed to be off during sleep, right?

I've added the following lines, and so far no unexpected wakeup, but I would like to sort this out once and for all, so please let me know how this can happen.

T4IE = 0;
EnterSleepMode(); // no command / invalid command, return to sleep
T4IE = 1;
return; // this is where execution will resume, make function start over

BR,

Andreas