Timer B
M30240 Group
Rev.1.00 Sep 24, 2003 Page 77 of 360
Figure 1.72: Timer B-related registers (2)
1.2.22.1 Timer mode
In this mode, the timer counts an internally generated count source as shown in Table 1.23 .
Table 1.23: Timer B timer specifications in timer mode
Note: Timer B2 does not generate an interrupt; it is used as a prescaler only.
Item Specification
Count source f1, f8, f32
Count operation
• Counts down
• When the timer underflows, it reloads the reload register contents before continuing counting
Divide ratio 1/(n+1) n: Set value
Count start condition Count start flag is set (= 1)
Count stop condition Count start flag is reset (= 0)
Interrupt request
generation timing
The timer underflows (see Note)
Read from timer Count value is read out by reading timer Bi register
Write to timer
• When counting stopped
When a value is written to Timer Bi register, it is written to both reload register and counter
• When counting is in progress
When a value is written to Timer Bi register, it is written to only reload register
(Transferred to counter at the next reload time)
Symbol Address When reset
TABSR 0380
16 0016
Count start flag
Bit name
Bit symbol
WR
b7 b6 b5 b4 b3 b2 b1 b0
Timer B2 count start flag
Timer B1 count start flag
Timer B0 count start flag
Timer A4 count start flag
Timer A3 count start flag
Timer A2 count start flag
Timer A1 count start flag
Timer A0 count start flag
0 : Stops counting
1 : Starts counting
TB2S
TB1S
TB0S
TA 4S
TA 3S
TA 2S
TA 1S
TA 0S
Function
Symbol Address When reset
TB0 0391
16, 039016 Indeterminate
TB1 0393
16, 039216 Indeterminate
TB2 0395
16, 039416 Indeterminate
b7 b0 b7 b0
(b15) (b8)
Timer Bi register (Note)
WR
• Timer mode
0000
16 to FFFF16
Counts the timer's period
Function
Note: Read and write data in 16-bit units.
Values that can be set