Chapter 15
Buzzer
XV - 6 Operation
15.3.2 Setup Example
Setup Example
The following example shows how to output the buzzer of 2.44 kHz from BUZB pin under the 10 MHz of f
HCLK
.
Step Setup Procedure Register Description
1 Set the buzzer frequency BUZCTR Set the BUZCTR.BUZS to "010".
2 Set the buzzer output pin BUZCNT
P0OUT
P0DIR
Select the P02 as the buzzer output pin by
- Setting the BUZCNT.BUZEN to 1.
- Setting the BUZCNT.BUZSEL to 1.
Select the output direction, and the output data of "1" at P02.
- Set the P0OUT.P0OUT2 to "0".
- Set the P0DIR.P0DIR2 to "1".
3 Enable buzzer output BUZCTR Set the BUZCTR.BUZOE to "1".
4 Disable buzzer output BUZCTR Set the BUZCTR.BUZOE to "0".
"Low" level signal is output from buzzer output pin.