APPLICATION
2.2 Timer
2-15
3800 GROUP USER’S MANUAL
(3) Timer application example 2 : Piezoelectric buzzer output
Outline :
The rectangular waveform output function of a timer is applied for a piezoelectric buzzer
output.
Specifications :
The rectangular waveform resulting from dividing clock f(X
IN
) = 4.19 MHz into about
2 kHz (2048 Hz) is output from the P5
4
/CNTR
0
pin.
The level of the P5
4
/CNTR
0
pin fixes to “H” while a piezoelectric buzzer output is
stopped.
Figure 2.2.13 shows an example of a peripheral circuit, and Figure 2.2.14 shows a connection of the
timer and setting of the division ratio.
Fig. 2.2.13 Example of a peripheral circuit
Fig. 2.2.14 Connection of the timer and setting of the division ratio [Piezoelectric buzzer output]
244
μ
s
244
μ
s
3800 group
PiPiPi....
P5
4
/CNTR
0
Set a division ratio so that the underflow output cycle of the Timer X becomes this value.
The “H” level is output while a piezoelectric buzzer output is stopped.
CNTR
0
output
1/16
1/2
f(X
IN
) = 4.19 MHz
Fixed
Timer X
Fixed
1/64
CNTR
0
1
Prescaler X