We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm using the cygnal F124 chip. now my program is 33K in size and my ram memory isa bout 7.2K. I use the uart0 to print some information and one LCD, last week my unsigned long variable changed without writting in them.. I use this variables as counters these counters are updated every one second but after 3 o4 seconds this variables change from 200 to 156234324 or another big number!!!!! I want to know what is the problem here.. these variables are globla! and I only updated by 2 or 3 functions Another thing is can someone tell me how to optimize the code using the keil compiler. I want to know which pragma function should I have to use to get better performance and dont have this kind of errors
The usual reasons for variables taking on unexpected values include: 1) Uninitialised pointers 2) Overwriting array boundaries. 3) ISR and main program modifying a multibyte variable simultaneously. "I want to know which pragma function should I have to use to get better performance" You can select the optimisation level through the Options for Target C51 tab. I'd recommend level nine. "and dont have this kind of errors" It's much more likely that your program contains the errors rather than the optimiser. Changing optimisation level may make the problem appear to come and go, but that doesn't mean the problem lies with the optimiser. Stefan
Also it's worth mentioning that increasing optimisation level can highlight one's failure to use the 'volatile' keyword where it's needed. Stefan