III PERIPHERAL BLOCK: 16-BIT PROGRAMMABLE TIMERS
B-III-4-4
EPSON
S1C33210 FUNCTION PART
Control and Operation of 16-Bit Programmable Timer
The following settings must first be made before the 16-bit programmable timer starts counting:
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
"16-Bit Programmable Timer Interrupts and DMA".
Setting pin for input/output
The pin must be set for output for the output clock of the 16-bit programmable timer to be fed to external
devices.
The pin for input must be set for the 16-bit programmable timer to be used as an event counter that counts
external clock pulses.
For details on how to set the pin, refer to "I/O Pins of 16-Bit Programmable Timers".
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) / 16-bit timer 0 control register (0x48186)
Timer 1 input clock selection: CKSL1 (D3) / 16-bit timer 1 control register (0X4818E)
Timer 2 input clock selection: CKSL2 (D3) / 16-bit timer 2 control register (0x48196)
Timer 3 input clock selection: CKSL3 (D3) / 16-bit timer 3 control register (0x4819E)
Timer 4 input clock selection: CKSL4 (D3) / 16-bit timer 4 control register (0x481A6)
Timer 5 input clock selection: CKSL5 (D3) / 16-bit timer 5 control register (0x481AE)
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 16-bit timer 0 clock control register (0x40147)
P16TS0[2:0] (D2:0])
P16TON0 (D3)
Timer 1 16-bit timer 1 clock control register (0x40148)
P16TS1[2:0] (D2:0])
P16TON1 (D3)
Timer 2 16-bit timer 2 clock control register (0x40149)
P16TS2[2:0] (D2:0])
P16TON2 (D3)
Timer 3 16-bit timer 3 clock control register (0x4014A)
P16TS3[2:0] (D2:0])
P16TON3 (D3)
Timer 4 16-bit timer 4 clock control register (0x4014B)
P16TS4[2:0] (D2:0])
P16TON4 (D3)
Timer 5 16-bit timer 5 clock control register (0x4014C)
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
f
PSCIN
/4096 f
PSCIN
/1024
f
PSCIN
/256
f
PSCIN
/64
f
PSCIN
/16
f
PSCIN
/4
f
PSCIN
/2
f
PSCIN
/1
f
PSCIN
: Prescaler input clock frequency
The selected clock is output from the prescaler to the 16-bit programmable timer by writing "1" to P16TONx.
Notes: • When the internal clock is used, the 16-bit programmable timer operates only when the
prescaler is operating (refer to "Prescaler").
• When setting an input clock, make sure the 16-bit programmable timer is turned off.
Summary of Contents for S1C33210
Page 4: ......
Page 13: ...S1C33210 PRODUCT PART ...
Page 14: ......
Page 124: ...APPENDIX B PIN CHARACTERISTICS A 110 EPSON S1C33210 PRODUCT PART THIS PAGE IS BLANK ...
Page 125: ...S1C33210 FUNCTION PART ...
Page 126: ......
Page 127: ...S1C33210 FUNCTION PART I OUTLINE ...
Page 128: ......
Page 130: ...I OUTLINE INTRODUCTION B I 1 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 138: ...I OUTLINE LIST OF PINS B I 3 6 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 139: ...S1C33210 FUNCTION PART II CORE BLOCK ...
Page 140: ......
Page 142: ...II CORE BLOCK INTRODUCTION B II 1 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 148: ...II CORE BLOCK CPU AND OPERATING MODE B II 2 6 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 152: ...II CORE BLOCK INITIAL RESET B II 3 4 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 234: ...II CORE BLOCK CLG Clock Generator B II 6 10 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 236: ...II CORE BLOCK DBG Debug Unit B II 7 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 237: ...S1C33210 FUNCTION PART III PERIPHERAL BLOCK ...
Page 238: ......
Page 240: ...III PERIPHERAL BLOCK INTRODUCTION B III 1 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 296: ...III PERIPHERAL BLOCK WATCHDOG TIMER B III 5 4 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 429: ...S1C33210 FUNCTION PART IV ANALOG BLOCK ...
Page 430: ......
Page 432: ...IV ANALOG BLOCK INTRODUCTION B IV 1 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 448: ...IV ANALOG BLOCK A D CONVERTER B IV 2 16 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 449: ...S1C33210 FUNCTION PART V DMA BLOCK ...
Page 450: ......
Page 452: ...V DMA BLOCK INTRODUCTION B V 1 2 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 506: ...V DMA BLOCK IDMA Intelligent DMA B V 3 18 EPSON S1C33210 FUNCTION PART THIS PAGE IS BLANK ...
Page 507: ...S1C33210 FUNCTION PART Appendix I O MAP ...
Page 508: ......
Page 557: ......