Beruflich Dokumente
Kultur Dokumente
Lab 4
Double Counters
Using Interrupt-Driven I/O
MC9S12C32 Interrupts
IRQ# operation
1.
1.
Interrupt Source
$FFFE
Reset
$FFFC
$FFFA
$FFF8
$FFF6
SWI
$FFF4
XIRQ
$FFF2
IRQ
$FFF0
$FFEE
etc.
Complete table in Cady text & MC9S12C32 ref manual (pg 61)
/* Startup routine */
/* My SWI ISR
*/
UnimplementedISR,
SWI_ISR,
UnimplementedISR,
UnimplementedISR,
UnimplementedISR,
//_Startup
};
/* Interrupt table */
/* vector 63 */
/* vector 05 */
/* vector 04 */ SWI is Vector 4
/* vector 03 */
/* vector 02 */
/* vector 01 */
/* Reset vector */ COMMENT OUT
Lab Experiment
Set a variable so the main program will not disturb the 7segment display for about 5 seconds after an interrupt
Debug suggestions
The ISR can write a unique pattern to LEDs or 7segment display to indicate that it was entered
Display the ISR counter on the other display to ensure it
is counting properly upon ISR execution
Global variables can be modified by the ISR to indicate
that the ISR was executed
An unimplemented ISR error, detected by the
debugger, indicates that there was no interrupt vector in
the vector table