Code hangs with illegal bP 9S12 with CW3.1

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

Code hangs with illegal bP 9S12 with CW3.1

1,693件の閲覧回数
JohnnyP
Contributor III
Hi:

I'm debugging the proportional part of a PID controller with a P&E USB pod connected to the target. It runs until I adjust one of the variables "too far", then hangs with an illegal bp.

The code is in an interrupt routine, so I copied it into a new project with no interrupts and it runs on the simulator, taking the appropriate branches when I adjust the variables.

Back to the target. I copied and pasted the code to the top of my program, disabled interrupts, and commented out the branches in the original code. It runs as before, then hangs with illegal bp when I adjust one of the variables beyond a certain point.

How to tell where the program is going? I didn't set any breakpoints.
ラベル(1)
0 件の賞賛
返信
1 返信

375件の閲覧回数
JohnnyP
Contributor III
Ok, found my problem. Rookie move.

I set my proportional gain to three, so I saved the error voltage on the stack, did an ASLA and checked for overflow, then PUlB to do an ABA. Forgot to fix the stack if it branched.
0 件の賞賛
返信