Comparator/Capture Block Operations - Epson S1C17M20 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

15 16-BIT PWM TIMERS (T16B)

15.4.3 Comparator/Capture Block Operations

The comparator/capture block functions as a comparator to compare the counter value with the register value set or
a capture circuit to capture counter values using the external/software trigger signals.
Comparator/capture block operating mode
The comparator/capture block includes two systems (four or six systems) of comparator/capture circuits and
each system can be set to comparator mode or capture mode, individually.
Set the T16BnCCCTLm.CCMD bit to 0 to set the comparator/capture circuit m to comparator mode or 1 to set
it to capture mode.
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 T16BnCCRm register functions as the
compare data register used for setting a comparison value in this mode. The TOUTnm/CAPnm pin is configured
to the TOUTnm pin.
When the counter reaches the value set in the T16BnCCRm register during counting, the comparator asserts the
MATCH signal and sets the T16BnINTF.COMPCAPmIF bit (compare interrupt flag) to 1.
When the counter reaches the MAX value in comparator mode, the T16BnINTF.CNTMAXIF bit (counter
MAX interrupt flag) is set to 1. When the counter reaches 0x0000, the T16BnINTF.CNTZEROIF bit (counter
zero interrupt flag) is set to 1.
(1) Repeat up count mode
PRESET = 1
RUN = 1
0xffff
Count cycle
Compare period
Counter
0x0000
(2) Repeat down count mode
PRESET = 1
RUN = 1
0xffff
Count cycle
Counter
Compare
period
0x0000
15-8
CNTMAXIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
Seiko Epson Corporation
RUN = 0
RUN = 1
CNTMAXIF = 1
CMPCAPmIF = 1
RUN = 0
RUN = 1
CNTZEROIF = 1
CMPCAPmIF = 1
S1C17M20/M21/M22/M23/M24/M25
Software operation
Hardware operation
MAX value
(T16BnMC register)
Comparison value
(T16BnCCRm register)
Time
CNTMAXIF = 1
MAX value
(T16BnMC register)
Comparison value
(T16BnCCRm register)
Time
CNTZEROIF = 1
TECHNICAL MANUAL (Rev. 1.0)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17m25S1c17m21S1c17m22S1c17m23S1c17m24

Table of Contents