I am using a Temic 80251 which gives me 1K on board RAM. Is there any way that I can tell the compiler that the IDATA class is bigger than 256 bytes.. because I get an error from the compiler that I have exceeded capacity. Or should I just use the edata class and just watch that I don't allocate above the 1K limit??? Any suggestions appreciated. Thank, Jim
The 1K of internal memory is not idata. idata is the same as the standard 8051 definition. Outside of the 1K internal, access is through the edata segment. You can access the internal 1K segment by defining it as xdata, and providing a data range in the linker. We put the following defines in a model.h, and include it in all source. This allows us to select which physical memory segment we want to place the data into.
#define HUGE huge /* 16 Meg indirect addressing, full access */ #define FAR far /* 16 Meg indirect addressing, in page */ #define NEAR near /* 64k direct and indirect addressing */ #define DATA near /* On-chip data */ #define XDATA near /* was far */ #define FXDATA xdata /* */ #define PDATA /* Paged xdata */ #define CODE far /* */ #define IDATA idata /* */ #define BDATA bdata /* Bit addressable memory */ #define EBDATA ebdata /* Extended bit addressable memory */ #define SBIT sbit #define BIT bit
char XDATA value1; // this goes in edata (near) char FXDATA value2; // this goes in 1K segment (xdata)
CL (XDATA (100h-41fh), & EDATA (8000h-0ffffh),hdata(8000h-0ffffh), & ECODE (0fe0000h-0feffffh), & HCONST (0fe0000h-0feffffh), & ECODE (0ff2080h-0ffffffh), & HCONST (0ff2080h-0ffffffh) ) &
Thanks Tom Excellent explaination Jim
View all questions in Keil forum