Hi,
I made a sample code to you , please see attachment.
In the code I send you, I use Timer1, the interrupt is defined as 1s interval. The interval is decided by TPM1SC register Prescale Divisor bits. For more about how to set Timer registers, may I suggest you read the “MCF51QE128 Reference Manual”, page 341-346.
In the sample code I sent you, the interrupt subroutine is defined as:
void interrupt 66 timer()
here, “interrupt” is key word for interrupt subroutine.
Vector number can be found in Reference Manual ColdFire Exception Vector Table, Vector Number(s) row.
the demo code is for 51QE128 but the method is exactly the same for 51EM.
Hope this helps!
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------