12 16-BiT PWM TiMeR (T16e)
12-4
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
This control does not affect the counter data. The counter data is retained even when the count is halted, allowing
resumption of the count from that data.
If T16ERUN and T16ERST are written as 1 simultaneously, the timer starts counting after reset.
If the counter matches the compare data A register value during counting, the compare A match signal is output and
the cause of compare A interrupt occurs.
Likewise, if the counter matches the compare data B register value, the compare B match signal is output and the
cause of compare B interrupt occurs. The counter is reset to 0 at the same time if CBUFEN is set to 0. If CBUFEN
is set to 1, the values set in the compare data buffers are loaded into the compare data registers.
If interrupts are enabled, an interrupt request is sent to the interrupt controller (ITC).
In either case, counting continues unaffected.
T16ERUN
T16ERST
T16E_CA
x
register
T16E_CB
x
register
Count clock
T16E_TC
x
register
Reset
Compare A
interrupt
Reset and
compare B
interrupt
Compare A
interrupt
Reset and
compare B
interrupt
0x2
0
1
2
3
4
5
0
1
2
3
4
5
0
1
0x5
6.1 Basic Counter Operation Timing
Figure 12.
Clock Output Control
12.7
The T16E module can generate TOUT
x
and TOUTN
x
signals using the compare match signals.
Figure 12.7.1 shows the T16E clock output circuit.
Logic
INITOL
Compare A
Compare B
Clock
TOUT
x
TOUTN
x
D Q
Q
OUTEN
INVOUT
7.1 T16E Clock Output Circuit
Figure 12.
initial output level setting
The default output level is 0 (low level) while the TOUT
x
clock output is Off (TOUTN
x
output level is high).
This can be changed to 1 (TOUT
x
= high level, TOUTN
x
= low level) using INITOL/T16E_CTL
x
register.
When INITOL is 0 (default), TOUT
x
initial output level is low (TOUTN
x
output level is high). When INITOL
is set to 1, the initial output level is set to high (TOUTN
x
output level is low).
Output signal polarity selection
By default, an active high (normal low) TOUT
x
output signal is generated (active low TOUTN
x
output signal
is generated). This logic can be inverted by INVOUT/T16E_CTL
x
register. Writing 1 to INVOUT causes the
timer to generate an active low (normal high) TOUT
x
signal (active high TOUTN
x
signal).
Setting INVOUT to 1 also inverts the initial output level set using INITOL.
See Figure 12.7.2 for output waveforms.
Output pin initial status
The TOUT
x
and TOUTN
x
pins used for output are configured as general-purpose I/O ports after an initial reset
and the ports enter input mode. The pins then become high-impedance.
Switching the pin function to TOUT
x
/TOUTN
x
output causes the pin to output the level set by INITOL and IN-
VOUT. After the timer output starts, the output is maintained at this level until changed by the counter value.