Technical information

2-14
3800 GROUP USER’S MANUAL
APPLICATION
2.2 Timer
Control procedure :
Figure 2.2.12 shows a control procedure.
Fig. 2.2.12 Control procedure [Clock function]
RESET
Initialization
SEI
TM
ICON1
PREX
TX
TM
CLI
....
....
....
....
(Address : 2316)
(Address : 3E
16), bit4
(Address : 24
16)
(Address : 25
16)
(Address : 23
16), bit3
XXXX1X002
1
256 – 1
256 – 1
0
X : This bit is not used in this application.
Set it to “0” or “1.” It’s value can be disregarded.
Timer X interrupt processing routine
CLT (Note 2)
CLD (Note 3)
Push register to stack
RTI
Y
N
Clock stop?
Clock count up (1/4 second-year)
Pop registers
Check if the clock has already been set.
Count up the clock.
Pop registers which is pushed to stack
Main processing
PREX
TX
IREQ1
....
(Address : 2416)
(Address : 25
16)
(Address : 3C
16), bit4
256 – 1
256 – 1
0
[Processing for completion of setting clock]
(Note 1)
Note 1: This processing is performed only
at completing to set the clock.
When restarting the clock from zero
second after completing to set the
clock, re-set timers.
Note 2: When using the Index X mode flag (T).
Note 3: When using the Decimal mode flag (D).
Push the register used in the interrupt
processing routine into the stack.
Timer X : Timer mode
Timer X interrupt : Enabled
Set “division ratio – 1” to the Prescaler X
and Timer X.
Timer X count : Operating
Interrupts : Enabled
All interrupts : Disabled