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, When I try to do memory test by 8051, writing 1 byte of data (0xff or 0x0) to Xdata (32K RAM) by a for-loop way, 8051 will reset after runing the porgram by Keil monitor tool.
If the length of data put in Xdata is less than about 0x300, everything seems OK.
Can you give any idea about this situation, pls?
Thanks.
J.D.
//==================================================== // XRAM testing BYTE xdata t_dat[32750]; BYTE test_xram_data(){ WORD addr_y = 0; BYTE Wrng_Flg = 0;
for( addr_y = 0x0; addr_y < 0x7fee; ++addr_y) {
t_dat[addr_y] = 0xff;
if(t_dat[addr_y] != 0xFF)
Wrng_Flg = 1;
t_dat[addr_y] = 0;
if(t_dat[addr_y] != 0)
} return Wrng_Flg; } //====================================================
This problem is solved.
Beside the setting above, the xdata's length is also required to be set to 8000H in STARTUP.A51.
Tks for the help!
=STARTUP.A51= XDATASTART EQU 0H ; the absolute start-address of XDATA memory XDATALEN EQU 8000H ; the length of XDATA memory in bytes.