AN2109 Freescale Semiconductor / Motorola, AN2109 Datasheet - Page 28

no-image

AN2109

Manufacturer Part Number
AN2109
Description
MPC555 Interrupts
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
7.3 Example
7.3.1 Example 1: Absolute Minimum Interrupt Routine — PIT
Summary: This minimal example shows how to initialize and service the periodic interrupt timer (PIT)
in the USIU.
Operation: Each PIT interrupt increments a counter variable and reloads the PIT counter. If running
this program, the variables “counter” and “loopctr” can be put in a watch window of the debugger. The
“counter” will show number of PIT interrupts.
There are two limitations in this example:
Stack Frame: This interrupt service routine will not use C functions, hence few registers have to be
saved. Only registers used in this assembly language routine will be saved. The stack frame layout used
in the service routine is shown in
1. SIVEC[InterruptCode] is not used to determine interrupt source. Instead, the status bit is polled
2. SRR0:1 are not saved and the MSR[RI] bit not changed, therefore the service routine is not re-
to determine the interrupt source. This technique would not be appropriate for more than a few
interrupts.
coverable. At least for initial coding, it is recommended to make it as done in subsequent ex-
amples.
Freescale Semiconductor, Inc.
For More Information On This Product,
Offset from SP
Rev. 0, 26 July 2001
20
16
12
MPC555 Interrupts
8
4
0
Table
Table 18 Stack Frame Layout
Go to: www.freescale.com
18.
Unused (padding for 8-byte
alignment of stack frame)
Condition codes
Back chain (old SP)
Register Saved
R5
R4
R3
MOTOROLA
28

Related parts for AN2109