Tom Billings

Trouble Implementing Interrupts on MC9S12DT256

Discussion created by Tom Billings on Feb 11, 2008
Latest reply on Feb 12, 2008 by Jim Donelson
Hi, I am working with the MC9S12DT256 on the CSM12D development board and am having trouble with implementing interrupt routines. The first thing I did was alter the vector table by naming the entry associated with the Enhanced Capture Timer Ch7: TC7x. Then, I added the following routine to my main file using a sample file from Freescale as a guideline:

#pragma CODE_SEG __NEAR_SEG NON_BANKED //JCB interrupt
void TC7x(void)
if (TFLG1 == 0x80)

MOTOR1_RUN_FLAG is toggled to the interrupt state when a touch sensor is depressed. This works fine, but the problem lies when resetting the flag... The code will enter the interrupt routine but will not proceed beyond the conditional statement. It freezes there, and I am not sure why. I am also not too sure what the #pragma directives are doing. Any insight into this problem would be much appreciated. Thanks in advance.