13 PWM & CAPTURE TIMER (T16E)
144
EPSON
S1C17001 TECHNICAL MANUAL
13.4 Compare Data Settings
Compare data register/buffer selection
The PWM & capture timer incorporates a data comparator allowing comparison of counter data against any
desired value. This comparison data is stored in the compare data A and B registers. Data can be read or written
directly to or from the compare data registers.
The compare data buffers enable automatic loading to the compare data registers of the comparison values set
in the buffers when the counter is reset by software (writing 1 to T16ERST) or by a compare B match signal.
The CBUFEN (D5/0x5306) is used to set which of the compare data register and buffer the comparison values
are written to.
∗
CBUFEN
: Comparison Buffer Enable Bit in the PWM Timer Control (T16E_CTL) Register (D5/0x5306)
Writing 1 to CBUFEN selects the compare data buffer. Writing 0 to it selects the compare data register. The
compare data register is selected after initial resetting.
Compare data writing
Compare data A is written to T16ECA[15:0] (D[15:0]/T16E_CA register). Compare data B is written to
T16ECB[15:0] (D[15:0]/T16E_CB register).
∗
T16ECA[15:0]
: Compare Data A in the PWM Timer Compare Data A (T16E_CA) Register (D[15:0]/0x5300)
∗
T16ECB[15:0]
: Compare Data B in the PWM Timer Compare Data B (T16E_CB) Register (D[15:0]/0x5302)
When CBUFEN is set to 0, the compare data register values can be read or written directly by these registers.
When CBUFEN is set to 1, data is read from and written to these registers via the compare data buffers. The
buffer contents are loaded into the compare data registers when the counter is reset.
The compare data registers and buffers are set to 0x0 after initial resetting.
The timer compares the count data against the compare data registers and generates a compare match signal if
the values are equal. This compare match signal generates an interrupt and controls the clock (TOUT signal)
output externally.
Compare data B also determines the counter reset cycle.
The counter reset cycle can be calculated as follows:
CB + 1
Counter reset interval= ———— [s]
clk_in
clk_in
Counter reset cycle = ———— [Hz]
CB + 1
CB: Compare data B (T16E_CB register value)
clk_in: Prescaler output clock frequency
Содержание S1C17001
Страница 1: ...Technical Manual S1C17001 CMOS 16 BIT SINGLE CHIP MICROCONTROLLER ...
Страница 31: ...3 MEMORY MAP AND BUS CONTROL 22 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 33: ...4 POWER SUPPLY VOLTAGE 24 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 63: ...6 INITERRUPT CONTROLLER 54 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 87: ...8 CLOCK GENERATOR CLG 78 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 91: ...9 PRESCALER PSC 82 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 133: ...11 16 BIT TIMER T16 124 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 185: ...14 8 BIT OSC1 TIMER T8OSC1 176 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 211: ...16 STOPWATCH TIMER SWT 202 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 219: ...17 WATCHDOG TIMER WDT 210 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 241: ...18 UART 232 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 277: ...20 I2 C 268 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 297: ...21 REMOTE CONTROLLER REMC 288 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 303: ...22 ON CHIP DEBUGGER DBG 294 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...
Страница 313: ...25 PACKAGE 304 EPSON S1C17001 TECHNICAL MANUAL This page intentionally left blank ...