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; } //====================================================
Sounds like you are writing over the monitor data area. This will certainly corrupt it and cause the monitor to crash or reset.
Jon
Does your system have a Watchdog?
Thanks. I use AT89C51 to simulate the memory test and the condition of WDT is excluded.
The xdata setting about Keil monitor tool is as follows.
"Target"->"off-chip xdata memory"->start:0x0000 size:0x7fff "Debug"->Setting"->"cache option"-> all options are unchecked.
So, it seems that the program should write data in the monitor data area by the setting. Have you any idea about that? Tks.
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.