17-9
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
Operations in comparator mode
The comparator mode compares the counter value and the value set via software. It generates an
interrupt and toggles the timer output signal level when the values are matched. The T16B_nCCR
m
register functions as the compare data register used for setting a comparison value in this mode. The
TOUT
nm
/CAP
nm
pin is configured to the TOUT
nm
pin.
When the counter reaches the value set in the T16B_
n
CCR
m
register during counting, the comparator
asserts the MATCH signal and sets the T16B_
n
INTF.COMPCAP
m
IF bit (compare interrupt flag) to 1.
When the counter reaches the MAX value in comparator mode, the T16B_
n
INTF.CNTMAXIF bit
(counter MAX interrupt flag) is set to 1. When the counter reaches 0x0000, the
T16B_
n
INTF.CNTZEROIF bit (counter zero interrupt flag) is set to 1.
(1)
Repeat up count mode
(2)
Repeat down count mode
(3)
Repeat up/down count mode
Figure 17.4.3.1 Operation Examples in Comparator Mode
RUN = 1
RUN = 1
CMPCAPmIF = 1
CNTMAXIF = 1
CMPCAPmIF = 1
CNTMAXIF = 1
CMPCAPmIF = 1
CNTMAXIF = 1
PRESET = 1
RUN = 0
Software operation
Hardware operation
0xffff
0x0000
Count cycle
Counter
Comparison value
(T16B_nCCRm register)
Time
MAX value
(T16B_nMC register)
Compare period
RUN = 1
RUN = 1
CMPCAPmIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CNTZEROIF = 1
PRESET = 1
RUN = 0
0xffff
0x0000
Counter
Comparison value
(T16B_nCCRm register)
Time
MAX value
(T16B_nMC register)
Count cycle
Compare period
RUN = 1
CMPCAPmIF = 1
CNTMAXIF = 1
CMPCAPmIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CNTMAXIF = 1
PRESET = 1
0xffff
0x0000
Counter
Comparison value
(T16B_nCCRm register)
Time
MAX value
(T16B_nMC register)
Count cycle
Compare period
during counting up
Compare period
during counting down
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...