9S12C32 stops code execution after random amount of instructions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

9S12C32 stops code execution after random amount of instructions

1,299 Views
sayeo87
Contributor I

We have a 9S12C32 on a custom PCB target, and are trying to program it through codewarrior in C. What we have noticed is that after a random number of executed instructions (maybe around 100,000 C statements), execution stops and we get either a "Trigger A occurred" or "ILLEGAL_BP" message within the codewarrior debugger. We are programing the MCU through BDM, and all interrupts are currently disabled. Does anybody know what could be wrong? We suspect that our clock might be very slightly off, so that after some number of instructions it becomes completely shifted and wreaks havoc...

 

Thanks in advance for any help!

Labels (1)
0 Kudos
Reply
2 Replies

671 Views
sayeo87
Contributor I

We've solved the problem. We were using the PLL, even though we did not include the circuitry for it. Not using the PLL solved the problem.

0 Kudos
Reply

671 Views
Lundin
Senior Contributor IV
That issue is caused by the accidental execution of op code 0x00 (BGND). In 99% of all cases, it means there is a bug with either runaway code, stack overflow or memory corruption caused by pointer bugs or buffer overflow. You don't need to worry about the clock, it is supervised through hardware.
0 Kudos
Reply