This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

51 will be reset when using a for-loop way to access Xdata (32K RAM) by Keil monitor tool.

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)

Wrng_Flg = 1;

}
return Wrng_Flg;
} //====================================================

Parents Reply Children
  • 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.