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 CCS Technical Support

Compiler gets lost

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



Joined: 02 Mar 2006
Posts: 16

View user's profile Send private message

Compiler gets lost
PostPosted: Mon Oct 08, 2007 11:52 am     Reply with quote

I'm using PIC16F737 and when I compile and run my program from debugger mode, the compiler gets lost and points to the middle of nowhere in program memory. I have no idea what causes this. Has anyone else experienced the same problem?

Would the problem be caused by (i'm just guessing) long nested if-else statements or multiple statements in a single switch statement case?

Please help. I've been experiencing this quite a bit.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Oct 08, 2007 4:06 pm     Reply with quote

What is your compiler version? It is a number like v3.249, v4.013 or v4.056.
dacenrie



Joined: 02 Mar 2006
Posts: 16

View user's profile Send private message

PostPosted: Mon Oct 08, 2007 4:44 pm     Reply with quote

Version 3.227
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Oct 08, 2007 4:50 pm     Reply with quote

That's a reasonable stable version. I don't know about the PIC16 but I'm a happy user of v3.226 for the PIC18F458.

Which debugger are you using the MPLAB ICD2 or CCS unit?
Debugging environment is CCS or MPLAB?

How ROM, RAM and stack is your program using? Please note that debugging units like the ICD2 use small part of the ROM, RAM and / or stack space. See the ICD2 online help file for more detailed info.
dacenrie



Joined: 02 Mar 2006
Posts: 16

View user's profile Send private message

PostPosted: Mon Oct 08, 2007 5:02 pm     Reply with quote

Yes, I'm using an ICD2 with an MPLAB IDE. I know for a fact that i'm not accessing any of the debugger's reserved memory space.

BTW, would adding a char and int16 value, then storing the result in an int16 variable be a problem perhaps?
barryg



Joined: 04 Dec 2006
Posts: 41

View user's profile Send private message

PostPosted: Fri Oct 12, 2007 12:55 pm     Reply with quote

I have had this happen when some of the chip wasn't programmed (I had set the programming range manually). Also having the wrong (different memory size) chip selected. I don't recall being able to get the compiler to make code that goes off into space, except when doing something unconventional (e.g. using GOTO_ADDRESS and doing too many returns). Overflowing the stack (as did with the GOTO) might do this (but as I said the compiler generally won't let this happen). Make sure you've programmed the chip after setting MPLAB in debug mode. Failing all that, try to find which statement causes the program to go off into space. Then, open the Program Memory window and step through those instructions until you find the offending branch. If you have to go that far. At some point the light will go on...as it did for me.
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