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

Problem with declare variable or implement new function

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



Joined: 28 Aug 2009
Posts: 1

View user's profile Send private message

Problem with declare variable or implement new function
PostPosted: Fri Aug 28, 2009 3:55 pm     Reply with quote

CCS Compiler PCW Version 4.079
PIC 18F4523
------------------------------------------

Hi!

After some changing’s in my program I deleted a declaration of a variable I needn’t any more.
The compilation was ok, without errors or corresponding warnings.
But the program doesn't run correctly.
First some adc read temperatures, which are displayed at the lcd, has impossible values. Than the complete communication with the lcd and the keys has broken. Based on the status leds I can see that sometimes the temperature controlling, which is implemented in an interrupt routine, has broken too.
When I declare the variable again the program works fine.

Few days ago I had this problem too when I implemented a new function. Having commented out this function the program runs without faults.

Statistics information:
RAM use: 16% to 25%
Stack 15 of 30 available

Does anybody know where this is due to?
Thanks for your time and answers.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 28, 2009 4:03 pm     Reply with quote

If you remove a variable declaration and have strange things happen,
it could be caused by your code overwriting an array, and destroying
a variable that comes after the array. If that variable is not used,
then you won't notice the problem. But if you delete that variable,
now a variable that is used will be destroyed. Then you will see
a problem in your program.

Look for this problem in your code. Check if you are writing beyond
the end of an array.
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