Main Site Documentation

Unable to get fractional second hibernate periods


I am trying to achieve a hibernate time of 1.5 seconds, but can only get the Panda II to hibernate in increments of one second. I’ve tried both AddSeconds and AddMilliseconds methods with no luck. For example the following code results in the led blinking at a 1 second interval not 1.5 seconds.

                    // blink LED on on wakeup

Similarly any other entry for the milliseconds delay results in the next lower integer number of seconds. Any suggestions as to why?


This is because the internal hardware only accepts seconds. The wake up is done by hardware.


Thanks for clearing this up. A followup question though. The LPC23xx User manual references millisecond -range periodic interrupts in section 6.2.5, page 586. Specifically,

[quote]The CISS register provides a way to obtain millisecond-range periodic CPU interrupts
from the Real Time Clock.[/quote]

It looks like the longest achievable time is only 62.5 ms, but does this open up a possible path for coding a fractional second RTC wake up from power down mode?


Maybe possible. We can look into it in future but the idea from sleep on RTC is to let the system save power for few minutes. We never imagined the need to sleep for fraction of a second.


Your patience in answering this odd question I appreciate.

The fractional second need comes from a system that is analyzing an event that may last only a few seconds. Power off of course saves battery life but the trade off is determining when data is compromised because the sleep time is too long. Depending on how long the system is active (80 ma draw) to how long it hibernates (8 ma draw) power savings can be substantial. That said, I think it may be time to just get a bigger solar panel as a more robust solution.

Thanks again for your help.


You know you can wake up through an IO so you can somehow get a wake up signal externally. Maybe it can be a simple RC circuit.


Good idea - I’ll look into it.