14 8-BiT OSC1 TiMeR (T8OSC1)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
14-1
8-bit OSC1 Timer (T8OSC1)
14
T8OSC1 Module Overview
14.1
The S1C17624/604/622/602/621 includes a single-channel 8-bit OSC1 timer that uses OSC1 as its clock source.
The features of the T8OSC1 module are listed below.
• 8-bit up counter with a comparator
• The counter value can be compared with two specified comparison values (compare data and PWM duty data) by
the comparator.
• Can generate interrupts when the counter value matches compare data.
• Can generate a PWM signal from matching between the counter and two specified comparison values (compare
data and PWM duty data), and output it outside the IC.
Figure 14.1.1 shows the T8OSC1 module configuration.
Compare data register
T8OSC1_CMP
Internal data bus
Compare match interrupt request
To ITC
Compare
match signal
Up counter
T8OSC1_CNT
Count
control circuit
Interrupt
control circuit
Comparator
Run/Stop control
OSC1
T8ORUN
Timer reset
T8ORST
Count mode select
T8ORMD
Interrupt enable
T8OIE
8-bit OSC1 Timer (T8OSC1)
Divider
(1/1—1/32)
Gate
CLG
Division ratio selection
PWM output
TOUT4
PWM duty data register
T8OSC1_DUTY
Duty
match signal
Comparator
1.1 T8OSC1 Module Configuration
Figure 14.
The 8-bit OSC1 timer includes an 8-bit up-counter (T8OSC1_CNT register), an 8-bit compare data register
(T8OSC1_CMP register), and an 8-bit PWM duty data register (T8OSC1_DUTY register).
The up-counter can be reset to 0 via software and counts up using the OSC1 division clock. The count value can be
read via software.
The compare data and PWM duty data registers store the data used for comparisons against up-counter contents.
If the counter value matches the contents of each data register, the comparator outputs a signal to control the inter-
rupts and the PWM output signal. The compare data register can be used to set the interrupt generating and PWM
output clock cycles. The PWM duty data register can be used to set the PWM output clock duty ratio.
T8OSC1 Output Pin
14.2
Table 14.2.1 shows the T8OSC1 module output pin.
2.1 T8OSC1 Pin
Table 14.
Pin name
i/O
Qty
Function
TOUT4
O
1
PWM signal (non-inverted) output pin
Outputs the PWM signal generated by the timer.
The T8OSC1 output pin (TOUT4) is shared with an I/O port and is initially set as a general-purpose I/O port pin.
The pin function must be switched using the port function select bit to use the general purpose I/O port pin as the
T8OSC1 output pin. For detailed information on pin function switching, see the “I/O Ports (P)” chapter.