CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Variable inconsistency in CCS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
skiffex



Joined: 04 Feb 2005
Posts: 5

View user's profile Send private message ICQ Number

Variable inconsistency in CCS
PostPosted: Fri Feb 04, 2005 6:06 pm     Reply with quote

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.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 04, 2005 6:21 pm     Reply with quote

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 ?
skiffex



Joined: 04 Feb 2005
Posts: 5

View user's profile Send private message ICQ Number

PostPosted: Fri Feb 04, 2005 6:32 pm     Reply with quote

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
skiffex



Joined: 04 Feb 2005
Posts: 5

View user's profile Send private message ICQ Number

PostPosted: Fri Feb 04, 2005 6:36 pm     Reply with quote

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....
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 04, 2005 7:18 pm     Reply with quote

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
skiffex



Joined: 04 Feb 2005
Posts: 5

View user's profile Send private message ICQ Number

PostPosted: Fri Feb 04, 2005 7:37 pm     Reply with quote

No, the problem occurs in the release compilation too. with ICD2 disconnected...
and the problem is not the same as in that forum...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group