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

Beeper (BEEP)

RM0016

 

 

13 Beeper (BEEP)

13.1Introduction

This function generates a beep signal in the range of 1, 2 or 4 kHz when the LS clock is operating at a frequency of 128 kHz.

Figure 26. Beep block diagram

HSE clock (4- 24 MHz)

 

 

 

 

 

 

 

 

CKAWUSEL

 

 

 

 

 

 

PRSC[1:0]

 

 

 

 

 

 

 

 

 

 

 

 

OPTION bit

 

 

 

 

 

 

OPTION bits

 

 

MSR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Prescaler

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

128 kHz LS clock

 

 

 

To timer input capture

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(for measurement)

 

 

LSI RC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

128 kHz

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BEEPDIV[4:0] bits

 

BEEPSEL[1:0] bits

 

fLS

5-BIT BEEPER PROG

~8 kHz

3-BIT COUNTER

1 kHz, 2 kHz, 4 kHz

 

 

 

COUNTER

 

 

 

 

 

BEEP pin

 

 

 

 

 

 

 

BEEPEN

 

13.2Beeper functional description

13.2.1Beeper operation

To use the beep function, perform the following steps in order:

1.Calibrate the LS clock frequency as described in Section 13.2.2: Beeper calibration to define BEEPDIV[4:0] value.

2.Select 1 kHz, 2 kHz or 4 kHz output frequency by writing to the BEEPSEL[1:0] bits in the Beeper control/status register (BEEP_CSR).

3.Set the BEEPEN bit in the Beeper control/status register (BEEP_CSR) to enable the LS clock source.

Note:

The prescaler counter starts to count only if BEEPDIV[4:0] value is different from its reset

 

value, 0x1F.

120/454

Doc ID 14587 Rev 9

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