Dear sir,i use uVision IDE for 8051 ver 6.20c. I used AT89C81. My problem is, i want to store 25 integer value in an array called melody. When i tried to write code in following way, i get error "adress space overflow". -############################
int rit[] = {6, 12, 12, 6, 12, 24, 24, 18, 18, 18, 12, 12, 6, 12, 8, 8, 8, 12, 6, 12, 12, 6};
-############################ Then i used XDATA memory to save my integer values. In order to do that i wrote following code segment instead of previous one. -############################
unsigned long int xdata rit[25] = {6, 12, 12, 6, 12, 24, 24, 18, 18, 18,12, 12, 6, 12, 8, 8, 8, 12, 6, 12,12, 6, 6, 6, 12};
-############################
Compiler seems happy because i got no error*1, moreover as far as i understand those values is stored in XDATA memory.However, when 8051 try to access those value, simulation does not works fine because 8051 could not get those values which is stored in XDATA.
The code below shows how i try to get those integer values.
-############################ int i; for ( i=0; i<24; i++) { int tempo = rit[i]; -############################
Any help would be appreciated. Mert Özbek
*1:
Rebuild target 'Target 1' compiling Sound_Motor.c... linking... Program Size: data=31.0 xdata=200 code=909 creating hex file from "ServoSound"... "ServoSound" - 0 Error(s), 0 Warning(s).
That was my fault, AT89C51 is the correct name sir.
there is no external RAM chip. Should i use one of them if you want to; however that will eat most of your I/O pins. Rather use a different chip
I just thought that 8051 has already RAM. RAM is NOT XRAM read the datasheet for the chip, where do you find XDATA?
did you miss reading "the bible" www.8052.com/.../120112 ?
you did not answer "why int, why long int?"
Erik