345
CHAPTER 15 BUZZER OUTPUT
15.5
Program Example for Buzzer Output
This section shows an program example for buzzer output.
■
Program Example for Buzzer Output
●
Processing specification
Suppose that the buzzer output of 3.052 kHz is output to the BZ pin and then the buzzer output is cut off.
If 2
12
/F
CH
is selected when the oscillation (F
CH
) is 12.5 MHz, the buzzer output frequency is calculated as
follows:
Buzzer output frequency: 12.5 MHz/2
12
= 12.5 MHz/4096 = 3.052 kHz
●
Coding example
BZCR
EQU
0018H
; Address of the buzzer register
;-------------------Main program-----------------------------------------------------------------
CSEG
; [CODE SEGMENT]
:
MOV
BZCR,#00000010
; Buzzer output on (3.052 kHz / Oscillation of 12.5 MHz)
:
:
:
MOV
BZCR,#00000000
; Buzzer output off (I/O port or PPG output)
:
:
ENDS
; ----------------------------------------------------------------------------------------------------------
END
Summary of Contents for F2MC-8L F202RA
Page 2: ......
Page 4: ......
Page 32: ...16 CHAPTER 1 OVERVIEW ...
Page 90: ...74 CHAPTER 3 CPU ...
Page 142: ...126 CHAPTER 5 TIME BASE TIMER POPW A RETI ENDS END ...
Page 150: ...134 CHAPTER 6 WATCHDOG TIMER ...
Page 176: ...160 CHAPTER 7 8 BIT PWM TIMER ...
Page 220: ...204 CHAPTER 8 8 16 BIT CAPTURE TIMER COUNTER ...
Page 240: ...224 CHAPTER 9 12 BIT PPG TIMER ...
Page 274: ...258 CHAPTER 11 EXTERNAL INTERRUPT CIRCUIT 2 LEVEL ...
Page 362: ...346 CHAPTER 15 BUZZER OUTPUT ...
Page 390: ...374 CHAPTER 17 FLASH MEMORY ...
Page 419: ...403 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 434: ...418 INDEX ...
Page 436: ......