RM0016 Auto-wakeup (AWU)
Doc ID 14587 Rev 8 117/449
Example 1
● f
LS
= 128 kHz
● Target time interval = 6 ms
The appropriate interval range is: 4 ms - 8 ms
so the AWUTB[3:0] value is 0x5.
The APR
DIV
value is:
6 ms = 2
4
x APR
DIV
/ f
LS
=> APR
DIV
= (6*10
-3
x f
LS
) / 2
4
= 48
so the APR[5:0] value is 48 (0x30)
Example 2
● f
LS
= 128 kHz
● Target time interval = 3 s
The appropriate interval range is: 2.080 s - 5.120 s
So the AWUTB[3:0] value is 0xE.
The APR
DIV
value is:
3 s = 5 x 2
11
x APR
DIV
/ f
LS
=> APR
DIV
= (3 x f
LS
) / 5 x 2
11
= 37.5
So the AWUTB[3:0] can be either 37 or 38 which gives a time base of 2.96s or 3.04s
respectively. This is not exactly 3s.
12.3.3 LSI clock frequency measurement
The frequency dispersion of the low speed internal RC (LSI) oscillator after RC factory
trimming is 128 kHz +/- 12.5% on the whole temperature range. To obtain a precise AWU
time interval or beeper output, the exact LSI frequency has to be measured.
Use the following procedure:
1. Set the MSR bit in the Control/status register (AWU_CSR) to connect the LSI clock
internally to a timer input capture.
2. Measure the frequency of the LSI clock using the Timer input capture interrupt.
3. Write the appropriate value in the APR [5:0] bits in the Asynchronous prescaler register
(AWU_APR) to adjust the AWU time interval to the desired length. The AWUTB[3:0]
bits can be modified to select different time intervals.
LSI clock frequency measurement can also be used to calibrate the beeper frequency (see
Section 13.2.2).