variables values changes unexpectly

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

Parents
  • "..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.

Reply
  • "..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.

Children
More questions in this forum