Standard 8051:
The standard 8051 has separate address spaces for program and data memory; it can address 64 KB of read-only program memory at addresses 0x0000-0xFFFF, and another 64 KB of read/write data memory, also at addresses 0x0000-0xFFFF. The standard 8051 keeps the two memory spaces separate by using different bus signals to access them; the read strobe for program memory is PSEN# (Program Store Enable), and the read and write strobes for data memory are RD# and WR#. The 8051 generates PSEN# strobes for instruction fetches and for the MOVC (move code memory into the accumulator) instruction; it generates RD# and WR# strobes for all datamemory accesses. In a standard 8051 application, an external 64 KB ROM chip (enabled by the 8051’s PSEN# signal) might be used for program memory and an external 64 KB RAM chip (enabled by the 8051’s RD# and WR# signals) might be used for data memory. In the standard 8051, all program memory is read-only.
EZ-USB:
The EZ-USB has 16 KB of on-chip RAM (the “Main RAM”) at addresses 0x0000-0x3FFF, and 512 bytes of on-chip RAM (the “Scratch RAM”) at addresses 0xE000-0xE1FF. Although this RAM is physically located inside the chip, it’s addressed by EZ-USB firmware as External memory, just as though it were in an external RAM chip. Some systems use only this on-chip RAM, with no off-chip memory. In those systems, the RD# and PSEN# strobes are automatically combined for accesses to addresses below 0x4000, so the Main RAM is accessible as both data and program memory. The RD# and PSEN# strobes are not combined for the Scratch RAM; Scratch RAM is accessible as data memory only. Although it’s technically accurate to say that the Main RAM data memory is writable while the Main RAM program memory is not, it’s a distinction without a difference. The Main RAM is accessible both as program memory and data memory, so writing to Main RAM data memory is equivalent to writing to Main RAM program memory at the same address. The Scratch RAM is never accessible as program memory. The EZ-USB also reserves 7.5 KB (0xE200-0xFFFF) of the data-memory address space for control/ status registers and endpoint buffers (see Section 5.6, "On-Chip Data Memory at 0xE000- 0xFFFF"). Note that only the data-memory space is reserved; program memory in the 0xE000- EZ-USB Technical Reference Manual Page 5-4 EZ-USB Technical Reference Manual v1.3 0xFFFF range is not reserved, so the 128-pin EZ-USB can access off-chip program memory in that range. |