Epson S1C31W74 Technical Manual page 237

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

(1) Repeat up count mode
PRESET = 1
RUN = 1
0xffff
Compare period
Counter
0x0000
(2) Repeat down count mode
PRESET = 1
RUN = 1
0xffff
Counter
Compare
period
0x0000
(3) Repeat up/down count mode
PRESET = 1
RUN = 1
0xffff
Compare period
during counting up
Counter
0x0000
(Note that the T16B_nINTF.CMPCAPmIF/CNTMAXIF/CNTZEROIF bit clearing operations via software are omitted from the figure.)
The time from counter = 0x0000 or MAX value to occurrence of a compare interrupt (compare period) and the
time to occurrence of a counter MAX or counter zero interrupt (count cycle) can be calculated as follows:
During counting up
Compare period = — — — — — — — [s]
During counting down
Compare period = — — — — — — — — — — [s]
Where
CC:
MAX:
f
: Count clock frequency [Hz]
CLK_T16B
S1C31W74 TECHNICAL MANUAL
(Rev. 1.1)
Count cycle
CNTMAXIF = 1
CMPCAPmIF = 1
Count cycle
CNTZEROIF = 1
CMPCAPmIF = 1
Count cycle
Compare period
during counting down
CNTMAXIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
Figure 17.4.3.1 Operation Examples in Comparator Mode
(CC + 1)
f
CLK_T16B
(MAX - CC + 1)
f
CLK_T16B
T16B_nCCRm register setting value (0 to 65,535)
T16B_nMC register setting value (0 to 65,535)
Seiko Epson Corporation
RUN = 0
RUN = 1
CNTMAXIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
RUN = 0
RUN = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
(MAX + 1)
Count cycle = — — — — — — — — [s]
f
CLK_T16B
(MAX + 1)
Count cycle = — — — — — — — — [s]
f
CLK_T16B
17 16-BIT PWM TIMERS (T16B)
Software operation
Hardware operation
MAX value
(T16B_nMC register)
Comparison value
(T16B_nCCRm register)
Time
CNTMAXIF = 1
MAX value
(T16B_nMC register)
Comparison value
(T16B_nCCRm register)
Time
CNTZEROIF = 1
MAX value
(T16B_nMC register)
Comparison value
(T16B_nCCRm register)
Time
CNTMAXIF = 1
(Eq. 17.1)
(Eq. 17.2)
17-9

Advertisement

Table of Contents
loading

Table of Contents