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.
Hi All,
I am using keil with the following settings
Target Device : Atmel 89C52 memory model : small - variables in data code rom size : large 64k program (It has 256 bytes on chip ram )
This is my code,
#include <reg52.h> unsigned char data Array[180]; void main() { int i ; for ( i = 0; i < 180; i++) Array[i] = 0 ;
..... ..... }
DATA segment too large is the error.
please note that
I DONT have any RAM interfaced to the controller to use xram space for variables .
I am in a requirement to use the array without reducing its size.
can anyone re-solve this issue ?
Thanks in advance, Anis
Does this work?
unsigned char idata Array[180];
The DATA address space is limited to 128 bytes - that is an architectural constraint; there is nothing that you can do about it! So, obviously, you cannot possibly fit a 180-byte array into DATA space!
You need to go back to the so-called "bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.semiconductors.philips.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.semiconductors.philips.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.semiconductors.philips.com/.../80C51_FAM_HARDWARE_1.pdf
It is 8052 and then why it is neccessary to specify it has 256 bytes on chip ram. ?
Thanks Dan Henry ..Its working :-)
Great. Do you also understand why this solves your problem ? You will need to know this or you will run into the next memory-related problems in about five minutes.
Because on-chip ram is not the same as data memory. Even internal RAM is not the same as data memory.
The term "data memory" refers explicitly to the first 128 bytes of internal RAM. Follow the links to the '51 'bible' posted above.