
iVPeRiPheRaLMoDuLes2(tiMeRs):16-bittiMeRs(t16)
iV-1-6
ePson
s1C33L17teChniCaLManuaL
iV.1.5Controlandoperationof16-bittimer
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.
standardmodeandadvancedmode
The 16-bit timer in the S1C33L17 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.
TableIV.1.5.1DifferencesbetweenStandardModeandAdvancedMode
Function
Writingtothecountdataregister
Settingoftheinitialtimeroutput
level(highorlow)
DA16function(DA16registers)
Multipletimerfull-syncfunction
advancedmode
Enabled
(canbespecifiedusingINITOLx)
Canbeused
Supported
(canbecontrolledusingPAUSEx)
standardmode
Disabled(readonly)
Disabled
(dependingontheOUTINVxsetvalue)
Cannotbeused
Notsupported
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: StandardMode/AdvancedModeSelectBitinthe16-bitTimerSTD/ADVModeSelectRegister
(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: Standardoradvancedmodecurrentlysetisappliedtoallthe16-bittimers.Itcannotbeselected
foreachtimerindividually.
settingthecountclock
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-bitTimerxInputClockSelectBitinthe16-bitTimerxControlRegister(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.
internalclock
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-bitTimerxClockDivisionRatioSelectBitsinthe16-bitTimerxClockControlRegister
(D[2:0]/0x3007E0+2x)
P16tonx:16-bitTimerxClockControlBitinthe16-bitTimerxClockControlRegister(D3/0x3007E0+2x)