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

Acessing external memory from internal program

I've made a memory mapped 8051 design using the AT89S52.
Connected to the AT89S52 are two external memories.

The memories are located at:

Address 0x0000 = Parallel EEPROM
Address 0x2000 = Parallel SRAM

I've defined the SRAM as off-chip xdata memory and it is working fine.

How should I define the EEPROM to be able to access it as off-chip non-volatile memory AND/OR expanded code memory?

Parents
  • I am not familiar with the AT89S52 device and I don't have time to fetch the data sheets. If the device has on chip EPROM and you plan to use both on-chip and external EPROM then the external EPROM is not required to start at 0x0000. Read the data sheet on the /PSEN strobe. Assume that you had 4K of on chip EPROM. Any MOVC instruction will activate the /PSEN AFTER the 4K boundry so your external EPROM address could start at 0x0000 but you will lose the first 4K of the external EPROM. But the answer to you immediate question is "YES", you must have code located at 0x0000. Any reset will attempt to execute code at this location.
    If you leave the external EPROM as XDATA then you cannot fetch instructions from XDATA. So you must make your external EPROM memory appear as von Neumann memory which means you must use external glue logic to logical OR the /PSEN and /RD strobes.
    With your stated XDATA EPROM you cannot execute code from the external EPROM.

    And I know some devices have this ability that you can select via special function registers. I do not know if the AT89S52 has this structure.

    Search this forum for "The Bible of 8051 basic operations. There are lot of good links with examples.
    Also, search http://www.8052.com for great info on this topic.
    Bradford

Reply
  • I am not familiar with the AT89S52 device and I don't have time to fetch the data sheets. If the device has on chip EPROM and you plan to use both on-chip and external EPROM then the external EPROM is not required to start at 0x0000. Read the data sheet on the /PSEN strobe. Assume that you had 4K of on chip EPROM. Any MOVC instruction will activate the /PSEN AFTER the 4K boundry so your external EPROM address could start at 0x0000 but you will lose the first 4K of the external EPROM. But the answer to you immediate question is "YES", you must have code located at 0x0000. Any reset will attempt to execute code at this location.
    If you leave the external EPROM as XDATA then you cannot fetch instructions from XDATA. So you must make your external EPROM memory appear as von Neumann memory which means you must use external glue logic to logical OR the /PSEN and /RD strobes.
    With your stated XDATA EPROM you cannot execute code from the external EPROM.

    And I know some devices have this ability that you can select via special function registers. I do not know if the AT89S52 has this structure.

    Search this forum for "The Bible of 8051 basic operations. There are lot of good links with examples.
    Also, search http://www.8052.com for great info on this topic.
    Bradford

Children
No data