62
Document # 001-20559 Rev. *D
Interrupt Controller
5. The ISR executes. Note that interrupts are disabled
since GIE = 0. In the ISR, interrupts can be re-enabled if
desired, by setting GIE = 1 (take care to avoid stack
overflow in this case).
6. The ISR ends with a RETI instruction. This pops the Flag
register, PCL, and PCH from the stack, restoring those
registers. The restored Flag register re-enables inter-
rupts, since GIE = 1 again.
7. Execution resumes at the next instruction, after the one
that occurred before the interrupt. However, if there are
more pending interrupts, the subsequent interrupts are
processed before the next normal program instruction.
Interrupt Latency.
The time between the assertion of an
enabled interrupt and the start of its ISR can be calculated
using the following equation:
Latency =
Equation 1
Time for current instruction to
Time for M8C to change program counter to interrupt a
Time for LJMP instruction in interrupt table to execute.
For example, if the 5-cycle JMP instruction executes when
an interrupt becomes active, the total number of CPU clock
cycles before the ISR begins is as follows:
(1 to 5 cycles for JMP to finish) +
Equation 2
(13 cycles for interrupt routine) +
(7 cycles for LJMP) = 21 to 25 cycles.
In the example above, at 24 MHz, 25 clock cycles take
1.042
s.
Interrupt Priority.
The priorities of the interrupts only come
into consideration if more than one interrupt is pending dur-
ing the same instruction cycle. In this case, the priority
encoder (see
) generates an interrupt vector for
the highest priority interrupt that is pending.
5.1.1
Posted versus Pending Interrupts
An interrupt is posted when its interrupt conditions occur.
This results in the flip-flop in
clocking in a ‘1’. The
interrupt remains posted until the interrupt is taken or until it
is cleared by writing to the appropriate INT_CLRx register.
A posted interrupt is not pending unless it is enabled by set-
ting its interrupt mask bit (in the appropriate INT_MSKx reg-
ister). All pending interrupts are processed by the priority
encoder to determine the highest priority interrupt to be
taken by the M8C if the Global Interrupt Enable bit is set in
the CPU_F register.
Disabling an interrupt by clearing its interrupt mask bit (in
the INT_MSKx register) does not clear a posted interrupt,
nor does it prevent an interrupt from being posted. It simply
prevents a posted interrupt from becoming pending.
It is especially important to understand the functionality of
clearing posted interrupts, if the configuration of the PSoC
device is changed by the application.
For example, if a digital PSoC block is configured as a coun-
ter and has posted an interrupt but is later reconfigured to a
serial communications receiver, the posted interrupt from
the counter remains. Therefore, if the digital PSoC block's
INT_MSKx bit is set after configuring the block as a serial
communications receiver, a pending interrupt is generated
immediately. To prevent the carryover of posted interrupts
from one configuration to the next, the INT_CLRx registers
should be used to clear posted interrupts prior to enabling
the digital PSoC block.
Содержание PSoC CY8C23533
Страница 4: ...Contents Overview 4 Document 001 20559 Rev D Section G Glossary 385 Index 401 ...
Страница 16: ...Contents Overview 16 Document 001 20559 Rev D ...
Страница 24: ...24 Document 001 20559 Rev D Section A Overview ...
Страница 30: ...30 Document 001 20559 Rev D Pin Information ...
Страница 54: ...54 Document 001 20559 Rev D Supervisory ROM SROM ...
Страница 60: ...60 Document 001 20559 Rev D RAM Paging ...
Страница 68: ...68 Document 001 20559 Rev D Interrupt Controller ...
Страница 76: ...12 Document 001 20559 Rev D General Purpose IO GPIO ...
Страница 82: ...18 Document 001 20559 Rev D Internal Main Oscillator IMO ...
Страница 84: ...20 Document 001 20559 Rev D Internal Low Speed Oscillator ILO ...
Страница 90: ...26 Document 001 20559 Rev D External Crystal Oscillator ECO ...
Страница 94: ...30 Document 001 20559 Rev D Phase Locked Loop PLL ...
Страница 106: ...42 Document 001 20559 Rev D Sleep and Watchdog ...
Страница 228: ...164 Document 001 20559 Rev D Section D Digital System ...
Страница 234: ...170 Document 001 20559 Rev D Array Digital Interconnect ADI ...
Страница 278: ...214 Document 001 20559 Rev D Digital Blocks ...
Страница 296: ...232 Document 001 20559 Rev D Analog Interface ...
Страница 304: ...240 Document 001 20559 Rev D Analog Array ...
Страница 308: ...244 Document 001 20559 Rev D Analog Input Configuration ...
Страница 312: ...248 Document 001 20559 Rev D Analog Reference ...
Страница 338: ...274 Document 001 20559 Rev D Section F System Resources ...
Страница 354: ...290 Document 001 20559 Rev D Multiply Accumulate MAC ...
Страница 374: ...310 Document 001 20559 Rev D I2C ...
Страница 400: ...336 Document 001 20559 Rev D Section G Glossary ...