strange behavior with unsigned long variables

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

Parents
  • I'm afraid information you have posted is insufficient to help solving your problem without genius. Size of your code and data is useless. What about a relevant piece of code?
    "...last week my unsigned long variable changed without writting in them..."
    does it mean the week before that it didn't?
    do you suspect optimization?

Reply
  • I'm afraid information you have posted is insufficient to help solving your problem without genius. Size of your code and data is useless. What about a relevant piece of code?
    "...last week my unsigned long variable changed without writting in them..."
    does it mean the week before that it didn't?
    do you suspect optimization?

Children
More questions in this forum