TIMER A
7.3 Timer mode
7.3.1 Setting for timer mode
Figure 7.3.2 shows an initial setting example for registers related to the timer mode.
Note that when using interrupts, set up to enable the interrupts. For details, refer to section “CHAPTER
6. INTERRUPTS.”
Selecting timer mode and each function
b7
b0
Timer Ai mode register (i = 0 to 4) (Addresses 5616 to 5A16
)
)
0
0
0
(i = 5 to 9) (Addresses D616 to DA16
Selection of timer mode
Pulse output function select bit (Note)
0 : No pulse output
1 : Pulses output
Gate function select bits (Note)
b4 b3
0
0
0 :
1 :
No Gate function
1
1
0 : Gate function (Counter counts only while TAjIN pin’s input signal level is “L.”)
1 : Gate function (Counter counts only while TAjIN pin’s input signal level is “H.”)
Count source select bits
See Table 7.2.3.
Note: Valid only in timer Aj (j = 0 to 2, 4, 9).
Invalid in timer Ak (k = 3, 5 to 8); therefore, fix each of these bits to “0.”
Timer A0 register (Addresses 4716, 4616
)
Setting division ratio
(b15)
b7
Timer A1 register (Addresses 4916, 4816
)
(b8)
b0 b7
b0
Timer A2 register (Addresses 4B16, 4A16
)
Timer A3 register (Addresses 4D16, 4C16
)
Timer A4 register (Addresses 4F16, 4E16
Timer A5 register (Addresses C716, C616
Timer A6 register (Addresses C916, C816
Timer A7 register (Addresses CB16, CA16
Timer A8 register (Addresses CD16, CC16
Timer A9 register (Addresses CF16, CE16
)
)
)
)
)
)
Can be set to “000016” to “FFFF16” (n).
Note: Counter divides the count source frequency by (n + 1).
Setting interrupt priority level
Setting count start bit to “1.”
Timer Ai interrupt control register
b0
b7
b7
b0
(i = 0 to 4) (Addresses 7516 to 7916
)
Count start register 0 (Address 4016
)
(i = 5 to 9) (Addresses F516 to F916
)
Interrupt priority level select bits
When using interrupts, set these bits to one of
levels 1 to 7.
When disabling interrupts, set these bits to
level 0.
Timer A0 count start bit
Timer A1 count start bit
Timer A2 count start bit
Timer A3 count start bit
Timer A4 count start bit
Setting port P6 and port P2 direction registers
b7
b0
Count start register 1 (Address 4116
)
b7
b0
Port P6 direction register (Address 1016
)
Timer A5 count start bit
Timer A6 count start bit
Timer A7 count start bit
Timer A8 count start bit
Timer A9 count start bit
Pin TA0IN
Pin TA1IN
Pin TA2IN
b7
b0
Port P2 direction register (Address 816
)
Pin TA4IN
Pin TA9IN
When gate function is selected, clear the bit corresponding to the TAjIN
pin to “0.”
Note: In timers A3, A5 to A8, do not set the above registers.
Count starts.
Fig. 7.3.2 Initial setting example for registers relevant to timer mode
7906 Group User’s Manual Rev.2.0
7-13