
IV PERIPHERAL MODULES 2 (TIMERS): 16-BIT TIMERS (T16)
IV-1-6
EPSON
S1C33E07 TECHNICAL MANUAL
IV.1.5 Control and Operation of 16-bit Timer
The following settings must first be made before the 16-bit timer starts counting:
1. Setting pins for input/output (only when necessary) ... See Sections IV.1.2 and I.3.3.
2. Setting count clock
3. Selecting comparison data register/buffer
4. Setting clock output conditions (signal active level, initial signal level, fine mode) ... See Section IV.1.6.
5. Setting comparison data
6. Setting interrupt/DMA ... See Section IV.1.7.
Standard mode and advanced mode
The 16-bit timer in the S1C33E07 is extended from that of the C33 STD models. This 16-bit timer has two
operating modes, standard (STD) mode of which functions are compatible with the existing C33 STD models
and an advanced (ADV) mode allowing use of the extended functions. Table IV.1.5.1 shows differences
between standard mode and advanced mode.
Table IV.1.5.1 Differences between Standard Mode and Advanced Mode
Function
Writing to the count data register
Setting of the initial timer output
level (high or low)
DA16 function (DA16 registers)
Multiple timer full-sync function
Advanced mode
Enabled
(can be specified using INITOLx)
Can be used
Supported
(can be controlled using PAUSEx)
Standard mode
Disabled (read only)
Disabled
(depending on the OUTINVx set value)
Cannot be used
Not supported
To configure the 16-bit timer in advanced mode, set T16ADV (D0/0x3007DE) to 1. The control registers/bits
for the extended functions are enabled to write after this setting. At initial reset, T16ADV (D0/0x3007DE) is set
to 0 and the 16-bit timer enters standard mode.
T16ADV: Standard Mode/Advanced Mode Select Bit in the 16-bit Timer STD/ADV Mode Select Register
(D0/0x3007DE)
The following descriptions unless otherwise specified are common contents for both modes. The extended
functions in advanced mode are explained assuming that T16ADV (D0/0x3007DE) has been set to 1.
Note: Standard or advanced mode currently set is applied to all the 16-bit timers. It cannot be selected
for each timer individually.
Setting the count clock
The count clock for each timer can be selected from between an internal clock and an external clock. Select the
input clock using CKSLx (D3/0x300786 + 8x).
CKSLx: 16-bit Timer x Input Clock Select Bit in the 16-bit Timer x Control Register (D3/0x300786 + 8x)
An external clock is selected by writing 1 to CKSLx (D3/0x300786 + 8x), and the internal clock is selected by
writing 0. At initial reset, CKSLx (D3/0x300786 + 8x) is set for the internal clock.
An external clock can be used for the timer for which the pin is set for input.
Internal clock
When the internal clock is selected as a timer, the count clock is generated from the TMx_CLK (= MCLK) by
the prescaler embedded in each timer.
The prescaler's division ratio can be selected from among eight ratios using P16TSx[2:0] (D[2:0]/0x3007E0 + 2x).
The divided clock is output from the prescaler by writing 1 to P16TONx (D3/0x3007E0 + 2x).
P16TSx[2:0]: 16-bit Timer x Clock Division Ratio Select Bits in the 16-bit Timer x Clock Control Register
(D[2:0]/0x3007E0 + 2x)
P16TONx: 16-bit Timer x Clock Control Bit in the 16-bit Timer x Clock Control Register (D3/0x3007E0 + 2x)