hello, i've declared an external memory mapped at address 8000H, and load data into it :
unsigned char xdata xdisp[15][24] _at_ 0x8000; unsigned char i; for (i = 0; i < 16; i++) { xdisp[i][0] = i; xdisp[i][1] = i + 1; xdisp[i][2] = i + 2; xdisp[i][3] = i + 3; xdisp[i][4] = i + 4; xdisp[i][5] = i + 5; } for (i = 0; i < 16; i++) { P1 = xdisp[i][0]; }
the result in P1 is the address of xdisp[i][0] and not the value in it. how can i use a pointer or something else to recieve the values.
thanks
the result in P1 is the address of xdisp[i][0]
No, it's not. For starters, P1 isn't wide enough to hold an address.
and not the value in it.
And you're sure you actually have accessible RAM memory at 0x8000 in your hardware?
i have connected A0-A12 to 27c256. also i added 6264 8K ,CS connected to A15. so 6264 chip is starting at address 8000H. i'm not sure i need the 6264 at all, all i want is to set an array as mentioned above, approx 360 Byte's. i set the 'off-chip xdata memory" :0x8000 0x0400 and in the program :
unsigned char xdata xdisp[15][24] _at_ 0x8000;
i can see what is P1 beacause it's connected to dot matrix 8x8, each row displays the suitable value (8-bits) in the array.
P1 = xdisp[z][0] // z = 0 ->row1
i'm usind 2D array beacause the x 'xdisp[z][x]' refers to the column 'x' (8 bits) of the display. so what is the proper way to init an array and read from it to P1 ?
You declare an array 15 elements large ([15]) but you assign it as if it was 16 elements large when you loop i = 0; i < 16.
Are you sure that you should emit values to P1 without latching the values into your display?
View all questions in Keil forum