TheBeefiest
Joined: 21 May 2008 Posts: 2
|
Help with strange debugger behavior (ccs ide and icd-u40) |
Posted: Tue May 27, 2008 11:57 pm |
|
|
A certain bug is causing my program to become unresponsive.
The following is the weird part:
- If i (Halt program) and (Run) then everything acts normal again, completely responsive until the bug is encountered again.
- When I halt the program manually, the IDE shows the program counter as PC=FFFFFF. Which should never happen as far as I can tell: The datasheet says "To prevent the PC from becoming misaligned with word
instructions, the Least Significant bit of PCL is fixed to
a value of ‘0’." So when the debugger is reading the program registers as: PCLATU=0, PCLATH=0, and PCL=00FF something is not right.
- If i single step the program from this undefined address, it jumps to vector 0x08 which is (low or high priority interrupt, not exactly sure which i am not using high interrupts) which then goes to INT_RB (an interrupt which should not currently be activated), and then i can single-step or run the program and everything seems fine. (as mentioned previously, i can also just run from the undefined address and it begins responsiveness again)
I am not using any strange goto or branching, no function pointers. just a main loop and interrupts.
Using compiler PCH 4.073
So the question is: What sort of condition (of my chip / program / or the CCS IDE) would cause the debugger to read a program counter of FFFFFF when the chip can never have such a value? |
|