This is a short summary and notes about shutdown state and sleep timer:
There is no Si4010 sample application that uses the sleep timer, the keyfob_demo_2 example project can be used as a starting point to add and experiment sleep timer usage.
The Si4010 goes to shutdown state if vSys_Shutdown() was called. In shutdown state the RAM has no power, RAM content is lost, so further in-system-debugging is not possible. In shutdown most part of the chip is powered down. Waking up the chip from shutdown results a power on reset, boot and start of user code from address 0.
The wake up event can happen because of two causes:
- A GPIO is pulled low (e.g., a push button is pressed).
- The (previously enabled) sleep timer expires.
The sleep timer starts whenever you load a 24bit value in it other than zero. It can be seen as it counts down by reading the timer value by calling lSleepTim_GetCount(). Note that vSleepTim_GetCount() stops the sleep timer for the time of reading, so it prevents the sleep timer from counting if polled continuously.
The sleep timer keeps counting down also in shutdown state. When the sleep timer counts down to zero, it stops. If the chip is in shutdown state at the timeout and the 25th (power) bit of the sleep timer was set, the chip will wake up and boot and start execution from address 0.
The LSb of the sleep timer counts at about 2.4kHz. The lSleepTim_GetOneHourValue function returns a calibrated value which represents one hour count of the sleep timer of that particular chip. This can be used to achieve accuracy of ±1.5%.
Example of a wake up timing of five minutes:
vSleepTim_SetCount (( lSleepTim_GetOneHourValue()/12) | 0x01000000); vSys_Shutdown;
Note that the vSys_FirstPowerUp function clears the sleep timer, so should not be called in a button-less application. There is no need to use it if vSys_BandGapLdo is never set to zero.
For further details see sections 18. and 29. of the datasheet and chapter 7.15. of AN370 at https://www.silabs.com/documents/public/application-notes/AN370.pdf