English
Language : 

JN516X Datasheet, PDF (43/94 Pages) NXP Semiconductors – IEEE802.15.4 Wireless Microcontroller
A wakeup timer consists of a 41-bit down counter clocked from the selected 32 kHz clock. An interrupt or wakeup
event can be generated when the counter reaches zero. On reaching zero the counter will continue to count down
until stopped, which allows the latency in responding to the interrupt to be measured. If an interrupt or wakeup event
is required, the timer interrupt should be enabled before loading the count value for the period. Once the count value
is loaded and counter started, the counter begins to count down; the counter can be stopped at any time through
software control. The counter will remain at the value it contained when the timer was stopped and no interrupt will
be generated. The status of the timers can be read to indicate if the timers are running and/or have expired; this is
useful when the timer interrupts are masked. This operation will reset any expired status flags.
11.3.1 32 KHZ RC Oscillator Calibration
The 32 KHZ RC oscillator that can be used to time sleep periods is designed to require very little power to operate
and be self-contained, requiring no external timing components and hence is lower cost. As a consequence of using
on-chip resistors and capacitors, the inherent absolute accuracy and temperature coefficient is lower than that of a
crystal oscillator, but once calibrated the accuracy approaches that of a crystal oscillator. Sleep time periods should
be as close to the desired time as possible in order to allow the device to wake up in time for important events, for
example beacon transmissions in the IEEE802.15.4 protocol. If the sleep time is accurate, the device can be
programmed to wake up very close to the calculated time of the event and so keep current consumption to a
minimum. If the sleep time is less accurate, it will be necessary to wake up earlier in order to be certain the event will
be captured. If the device wakes earlier, it will be awake for longer and so reduce battery life.
In order to allow sleep time periods to be as close to the desired length as possible, the true frequency of the RC
oscillator needs to be determined to better than the initial 30% accuracy. The calibration factor can then be used to
calculate the true number of nominal 32kHz periods needed to make up a particular sleep time. A calibration
reference counter, clocked from the 16MHz system clock, is provided to allow comparisons to be made between the
32kHz RC clock and the 16MHz system clock when the JN516X is awake and running from the 32MHZ crystal.
Wakeup timer0 counts for a set number of 32kHz clock periods during which time the reference counter runs. When
the wakeup timer reaches zero the reference counter is stopped, allowing software to read the number of 16MHz
clock ticks generated during the time represented by the number of 32kHz ticks programmed in the wakeup timer.
The true period of the 32kHz clock can thus be determined and used when programming a wakeup timer to achieve a
better accuracy and hence more accurate sleep periods
For a RC oscillator running at exactly 32,000Hz the value returned by the calibration procedure should be 10000, for
a calibration period of twenty 32,000Hz clock periods. If the oscillator is running faster than 32,000Hz the count will
be less than 10000, if running slower the value will be higher. For a calibration count of 9000, indicating that the RC
oscillator period is running at approximately 35kHz, to time for a period of 2 seconds the timer should be loaded with
71,111 ((10000/9000) x (32000 x 2)) rather than 64000.
© NXP Laboratories UK 2013
JN-DS-JN516x v1.1 Production
43