View previous topic :: View next topic |
Author |
Message |
skiffex
Joined: 04 Feb 2005 Posts: 5
|
Variable inconsistency in CCS |
Posted: Fri Feb 04, 2005 6:06 pm |
|
|
Hi. I've coded some application, and find it not working properly on the first run. After hours of debugging i've found out that comething, besides my code, causing some variables to have unpredictable values -- example --
with interrupts disable
having the break point in :
int8 testch=0;
testch=0x10;
BP> testch+=0x10;
testch-=0x10;
and stepping one step brings me to unpredictable value of testch....
sometimes to correct one 0x20, sometimes to 0!!!! ZERO....
please help me. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 04, 2005 6:21 pm |
|
|
Is it CCS or is it your debugger ? I would strongly suspect the debugger.
What is your debugger ? Do you have the latest firmware installed ?
What version of CCS and what PIC are you using ? |
|
![](templates/subSilver/images/spacer.gif) |
skiffex
Joined: 04 Feb 2005 Posts: 5
|
|
Posted: Fri Feb 04, 2005 6:32 pm |
|
|
i'm using pic18f452, with MPLAB 7 and ICD2, latest drivers/firmware installed. PCM version is 3.190 on first pc, and 3.207 on 2nd pc.
3.190 shows the correct beginning of the protocol (until it got variables corrupted)
3.207 doesn't even catch interrupts
tried to compile it for both DEBUG and RELEASE....
Last edited by skiffex on Fri Feb 04, 2005 6:37 pm; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
skiffex
Joined: 04 Feb 2005 Posts: 5
|
|
Posted: Fri Feb 04, 2005 6:36 pm |
|
|
please note that in PCM 3.190, when i'm commenting out 1 unused variable (int8) it starts to work perfectly... but i need this 1 variable latter on... currently it looks like this:
Code: |
int8 gWaitBusMessage;
void initall()
{
gWaitBusMessage=0;
}
void main()
{
initall();
do the rest....
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 04, 2005 7:18 pm |
|
|
Does your problem only occur during debugging ?
Is your problem the same as the one described in this Microchip forum
thread on "breakpoint skidding" with the ICD2 ?
http://forum.microchip.com/tm.asp?m=41374 |
|
![](templates/subSilver/images/spacer.gif) |
skiffex
Joined: 04 Feb 2005 Posts: 5
|
|
Posted: Fri Feb 04, 2005 7:37 pm |
|
|
No, the problem occurs in the release compilation too. with ICD2 disconnected...
and the problem is not the same as in that forum... |
|
![](templates/subSilver/images/spacer.gif) |
|