5.1.3.4 Integration and application of the IPC
All interrupt inputs that comes from peripheral modules are synchronous signals. None of
the asynchronous signals of the interrupts are routed to IPC. The asynchronous signals of
the interrupts are routed directly to SIM module to wake system clocks in stop3 mode.
Additional care must be exercised when IRQ is reprioritized by IPC. CPU instructions
BIL and BIH need input from IRQ pin. If IRQ interrupt is masked, BIL and BIH still
work but the IRQ interrupt will not occur.
• The interrupt priority controller must be enabled to function. While inside an
interrupt service routine, some work has to be done to enable other higher priority
interrupts. The following is a pseudo code example written in assembly language:
INT_SER :
BCLR INTFLAG,INTFLAG_R ; clear flag that generate interrupt
. ; do the most critical part
. ; which it cannot be interrupted
.
.
.
CLI ; global interrupt enable and nested interrupt
enabled
. ; continue the less critical
.
.
.
BSET PULIPM, PULIPM_R ; restore the old IPM value before leaving
RTI ; then you can return
• A minimum overhead of six bus clock cycles is added inside an interrupt services
routine to enable preemptive interrupts.
• As an interrupt of the same priority level is allowed to pass through IPC to HCS08
CPU, the flag generating the interrupt must be cleared before doing CLI to enable
preemptive interrupts.
• The IPM is automatically updated to the level the interrupt is servicing and the
original level is kept in IPMPS. Watch out for the full (PSF) bit if nesting for more
than four levels is expected.
• Before leaving the interrupt service routine, the previous levels must be restored
manually by setting PULIPM bit. Watch out for the full (PSF) bit and empty (PSE)
bit.
5.2 IRQ
The IRQ (external interrupt) module provides a maskable interrupt input.
Chapter 5 Interrupt
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
NXP Semiconductors
105
Summary of Contents for MC9S08PA4
Page 1: ...MC9S08PA4 Reference Manual Supports MC9S08PA4 Document Number MC9S08PA4RM Rev 5 08 2017 ...
Page 2: ...MC9S08PA4 Reference Manual Rev 5 08 2017 2 NXP Semiconductors ...
Page 22: ...MC9S08PA4 Reference Manual Rev 5 08 2017 22 NXP Semiconductors ...
Page 28: ...System clock distribution MC9S08PA4 Reference Manual Rev 5 08 2017 28 NXP Semiconductors ...
Page 150: ...Port data registers MC9S08PA4 Reference Manual Rev 5 08 2017 150 NXP Semiconductors ...
Page 196: ...Human machine interfaces HMI MC9S08PA4 Reference Manual Rev 5 08 2017 196 NXP Semiconductors ...
Page 224: ...Instruction Set Summary MC9S08PA4 Reference Manual Rev 5 08 2017 224 NXP Semiconductors ...
Page 232: ...Functional Description MC9S08PA4 Reference Manual Rev 5 08 2017 232 NXP Semiconductors ...
Page 258: ...FTM Interrupts MC9S08PA4 Reference Manual Rev 5 08 2017 258 NXP Semiconductors ...
Page 294: ...Functional description MC9S08PA4 Reference Manual Rev 5 08 2017 294 NXP Semiconductors ...
Page 398: ...Resets MC9S08PA4 Reference Manual Rev 5 08 2017 398 NXP Semiconductors ...
Page 400: ...MC9S08PA4 Reference Manual Rev 5 08 2017 400 NXP Semiconductors ...