The 8051 packaged in a 40-pin DIP. The figure shows the pin diagram of 8051. Many of the pins of 8051 are used for more than one function. The alternative functions are also shown in the diagram.
The 8051 has 32 I/O pins configured as four eight-bit parallel ports(P0, P1, P2 and P3). All four ports are bidirectional i.e., each pins will be configured as input or output(or both). All port-pins are multiplexed except pins of port 1. Each ports consist of a latch, an output driver and an input buffer.
The 8051 has 32 I/O pins configured as four eight-bit parallel ports(P0, P1, P2 and P3). All four ports are bidirectional i.e., each pins will be configured as input or output(or both). All port-pins are multiplexed except pins of port 1. Each ports consist of a latch, an output driver and an input buffer.
Port 0(Pins 32-39): Port 0 pins are used as I/O pins. The output drives and input buffer of port 0 are used to access external memory address, time multiplexed with the data being written or read. Thus, port 0 can be used as a multiplexed address{/data bus.
Port 1(Pins 1-8): Port 1 pins can used only as I/O pins
Port 2(Pins 21-28): The output drives of port 2are used to access external memory. Port 2 outputs are high order byte of the external memory address when the address is 16-bit wide. Otherwise, port 2 is used as an I/O port.
Port 3(Pins 10-17): All port pins of port 3 are multifunctional. Therefore, each pins of port 3 can be programmed to use as I/O or as one of the alternative functions. They have special functions bas shown in table below, including two external interrupts, two special data lines and two timing control strobes.
Symbol | Position | Alternate use |
---|---|---|
RD' | P3.7 | External memory read signal |
WR' | P3.6 | External memory write signal |
T1 | P3.5 | External timer 1 input |
T0 | P3.4 | External timer 0 input |
INT1' | P3.3 | External interrupt 1 input |
INT0' | P3.2 | External interrupt 0 input |
TXD | P3.1 | Serial data output |
RXD | P3.0 | Serial data input |
ALE(Address Latch Enable, Pin 30): AD0 to AD7lines are multiplexed. To demultiplex these lines and obtaining lower half of an address, an external latch and ALE signal of 8051 is used.
RST(Reset, Pin 9): This pin is used to reset 8051. For proper reset operation, reset signal must held high atleast for two machine cycles, while oscillator is running. This high logical state on this input halts the microcontroller and clears all the registers. Bringing this pin back to logical state zero starts the program as if the power had just been turned on. Depending on the device's purpose and Environments, this pin is usually connected to the push button, reset-upon-start circuit or brown out reset circuit. The image shows one simple circuit for safe reset upon starting the controller.
PSEN'(Program Store Enable, Pin 29): It is the active low output control signal used to activate the enable signal of the external ROM/EPROM. It is activated every six oscillator periods while reading the external memory. Thus, this signal acts as the read strobe to external program memory.
EA'(External Access, Pin 31): When EA' is high (connected to Vcc), program fetches to addresses 0000H through 0FFFH are directed to the internal ROM and program fetches to addresses 1000H through FFFFH are directed to external ROM/EPROM. When EA'is low(grounded), all addresses(0000H to FFFFH) fetched by program are directed to the external ROM/EPROM.
Comments
Post a Comment