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.
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
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?
so 6264 chip is starting at address 8000H.
Why? You know that the 51 is a Harvard architecture, I hope. So why not keep things simple by just mapping your RAM at X:0x0000?
i'm not sure i need the 6264 at all,
Then why are you using one?
dot matrix 8x8, each row displays the suitable value (8-bits) in the array.
But your code's not doing anything to tell your display when you're writing a new value to P1. Is that supposed to happen by magic?
what is the proper way to init an array and read from it to P1 ?
The code you showed should do that. The fact that it doesn't indicates your problems are elsewhere. Which is why I asked about your hardware.
i didn't mention the hardware but it's working fine.
unsigned char array[] = { 0x00,0x01,0x02,0x03,0x04....,0x15}; while (1){ for (i=0;i<16;i++){ P1 = array[i]; int_1=0;int_1=1; // latch the displat } }
now instead of array[] i want to use xdisp[16][24] the address of 6264 is 0x8000. i've notice that i receive this values, which are the address of the array, in the dot display: row1 - 00 which is the address of 0x8000 row2 - 18 which is the address of 0x8018 row3 - 30 which is the address of 0x8030 row4 - 48 which is the address of 0x8048 row5 - 60 which is the address of 0x8060 row6 - 78 which is the address of 0x8078 row7 - 90 which is the address of 0x8090 . row16 - 38 which is the address of 0x8138
i guess that when i want the recieve the data from the address e.g 0x8018 the uC latch the address and after 'x' time he reads the data with RD through P1 AD0-AD7. so what happen is that the 6264 dont send the data out, and the lower byte of the address 0x8018 remains in PORT0, WHY? i add a delay and still Nothing. and do i need to set values in KEIL 'off chip xdata memory' or can i leave it blank? and do i need to set values in STARTUP.A51 or leave it's default values ?
Now I'm a bit confused.
You say that the display shows the address of the RAM memory, and speculate that the memory address remains on PORT0.
But are the display listening on PORT0? Isn't it listening on P1, since your code tries to emit data on P1?
Have you verified that if you only emit data directly from your code to the display, the display shows correct data?
Have you verified that if you write data to the external RAM, you can read it back correctly (and in another order than you wrote it)?
i have connected A0-A12 to 27c256. also i added 6264 8K ,CS connected to A15. so 6264 chip is starting at address 8000H.
where is the ALE latch????
bible time
here are the links to "the bible" Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer’s Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
ALE is connected to 74ls373 between uC and Eprom/6264. the problem is that no data are send from 6264 back to P0. when i read from RTC which is also included i use :
#define HR_rtc XBYTE[0x4000] time_hr = HR_rtc;
and i can receive all the data i need from the RTC so ALE is not the problem...
Nonsense. It's clearly not working. Or do you call that:
so what happen is that the 6264 dont send the data out, and the lower byte of the address 0x8018 remains in PORT0, WHY?
properly working hardware? Your hardware behaves as if that RAM chip just didn't exist.
and do i need to set values in STARTUP.A51 or leave it's default values ?
How is anybody supposed to know --- you haven't told what your actual hardware is. What microcontroller, in particular, at what clock frequency.