11 PROGRaMMaBle TiMeR
S1C63003/004/008/016 TeChniCal Manual
Seiko epson Corporation
11-7
(Rev. 1.1)
The counter data of a 16-bit timer must be read from the low-order 4 bits. In 16-bit timer mode, the high-order data
(PTD0[7:4], PTD1[3:0], PTD1[7:4]) is latched by reading the low-order 4 bits (PTD0[3:0]). The counter keeps count-
ing. However, the latched high-order data is maintained until the next reading of low-order data. Therefore, after
the low-order 4-bit data (PTD0[3:0]) is read, the high-order data (PTD0[7:4], PTD1[3:0], PTD1[7:4]) can be read
regardless of the order for reading. If data other than the low-order 4 bits (PTD0[3:0]) is read first, the hold function
is not activated. In this case, the correct counter data cannot be read.
The description above is applied when Ch. B (Timers 2 and 3) is used as a 16-bit timer in the S1C63016.
interrupt Function
11.7
The programmable timer can generate interrupts from the underflow and compare match signals of each timer. See
Figures 11.3.1 and 11.5.1 for the interrupt timing.
Notes: • The compare match interrupt can be generated only when the timer is set to PWM mode.
• The compare match interrupt can not be used in the S1C63003.
The underflow and compare match signals set the corresponding interrupt factor flag IPTx and ICTCx to "1," and an
interrupt is generated. The interrupt can also be masked by setting the corresponding interrupt mask registers EIPTx
and EICTCx. However, the interrupt factor flag is set to "1" by an underflow/compare match of the corresponding
timer regardless of the interrupt mask register setting.
When Ch.A is used as a 16-bit timer, an interrupt is generated by an underflow of Timer 1. In this case, IPT0 is not
set to "1" by a Timer 0 underflow. The compare match interrupt uses ICTC1 of Timer 1. The same applies when Ch.B
is used as a 16-bit timer.
TOuT Output Control
11.8
The programmable timer Ch.A/Ch.B can generate the TOUT_A/TOUT_B signal from the timer underflow and
compare match signals. The TOUT_A/TOUT_B signal is generated by dividing the underflow signal by 2 in normal
mode. In PWM mode (S1C63004/008/016), the PWM signal generated as described above is output as the TOUT_A/
TOUT_B signal.
8.1 TOUT outputs and control registers (S1C63016)
Table 11.
Output terminal
Output control register Output select register
Output timer
TOUT_A (P11)
PTOUT_A
CHSEL_A = "0"
Timer 0
CHSEL_A = "1"
Timer 1
TOUT_B (P23)
PTOUT_B
CHSEL_B = "0"
Timer 2
CHSEL_B = "1"
Timer 3
8.2 TOUT outputs and control registers (S1C63004/008)
Table 11.
Output terminal
Output control register Output select register
Output timer
TOUT_A (P11)
PTOUT_A
CHSEL_A = "0"
Timer 0
CHSEL_A = "1"
Timer 1
TOUT_B (P23)
PTOUT_B
–
Timer 2
8.3 TOUT output and control register (S1C63003)
Table 11.
Output terminal
Output control register Output select register
Output timer
TOUT_A (P11)
PTOUT_A
–
Timer 0
The TOUT output select register CHSEL_A/CHSEL_B allows selection of either Timer 0/Timer 2 or Timer 1/Timer
3 to be used as the TOUT output (the S1C63003 TOUT channel is fixed at Timer 0). In 16-bit timer mode, Timer 1/
Timer 3 is always selected for generating the TOUT_A/TOUT_B signal regardless of how CHSEL_A/CHSEL_B is
set.
The TOUT signal generated by each timer can be output from the TOUT_A (P11) or TOUT_B (P23) terminal to
supply a clock to an external device.
The TOUT_A/TOUT_B signal output is controlled by the PTOUT_A/PTOUT_B register. When "1" is written to the
PTOUT_A/PTOUT_B register, the TOUT_A/TOUT_B signal is output from the corresponding I/O port terminal.