Technical information
2-16
3800 GROUP USER’S MANUAL
APPLICATION
2.2 Timer
Fig. 2.2.15 Setting of related registers [Piezoelectric buzzer output]
Control procedure :
Figure 2.2.16 shows a control procedure.
Fig. 2.2.16 Control procedure [Piezoelectric buzzer output]
0
63
TX
Timer X (Address : 25
16)
Set “division ratio – 1”
010
CNTR0 active edge switch bit : Output from the “H” level
Timer X count stop bit : Count stop
Set to “0” at starting to count.
Timer X operating mode bits : Pulse output mode
TM
Timer XY mode register (Address : 23
16)
b7 b0
1
b7 b0
PREX
Prescaler X (Address : 24
16)
b7 b0
Initialization
P5
P5D
ICON1
TM
TX
PREX
....
....
....
0
XXXX1001
2
64 – 1
1 – 1
(Address : 0A
16
), bit4
(Address : 0B
16
)
(Address : 3E
16
), bit4
(Address : 23
16
)
(Address : 25
16
)
(Address : 24
16
)
A piezoelectric buzzer
is requested?
RESET
Y
N
Main processing
TM (Address : 23
16
), bit3 0
During stopping outputting a piezoelectric buzzer
During outputting a piezoelectric buzzer
Output unit
●
TM (Address : 23
16
),
TX (Address : 25
16
)
64 –1
X : This bit is not used in this application.
Set it to “0” or “1.” It’s value can be disregarded.
●
Timer X interrupts : Disabled
The CNTR
0
output is stopped at this point (stop
outputting a piezoelectric buzzer).
Set “division ratio – 1” to the Prescaler X and
Timer X.
●
●
●
The piezoelectric buzzer request occured in the
main processing is processed in the output unit.
1
XXX1XXXX
2
bit3 1