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 declare these variables: unsigned long idata xpaquetes,xbytes; unsigned long errors,PHY,CRC; I ran my progran and after 3 minutes the errors,PHY and CRC variables change to 0xaaaaaaaaaaaaaaaa but the xpaquetes and xbytes still have the right value? I think something is wrong during compilation because my program started counting and updating these variables but after few minutes these variables are unstable what can I do? I put now : unsigned long xdata errors,PHY,CRC; but I got the same error please give me suggestions
"..variables change to 0xaaaaaaaaaaaaaaaa ..." it's a bit too long, isn't it :-? (is it possibly double precision?) "what can I do?" I think look for the bug. I am almost sure it must be there. You didn't give any info what way you handle these variables, if there are any interrupts, etc.
the unsigned long variables are used to count events and only are counters .. yesterday I put unsigned long idata PHY,CRC, ERROR and works well soembody tell me why?? thanks
A (hardware?) problem with your XDATA?
I don't think so, other int and char varibles work well, the only problem is with the float and the long variables any suggestion I'm using the 7.02 version of the c51 compiler thanks
Maybe an overlay problem - look at the linker mapfile to make sure that the address is only used by these variables. Make sure that the memory settings for your hardware are correct (XDATA). Do you have the same problem on using the simulator?
I have a similar problem. The following is code snippet:
a = Float2Int(23.1); a = Float2Int(23.5); a = Float2Int(-23.6); a = Float2Int(-23.1); a = ceil(-23.6); a = (int) UcharAverage(ucA,10); //after the sentence the a's value will be uncetain iAvg = IntAverage(iA,10); fAvg = FloatAverage(fA,10); Float2asc(-1278.98791,ucA); Float2asc(-99999.89971,ucA);
... a = (int) UcharAverage(ucA,10); iAvg = IntAverage(iA,10); fAvg = FloatAverage(fA,10); b = a; Float2asc(-1278.98791,ucA); ...
"this [optimisation] makes watching variable values in the debugger/simulator *very* confusing." Unfortunately, that's always a price you pay for optimisation! :-( See this discussion: http://www.keil.com/forum/docs/thread1673.asp