
400
Timer A Applications
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
3.4 Buzzer Output
Overview
Specifications
Operation
Figure 3.4.1. Operation timing of buzzer output
The timer mode is used to make the buzzer ring. Figure 3.4.1 shows the operation timing, and
Figure 3.4.2 shows the set-up procedure.
Use the following peripheral function:
The pulse-outputting function in timer mode of timer A.
(1) Sound a 2-kHz buzz beep by use of timer A0.
(2) Effect pull-up in the relevant port by use of a pull-up resistor. When the buzzer is off, set the
port high-impedance, and stabilize the potential resulting from pulling up.
(3) Connect a 10-MHz oscillator to X
IN
.
(1) The microcomputer begins performing a count on timer A0. Timer A0 has disabled interrupts.
(2) The microcomputer begins pulse output by setting the pulse output function select bit to
“Pulse output effected”. P7
5
changes into TA0
OUT
pin and outputs 2-kHz pulses.
(3) The microcomputer stops outputting pulses by setting the pulse output function select bit to
“Pulse output not effected”. P7
5
goes to an input pin, and the output from the pin becomes
high-impedance.
“0”
“1”
“0”
“1”
Timer A0
overflow timing
Count start flag
Pulse output
function select bit
P7
5
output
“0”
“1”
High-impedance
High-impedance
(1) Start count
(2) Buzzer output ON
(3) Buzzer output OFF