Thursday, March 31, 2016

8051 External Program Memory Interfacing

In 8051, we connect the EA pin to Vcc to indicate that the program code is stored in the microcontroller’s on-chip ROM. To indicate that the program code is stored in external ROM, this pin must be connected to GND.

8051 External Program Memory Interfacing

Port 0 & 2:
The PC (program counter) of the 8051 is 16-bit, it is capable of accessing up to 64K bytes of program code. In the 8051, port 0 and port 2 provide the 16-bit address to access external memory. Of these two ports, P0 provides the lower 8 bit addresses A0 – A7, and P2 provides the upper 8 bit addresses A8 – A15. More importantly, P0 is also used to provide the 8-bit data bus D0 – D7. In other words, pins P0.0 – P0.7 are used for both the address and data paths. This is called address/data multiplexing in chip design.

ALE:
ALE is an output pin for the 8051 microcontroller. ALE is used to select address or data path. It is important to note that normally ALE = 0, and P0 is used as a data bus, sending data out or bringing data in. Whenever the 8051 wants to use P0 as an address bus, it puts the addresses A0 – A7 on the P0 pins and activates ALE = 1 to indicate that P0 has the addresses.

PSEN:
PSEN is an output signal for the 8051 microcontroller and must be connected to the OE pin of a ROM containing the program code. In other words, to access external ROM containing program code, the 8051 uses the PSEN signal. The 8051 fetches opcode from external ROM by connecting PSEN pin to the OE pin of ROM.

Both Internal and External ROM:
In an 8051 system we could use the on-chip ROM for the boot code, and an external ROM will contain the user’s program. The system boot code resides on-chip and the user’s programs are downloaded into off-chip ROM. The system boot code resides on-chip and the user’s programs are downloaded into off-chip ROM. Upon reset the 8051 executes the on-chip program first; then, when it reaches the end of the on-chip ROM it switches to external ROM for the rest of the program code. System with both on-chip and off-chip ROM code where EA = Vcc, the controller fetches opcodes starting at address 0000, then goes on to address 0FFF (the last location of on-chip ROM). Then the program counter generates address 1000H and is automatically directed to the external ROM containing the program code.
8051 External Program Memory Interfacing

MOVC instruction is used to access the data located in program memory. The MOVC instruction, where C stands for code, indicates that data is located in the code space of the 8051.



Related topics:
8051 External Data Memory Interfacing   |   8051 Memory Mapped IO   |   8051 LED Interfacing   |   8051 Switch Interfacing   |   8051 Keyboard Interfacing   |   8051 7-Segment Display Interfacing   |   8051 LCD Interfacing   |   8051 ADC Interfacing   |   8051 DAC Interfacing   |   8051 Relay Interfacing   |   8051 Sensor Interfacing   |   8051 Stepper Motor Interfacing   |   8051 DC Motor Interfacing

List of topics: 8051

No comments:

Post a Comment