View previous topic :: View next topic |
Author |
Message |
derazubi
Joined: 28 Aug 2009 Posts: 1
|
Problem with declare variable or implement new function |
Posted: Fri Aug 28, 2009 3:55 pm |
|
|
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
|
|
Posted: Fri Aug 28, 2009 4:03 pm |
|
|
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. |
|
|
|