Fujitsu FR81S User Manual
CHAPTER 19: BASE TIMER
5. Operation
FUJITSU SEMICONDUCTOR LIMITED
CHAPTER
: BASE TIMER
FUJITSU SEMICONDUCTOR CONFIDENTIAL
55
5.4.4. 32-bit Timer Mode Operation
This section explains the 32-bit timer mode operation.
This section explains the setting and operation for cascading 2 channels of a 16-bit reload timer and using
them as a 32-bit reload timer.
Overview
Using the T32 bit of the base timer x timer control register (BTxTMCR), 2 channels of a 16-bit reload timer
can be cascaded and used as a 32-bit reload timer. In this mode, the even-numbered channel corresponds to
the lower 16-bit operation, and the odd-numbered channel corresponds to the upper 16-bit operation.
Therefore, set the reload values in the order of the upper 16 bits (odd-number channels) → the lower 16 bits
(even-number channels) and read the down counter values in the order of the lower 16 bits (even-number
channels) → the upper 16 bits (odd-number channels).
Setting Procedure (Example)
To set 32-bit timer mode, set the T32 bit of the base timer x timer control register (BTxTMCR) of
even-number channels to "1" and the T32 bit of the base timer x timer control register (BTxTMCR) of the
odd-number channels to "0". When setting 32-bit timer mode, set the registers using the procedure shown
below. Different register settings should be used between even-number and odd-number channels. The
following shows an example of using a cascade connection.
1. Specify ch.0 to reset mode by setting FMD2 to FMD0 bits of base timer 0 timer control register
(BT0TMCR). (FMD2 to FMD0 = 000)
2. Select 16/32-bit reload timer for ch.0 and ch.1 by setting the FMD2 to FMD0 bits of the base timer x
timer control register (BT0TMCR, BT1TMCR) of ch.0 and ch.1. (FMD2 to FMD0 = 011)
At the same time, select 32-bit timer mode by setting the T32 bit of the base timer 0 timer control
register (BT0TMCR).
3. Set a reload value in the upper 16 bits in the base timer 1 cycle setting register (BT1PCSR).
4. Set a reload value in the lower 16 bits in the base timer 0 cycle setting register (BT0PCSR).
Notes:
⋅
Rewrite the T32 bit while the operation of both of the even-number and odd-number channels is
stopped. Whether the counting operation is stopped can be checked by setting the CTEN bit of the base
timer x timer control register (BTxTMCR) to "0"(CTEN=0).
⋅
A reload value in the base timer x cycle setting register (BTxPCSR) must be set in the order of the
odd-number → even-number channels.
Operation
In 32-bit timer mode, the counting operation is basically the same as in 16-bit timer mode.
However, the counting operation conforms to the settings of the even-number channels, ignoring the settings
of the registers next to the odd-number channels.
⋅
Base timer x timer control register (BTxTMCR)
⋅
Base timer x status control register (BTxSTC)
This section explains the counting in the 32-bit timer mode.
1. When the 32-bit reload timer activates, the values in the odd-number channel base timer x cycle
setting register (BTxPCSR) and the even-number channel base timer x cycle setting register
(BTxPCSR) (lower 16-bit) are loaded to the down counter.
2. The down counter starts counting as a 32-bit counter with the even-number channels serving as the
lower 16-bit and the odd-number channels as the upper 16-bit.
MB91520 Series
MN705-00010-1v0-E
688