I have an app which is pretty simple (and standard?):
- transmit some data
- wait a short while to listen for another device
- go to sleep (PM2) for about one second, do some housekeeping, go to sleep again........ (transmit again once a minute).
The problem is that current consumption in PM2 is most of the time at around 2mA, i.e. as if the HS RC oscillator is still running. Looking at the scope output, and stripping out all other code except the sleep/wake cycle, it is clear that some sleep seconds use hardly any power (too small to measure on my scope), as expected, but about 75% of the sleep modes are taking 2mA. Exactly the same code is running for every sleep cycle!
I have incorporated all notes from DN106 and errata notes on the subject .
(Later edit.....)
OK, have now got it sleeping correctly every time by adjusting use of WORCTL and WOREVT. But there is a wake period of approx (3 * sleep timer resolution) every time before it sleeps - i.e. about 3 ms or 90 ms depending on setting of WORCTL.WOR_RES.
Does anyone have any code to put the unit to sleep for 1 second reliably, without wasting 3 ms first?