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

pdata, idata and xdata query

Hello,
I have an 8051 custom processor, this have a memory mapped like this:
16 banks of eeprom external memory of 32kB each one. The page 0 is mapped: 0x0000-0x7FFF. The other ones: 0x8000-0xFFFF. The page number is selected via a PAGE_REG.
Also I have a block of extended ram which is mapped from 0x1000-0x1FFF. And I have two RAMs more: internal ram (indirect and direct address), and external ram, of 256B amount (from 0x00 to 0xFF).
Memory access from C, I do this:
For eeprom:

//... select mem_page ...
unsigned char pdata *ptr;
ptr = address;
*ptr = dat;

For extended ram:

unsigned char xdata *ptr;
ptr = address     // 0x1000 <= address <= 0x1FFF
*ptr= dat;

For internal ram:

unsigned char idata *ptr;
ptr = address;
*ptr = dat;

The extended ram, and internal ram works, but the eeprom access doesn't.
Someone can guide me?
Thanks a lot.

g.

Parents
  • Thanks for your answer. The EEPROM memory is mapped like I told before. The page0 (0-0x7FFF) contains the code of the software that executes the processor. The other pages (mapped 0x8000-0xFFFF) contains data that can be written and read from the memory.
    The access to the memory is by doing the code I post before. I tried to do by treating memory like xdata, and it works, but I don´t have other method to verificate that the correct memory write is the EEPROM...
    Thanks a lot.

    g.

    PS: Again sorry by my english. =)

Reply
  • Thanks for your answer. The EEPROM memory is mapped like I told before. The page0 (0-0x7FFF) contains the code of the software that executes the processor. The other pages (mapped 0x8000-0xFFFF) contains data that can be written and read from the memory.
    The access to the memory is by doing the code I post before. I tried to do by treating memory like xdata, and it works, but I don´t have other method to verificate that the correct memory write is the EEPROM...
    Thanks a lot.

    g.

    PS: Again sorry by my english. =)

Children