Real-time Interrupt on HC12 and Pulse Accumulator

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Real-time Interrupt on HC12 and Pulse Accumulator

2,938件の閲覧回数
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 返信

510件の閲覧回数
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 件の賞賛