Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

RM0016

Auto-wakeup (AWU)

 

 

Example 1

fLS = 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 APRDIV value is:

6 ms = 24 x APRDIV / fLS => APRDIV = (6*10-3 x fLS ) / 24 = 48 so the APR[5:0] value is 48 (0x30)

Example 2

fLS = 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 APRDIV value is:

3 s = 5 x 211 x APRDIV / fLS => APRDIV = (3 x fLS ) / 5 x 211 = 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.3LSI 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).

Doc ID 14587 Rev 9

117/454

Соседние файлы в папке Минимум документации STM8_1