
13 16-BiT PWM TiMeRS (T16a2)
13-12
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
notes: • Reset the interrupt flag before enabling interrupts with the interrupt enable bit to prevent oc-
currence of unwanted interrupt. The interrupt flag is reset by writing 1.
• After an interrupt occurs, the interrupt flag in the T16A2 module must be reset in the interrupt
handler routine.
Control Register Details
13.8
8.1 List of T16A2 Registers
Table 13.
address
Register name
Function
0x5068
T16A_CLK0
T16A Clock Control Register Ch.0
Controls the T16A2 Ch.0 clock.
0x5069
T16A_CLK1
T16A Clock Control Register Ch.1
Controls the T16A2 Ch.1 clock.
0x5400
T16A_CTL0
T16A Counter Ch.0 Control Register
Controls the counter.
0x5402
T16A_TC0
T16A Counter Ch.0 Data Register
Counter data
0x5404
T16A_CCCTL0 T16A Comparator/Capture Ch.0 Control Register
Controls the comparator/capture block and TOUT.
0x5406
T16A_CCA0
T16A Compare/Capture Ch.0 A Data Register
Compare A/capture A data
0x5408
T16A_CCB0
T16A Compare/Capture Ch.0 B Data Register
Compare B/capture B data
0x540a
T16A_IEN0
T16A Compare/Capture Ch.0 Interrupt Enable Register Enables/disables interrupts.
0x540c
T16A_IFLG0
T16A Compare/Capture Ch.0 Interrupt Flag Register
Displays/sets interrupt occurrence status.
0x5420
T16A_CTL1
T16A Counter Ch.1 Control Register
Controls the counter.
0x5422
T16A_TC1
T16A Counter Ch.1 Data Register
Counter data
0x5424
T16A_CCCTL1 T16A Comparator/Capture Ch.1 Control Register
Controls the comparator/capture block and TOUT.
0x5426
T16A_CCA1
T16A Compare/Capture Ch.1 A Data Register
Compare A/capture A data
0x5428
T16A_CCB1
T16A Compare/Capture Ch.1 B Data Register
Compare B/capture B data
0x542a
T16A_IEN1
T16A Compare/Capture Ch.1 Interrupt Enable Register Enables/disables interrupts.
0x542c
T16A_IFLG1
T16A Compare/Capture Ch.1 Interrupt Flag Register
Displays/sets interrupt occurrence status.
The T16A2 registers are described in detail below.
note: When data is written to the registers, the “Reserved” bits must always be written as 0 and not 1.
T16a Clock Control Register Ch.
x
(T16a_ClK
x
)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
T16a Clock
Control Register
Ch.
x
(T16a_ClK
x
)
0x5068
0x5069
(8 bits)
D7–4 ClKDiV
[3:0]
Clock division ratio select
CLKDIV[3:0]
Division ratio
0x0 R/W
OSC3 or
IOSC
OSC1
0xf
0xe
0xd
0xc
0xb
0xa
0x9
0x8
0x7
0x6
0x5
0x4
0x3
0x2
0x1
0x0
–
1/16384
1/8192
1/4096
1/2048
1/1024
1/512
1/256
1/128
1/64
1/32
1/16
1/8
1/4
1/2
1/1
–
–
–
–
–
–
–
1/256
1/128
1/64
1/32
1/16
1/8
1/4
1/2
1/1
D3–2 ClKSRC
[1:0]
Clock source select
CLKSRC[1:0]
Clock source
0x0 R/W
0x3
0x2
0x1
0x0
External clock
OSC3
OSC1
IOSC
D1
MulTiMD
Multi-comparator/capture mode
select
1 Multi
0 Normal
0
R/W T16A_CLK0
–
reserved
–
–
–
T16A_CLK1
0 when being read.
D0
ClKen
Count clock enable
1 Enable
0 Disable
0
R/W
D[7:4]
ClKDiV[3:0]: Clock Division Ratio Select Bits
Selects the division ratio for generating the count clock when an internal clock (IOSC, OSC3, or OSC1)
is used.