
III PERIPHERAL BLOCK:
Control and Operation of
The following settings must first be made before the
1.Setting pins for input/output (only when necessary)
2.Setting input clock
3.Selecting comparison data register/buffer
4.Setting clock output conditions (signal active level, fine mode)
5.Setting comparison data
6.Setting interrupt/IDMA
For details on how to set clock output conditions and interrupts and DMA, refer to "Controlling Clock Output" and
Setting pin for input/output
The pin must be set for output for the output clock of the
The pin for input must be set for the
For details on how to set the pin, refer to "I/O Pins of
Setting the input clock
The count clock for each timer can be selected from between an internal clock and an external clock. Use the following control bits to select the input clock:
Timer 0 input clock selection: CKSL0 (D3) /
Timer 1 input clock selection: CKSL1 (D3) /
Timer 2 input clock selection: CKSL2 (D3) /
Timer 3 input clock selection: CKSL3 (D3) /
Timer 4 input clock selection: CKSL4 (D3) /
Timer 5 input clock selection: CKSL5 (D3) /
An external clock is selected by writing "1" to CKSLx, and the internal clock is selected by writing "0". At initial reset, CKSLx 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 timer is operated by the prescaler output clock. The prescaler division ratio can be selected for each timer.
Table 4.2 Setting the Internal Clock
Timer | Control register | Division ratio select bit | Clock control bit |
Timer 0 | P16TS0[2:0] (D2:0]) | P16TON0 (D3) | |
Timer 1 | P16TS1[2:0] (D2:0]) | P16TON1 (D3) | |
Timer 2 | P16TS2[2:0] (D2:0]) | P16TON2 (D3) | |
Timer 3 | P16TS3[2:0] (D2:0]) | P16TON3 (D3) | |
Timer 4 | P16TS4[2:0] (D2:0]) | P16TON4 (D3) | |
Timer 5 | P16TS5[2:0] (D2:0]) | P16TON5 (D3) |
The division ratio can be selected from among eight types as shown in Table 4.3.
Table 4.3 Input Clock Selection
P16TS = 7 | P16TS = 6 | P16TS = 5 | P16TS = 4 | P16TS = 3 | P16TS = 2 | P16TS = 1 | P16TS = 0 |
fPSCIN/4096 | fPSCIN/1024 | fPSCIN/256 | fPSCIN/64 | fPSCIN/16 | fPSCIN/4 | fPSCIN/2 | fPSCIN/1 |
fPSCIN: Prescaler input clock frequency
The selected clock is output from the prescaler to the
Notes: • When the internal clock is used, the
• When setting an input clock, make sure the
EPSON | S1C33210 FUNCTION PART |