Global xdata variables

Hi!

I have a problem with global xdata variables. In main.c I have the following code to make two global arrays.

unsigned int xdata fordonsnummer[100] _at_ 0x000;
unsigned int xdata tomvikt[100] _at_ 0x0c8;  

Then in some heather files I have functions that uses the global variable. there for I have the following code:
extern unsigned int xdata fordonsnummer[];
extern unsigned int xdata tomvikt[];  
One function writes a value to a position in the array but when another reads the same value something goes wrong. The written value is for example 12345 and the read value is 257. What is wrong with my code. I have marked the "Use the onchip XRAM" in Options for target.

Regard Jonas Finell

Parents Reply Children
More questions in this forum