Download Print this page

Toshiba TLCS-900/H1 Series Manual page 139

Original cmos 32-bit microcontroller
Hide thumbs Also See for TLCS-900/H1 Series:

Advertisement

3.7.4
Operation in Each Mode
(1) 8-bit timer mode
Both TMRA0 and TMRA1 can be used independently as 8-bit interval timers.
1.
Generating interrupts at a fixed interval (using TMRA1)
To generate interrupts at constant intervals using TMRA1 (INTTA1), first stop
TMRA1 then set the operation mode, input clock and a cycle to TA01MOD and
TA1REG register, respectively. Then, enable the interrupt INTTA1 and start
TMRA1 counting.
Example:
To generate an INTTA1 interrupt every 40 μs at f
register as follows:
MSB
← −
TA01RUN
← 0
TA01MOD
← 0
TA1REG
← X
INTETA01
← –
TA01RUN
X: Don't care, −: No change
Select the input clock using Table 3.7.3.
Table 3.7.3 Selecting Interrupt Interval and the Input Clock Using 8-Bit Timer
Input Clock
φT1
(8/f
φT4
(32/f
φT16
(128/f
φT256 (2048/f
Note: The input clocks for TMRA0 and TMRA1 differ as follows:
TMRA0: Uses TMRA0 input (TA0IN) and can be selected from φT1, φT4 or φT16
TMRA1: Matches output of TMRA0 (TA0TRG) and can be selected from φT1, φT16,
φT256
LSB
7
6
5
4
3
2
1
0
X
X
X
0
0
X
X
0
1
1
1
0
0
1
0
0
1
0
1
X
X
X
1
1
Interrupt Interval (at f
0.4 μs to 102.4 μs
)
SYS
1.6 μs to 409.6 μs
)
SYS
6.4 μs to 1.638 ms
)
SYS
102.4 μs to 26.21 ms
)
SYS
92CH21-137
C
Stop TMRA1 and clear it to "0".
Select 8-bit timer mode and select φT1 (=(16/fc)s at f
MHz) as the input clock.
Set TREG1 to 40 μs ÷ φT1 = 100 = 64H.
Enable INTTA1 and set it to level 5.
Start TMRA1 counting.
= 20 MHz)
Resolution
SYS
TMP92CH21
= 40 MHz, set each
= 40
C
0.4 μs
1.6 μs
6.4 μs
102.4 μs
2009-06-19

Advertisement

loading

This manual is also suitable for:

Tmp92ch21fgJtmp92ch21