What variations are there in accessing external memories (MOVC, MOVX)?
Submitted By: Jan Waclawek FAQ Last Modified: 10/10/06
- The 8051 can be interfaced to two types of external memories:
- code memory
- read only
- using /PSEN as read strobe for the memory
- accessed for code fetches, and using MOVC. There are 2 forms of MOVC:
- MOVC A,@A+DPTR
- MOVC A,@A+PC
- MOVC A,@A+DPTR
- in the "classic" 12-clocker, there are 2 code fetches per 12-clock cycle -> relatively high speed
- most of the derivateves have included some of the code memory internally (nowadays as FLASH)
- it's usage depends on state of /EA pin and some of the programmable fuses
- when used, it prevents to fetch/read from the external code memory at the same addresses
- it's usage depends on state of /EA pin and some of the programmable fuses
- read only
- data memory
- read/write
- using /RD=P3.7 as read strobe and /WR=P3.6 as write strobe
- accessed using MOVX, with the forms:
- MOVX A,@DPTR - read
- MOVX @DPTR,A - write
- MOVX A,@R0 or MOVX A,@R0 - read; upper byte of address determined by current state of P2
- MOVX @R0,A or MOVX @R1,A - write; upper byte of address determined by current state of P2
- MOVX A,@DPTR - read
- some of the newer derivatives implement data memory (RAM) internally (called XRAM or sometimes ERAM)
- not only memory, also peripherals can be interfaced mapped as external data memory
- in some derivatives, XRAM can be used also as a code memory
- there are various restrictions of use of MOVX for the newer, faster derivatives and for the internal XRAM - see Oleg Sergeev's post on the topic
- read/write
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.