13 PWM & CAPTURE TIMER (T16E)
S1C17704 TECHNICAL MANUAL
EPSON
13-9
13.7 PWM & Capture Timer Interrupt
The T16E module can generate the following two types of interrupts:
• Compare A match interrupt
• Compare B match interrupt
The T16E module has one interrupt signal to be output to the interrupt controller (ITC) and it is shared with the two
causes of interrupt. To determine the cause of interrupt that has occurred, read the interrupt flags in the T16E mod-
ule.
Compare A match interrupt
This interrupt request occurs when the count of the counter matches the set value of the compare data A register
during count-up, and it sets the interrupt flag CAIF (D0/T16E_IFLG register) in the T16E module to 1.
∗
CAIF
: Compare A Interrupt Flag in the PWM Timer Interrupt Flag (T16E_IFLG) Register (D0/0x530c)
Set the CAIE bit (D0/T16E_IMSK register) to 1 when using this interrupt. If CAIE is set to 0 (default), CAIF
will not be set to 1 and an interrupt request by this cause will not be sent to the ITC.
∗
CAIE
: Compare A Interrupt Enable Bit in the PWM Timer Interrupt Mask (T16E_IMSK) Register (D0/0x530a)
If CAIF is set to 1, the T16E module outputs the interrupt request signal to the ITC. The interrupt request signal
sets the PWM & capture timer interrupt flag in the ITC to 1 and an interrupt occurs if other interrupt conditions
meet the ITC and S1C17 Core settings.
The PWM & capture timer interrupt handler routine should read the CAIF flag to check if the interrupt has oc-
curred due to a compare A match or another cause.
Furthermore, the interrupt handler routine must reset (write 1 to) CAIF in the T16E module, not the PWM &
capture timer interrupt flag in the ITC, to clear the cause of interrupt.
Compare B match interrupt
This interrupt request occurs when the count of the counter matches the set value of the compare data B register
during count-up, and it sets the interrupt flag CBIF (D1/T16E_IFLG register) in the T16E module to 1.
∗
CBIF
: Compare B Interrupt Flag in the PWM Timer Interrupt Flag (T16E_IFLG) Register (D1/0x530c)
Set the CBIE bit (D1/T16E_IMSK register) to 1 when using this interrupt. If CBIE is set to 0 (default), CBIF
will not be set to 1 and an interrupt request by this cause will not be sent to the ITC.
∗
CBIE
: Compare B Interrupt Enable Bit in the PWM Timer Interrupt Mask (T16E_IMSK) Register (D1/0x530a)
If CBIF is set to 1, the T16E module outputs the interrupt request signal to the ITC. The interrupt request signal
sets the PWM & capture timer interrupt flag in the ITC to 1 and an interrupt occurs if other interrupt conditions
meet the ITC and S1C17 Core settings.
The PWM & capture timer interrupt handler routine should read the CBIF flag to check if the interrupt has oc-
curred due to a compare B match or another cause.
Furthermore, the interrupt handler routine must reset (write 1 to) CBIF in the T16E module, not the PWM &
capture timer interrupt flag in the ITC, to clear the cause of interrupt.
Note
: To avoid occurrence of unnecessary interrupts, be sure to reset the CAIF or CBIF flag before the
compare A match or compare B match interrupt is enabled using CAIE or CBIE.
Содержание S1C17704
Страница 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Страница 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...