Real-time Interrupt on HC12 and Pulse Accumulator

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Real-time Interrupt on HC12 and Pulse Accumulator

2,931 次查看
cjw
Contributor I
Hi!

I am trying to use the real-time interrupt on the HC12. Currently, it interrupts every 32 ms and after about 5 seconds it toggles Port A. However, when it gets to the part where it toggles Port A, I got a pulse accumulator overflow exception. Do I need to do anything with the pulse accumulator to use the real-time interrupt? I just set the RTI Control Register and I set the RTI Flag whenever the interrupt is called to clear the interrupt.

My code is at:

http://home.comcast.net/~cwinter/RTI_Test.asm

The first time the label TOGGLE is called, the PA overflows.

Thanks for all and any help.

Message Edited by cjw on 03-21-200606:12 PM

标签 (1)
0 项奖励
1 回复

503 次查看
cjw
Contributor I
Nevermind, I figured it out. Apparently, since I am using Acc. X for my offset, I had to reinitalize it once the ISR is called, since X will be pushed to stack and who knows what it is set to after that. It's fixed now.
0 项奖励