Chapter 9 Interrupt Controller (INTC)
MPC5602P Microcontroller Reference Manual, Rev. 4
226
Freescale Semiconductor
and writes to the INTC_CPR. The instruction following this store is a store to a value in a shared coherent
data block. Either immediately before or at the same time as the first store, the INTC asserts the interrupt
request to the processor because the peripheral interrupt request for ISR2 has asserted. As the processor is
responding to the interrupt request from the INTC, and as it is aborting transactions and flushing its
pipeline, it is possible that both stores will be executed. ISR2 thereby thinks that it can access the data
block coherently, but the data block has been corrupted.
OSEK uses the GetResource and ReleaseResource system services to manage access to a shared resource.
To prevent corruption of a coherent data block, modifications to PRI in INTC_CPR can be made by those
system services with the code sequence:
disable processor recognition of interrupts
PRI modification
enable processor recognition of interrupts
9.7.6
Selecting priorities according to request rates and deadlines
The selection of the priorities for the ISRs can be made using rate monotonic scheduling (RMS) or a
superset of it, deadline monotonic scheduling (DMS). In RMS, the ISRs that have higher request rates have
higher priorities. In DMS, if the deadline is before the next time the ISR is requested, then the ISR is
assigned a priority according to the time from the request for the ISR to the deadline, not from the time of
the request for the ISR to the next request for it.
For example, ISR1 executes every 100 µs, ISR2 executes every 200 µs, and ISR3 executes every 300 µs.
ISR1 has a higher priority than ISR2, which has a higher priority than ISR3; however, if ISR3 has a
deadline of 150 µs, then it has a higher priority than ISR2.
The INTC has 16 priorities, which may be less than the number of ISRs. In this case, the ISRs should be
grouped with other ISRs that have similar deadlines. For example, a priority could be allocated for every
time the request rate doubles. ISRs with request rates around 1 ms would share a priority, ISRs with request
rates around 500 µs would share a priority, ISRs with request rates around 250 µs would share a priority,
etc. With this approach, a range of ISR request rates of 2
16
could be included, regardless of the number of
ISRs.
Reducing the number of priorities reduces the processor’s ability to meet its deadlines. However, reducing
the number of priorities can reduce the size and latency through the interrupt controller. It also allows
easier management of ISRs with similar deadlines that share a resource. They do not need to use the PCP
to access the shared resource.
9.7.7
Software configurable interrupt requests
The software configurable interrupt requests can be used in two ways. They can be used to schedule a
lower priority portion of an ISR and they may also be used by processors to interrupt other processors in
a multiple processor system.
9.7.7.1
Scheduling a lower priority portion of an ISR
A portion of an ISR needs to be executed at the PRI
x
value in INTC Priority Select Registers
(INTC_PSR0_3–INTC_PSR220_221), which becomes the PRI value in INTC_CPR with the interrupt