Control And Operation Of 8-Bit Programmable Timer - Epson CMOS 32-Bit Single Chip Microcomputer S1C33L03 Technical Manual

Cmos 32-bit single chip microcomputer
Table of Contents

Advertisement

III PERIPHERAL BLOCK: 8-BIT PROGRAMMABLE TIMERS

Control and Operation of 8-Bit Programmable Timer

With the 8-bit programmable timer, the following settings must first be made before it starts counting:
1. Setting the output pin (only when necessary)
2. Setting the input clock
3. Setting the preset data (initial counter value)
4. Setting the interrupt/IDMA/HSDMA
Setting of an output pin is necessary only when the output clock of the 8-bit programmable timer is supplied to
external devices. For details on how to set the pin, refer to "Output Pins of 8-Bit Programmable Timers".
For details on how to set interrupts and DMA, refer to "8-Bit Programmable Timer Interrupts and DMA".
Note: The 8-bit programmable timers 0 through 3 all operate in the same way during counting, and the
structure of their control registers is also the same. The control bit names are assigned the
numerals "0" through "3" to denote the timer numbers. Since all these timers have common
functions, timer numbers here are represented it is by "x" unless necessary to specify a timer
number.
Setting the input clock
The 8-bit programmable timer is operated by the prescaler's output clock. The prescaler's division ratio can be
selected for each timer.
Division ratio select bit Clock control bit
8-bit timer 0: P8TS0[2:0] (D[2:0])
8-bit timer 1: P8TS1[2:0] (D[6:4])
8-bit timer 2: P8TS2[2:0] (D[2:0])
8-bit timer 3: P8TS3[2:0] (D[6:4])
8-bit timer 4: P8TS4[2:0] (D[2:0])
8-bit timer 5: P8TS5[2:0] (D[6:4])
Note that the division ratios differ for each timer (see Table 3.2).
Furthermore, the prescaler input clock can be directly supplied to the 8-bit timer by writing "1" to the
P8TPCKx bit in the 8-bit timer clock select register (0x40146).
Timer 0 clock selection: P8TPCK0 (D0) / 8-bit timer clock select register (0x40146)
Timer 1 clock selection: P8TPCK1 (D1) / 8-bit timer clock select register (0x40146)
Timer 2 clock selection: P8TPCK2 (D2) / 8-bit timer clock select register (0x40146)
Timer 3 clock selection: P8TPCK3 (D3) / 8-bit timer clock select register (0x40146)
Timer 4 clock selection: P8TPCK4 (D0) / 8-bit timer clock select register (0x40140)
Timer 5 clock selection: P8TPCK5 (D1) / 8-bit timer clock select register (0x40140)
When using the divided clock selected by P8TSx, set P8TPCKx to "0".
Timer
P8TSx = 7
P8TSx = 6
Timer 0
f
/256
f
PSCIN
PSCIN
Timer 1
f
/4096
f
PSCIN
PSCIN
Timer 2
f
/4096
f
PSCIN
PSCIN
Timer 3
f
/256
f
PSCIN
PSCIN
Timer 4
f
/4096
f
PSCIN
PSCIN
Timer 5
f
/256
f
PSCIN
PSCIN
The selected clock is output from the prescaler to the 8-bit programmable timer by writing "1" to P8TONx.
Notes: • The 8-bit programmable timer operates only when the prescaler is operating. (Refer to
"Prescaler".)
• Do not use a clock that is faster than the CPU operating clock as the 8-bit programmable timer.
• When setting an input clock, make sure the 8-bit programmable timer is turned off.
B-III-3-4
P8TON0 (D3)
P8TON1 (D7)
P8TON2 (D3)
P8TON3 (D7)
P8TON4 (D3)
P8TON5 (D7)
Table 3.2 Input Clock Selection
P8TSx = 5
P8TSx = 4
/128
f
/64
f
/32
PSCIN
PSCIN
/2048
f
/1024
f
/512
PSCIN
PSCIN
/2048
f
/64
f
/32
PSCIN
PSCIN
/128
f
/64
f
/32
PSCIN
PSCIN
/2048
f
/64
f
/32
PSCIN
PSCIN
/128
f
/64
f
/32
PSCIN
PSCIN
8-bit timer 0/1 clock control register (0x4014D)
8-bit timer 0/1 clock control register (0x4014D)
8-bit timer 2/3 clock control register (0x4014E)
8-bit timer 2/3 clock control register (0x4014E)
8-bit timer 4/5 clock control register (0x40145)
8-bit timer 4/5 clock control register (0x40145)
P8TSx = 3
P8TSx = 2
f
/16
f
/8
PSCIN
PSCIN
f
/256
f
/128
PSCIN
PSCIN
f
/16
f
/8
PSCIN
PSCIN
f
/16
f
/8
PSCIN
PSCIN
f
/16
f
/8
PSCIN
PSCIN
f
/16
f
/8
PSCIN
PSCIN
f
PSCIN
EPSON
Register
P8TSx = 1
P8TSx = 0
P8TPCK = 1
f
/4
f
/2
f
PSCIN
PSCIN
f
/64
f
/32
f
PSCIN
PSCIN
f
/4
f
/2
f
PSCIN
PSCIN
f
/4
f
/2
f
PSCIN
PSCIN
f
/4
f
/2
f
PSCIN
PSCIN
f
/4
f
/2
f
PSCIN
PSCIN
: Prescaler input clock frequency
S1C33L03 FUNCTION PART
/1
PSCIN
/1
PSCIN
/1
PSCIN
/1
PSCIN
/1
PSCIN
/1
PSCIN

Advertisement

Table of Contents
loading

Table of Contents