8051 pin diagram

Embed Size (px)

Citation preview

  • 7/27/2019 8051 pin diagram

    1/20

  • 7/27/2019 8051 pin diagram

    2/20

  • 7/27/2019 8051 pin diagram

    3/20

  • 7/27/2019 8051 pin diagram

    4/20

    For describing pin diagram and pinconfiguration of 8051, we are taking into

    consideration a 40 pin DIP (Dual inlinepackage). Now lets go through pin configurationin detail.

  • 7/27/2019 8051 pin diagram

    5/20

    Pin-40 : Named as Vcc is the main powersource. Usually its +5V DC.

    Pins 32-39: Known as Port 0 (P0.0 to P0.7) In addition to serving as I/O port, lowerorder address and data bus signals aremultiplexed with this port (to serve the

    purpose of external memory interfacing).

  • 7/27/2019 8051 pin diagram

    6/20

    Pin-31:- ALE aka Address Latch Enable isused to demultiplex the address-data signalof port 0 (for external memory interfacing.)

    Pin-30:- EA/ External Access input is used toenable or disallow external memoryinterfacing. If there is no external memory

    requirement, this pin is pulled high byconnecting it to Vcc.

  • 7/27/2019 8051 pin diagram

    7/20

    Pin- 29:- PSEN or Program Store Enable isused to read signal from external programmemory.

    Pins- 21-28:- Known as Port 2 (P 2.0 to P 2.7) in addition to serving as I/O port, higherorder address bus signals are multiplexed.

  • 7/27/2019 8051 pin diagram

    8/20

    Pin 20:- Named as Vss it represents ground (0V) connection.

    Pins 18 and 19:- Used for interfacing anexternal crystal to provide system clock.

    Pins 10 17:- Known as Port 3. This port alsoserves some other functions like interrupts,timer input, control signals for externalmemory interfacing RD and WR , serialcommunication signals RxD and TxD etc.

  • 7/27/2019 8051 pin diagram

    9/20

    Pin 9:- As explained before RESET pin is usedto set the 8051 microcontroller to its initialvalues, while the microcontroller is working

    or at the initial start of application.

    Pins 1 8:- Known as Port 1. Unlike otherports, this port does not serve any other

    functions.

  • 7/27/2019 8051 pin diagram

    10/20

    There are 21 Special function registers(SFR) in 8051 micro controller and thisincludes Register A, Register B, Program

    Status Word (PSW), PCON etc etc.There are 21 unique locations for these 21special function registers and each of theseregister is of 1 byte size.

    Some of these special function registers arebit addressable (which means you can access8 individual bits inside a single byte), whilesome others are only byte addressable .

  • 7/27/2019 8051 pin diagram

    11/20

    The Accumulator (sometimes referred to as

    Register A also) holds the result of most of arithmetic and logic operations.

    ACC is usually accessed by direct addressingand its physical address is E0H.

    Accumulator is both byte and bit

    addressable. You can understand this fromthe figure shown below.

  • 7/27/2019 8051 pin diagram

    12/20

    To access the first bit (i.e bit 0) or to accessaccumulator as a single byte (all 8 bits atonce), you may use the same physicaladdress E0H. Now if you want to access thesecond bit (i.e bit 1), you may use E1H andfor third bit E2H and so on.

  • 7/27/2019 8051 pin diagram

    13/20

    The major purpose of this register is inexecuting multiplication and division. The8051 micro controller has a single instruction

    for multiplication (MUL) and division (DIV).

    Ex: MUL A,B When this instruction isexecuted, data inside A and data inside B is

    multiplied and answer is stored in A.

    For MUL and DIV instructions, it is necessarythat the two operands must be in A and B.

  • 7/27/2019 8051 pin diagram

    14/20

  • 7/27/2019 8051 pin diagram

    15/20

    4 I/O ports named P0, P1, P2 and P3 has gotfour corresponding port registers with samename P0, P1, P2 and P3.Data must be written into port registers firstto send it out to any other external devicethrough ports.Similarly any data received through portsmust be read from port registers forperforming any operation.All 4 port registers are bit as well as byteaddressable. Take a look at the figure belowfor a better understanding of port registers.

  • 7/27/2019 8051 pin diagram

    16/20

  • 7/27/2019 8051 pin diagram

    17/20

    SP, stack pointer represents a pointer to thesystem stack. Stack pointer is an 8 bit

    register, the direct address of SP is 81H andit is only byte addressable, which means youcant access individual bits of stack pointer.

  • 7/27/2019 8051 pin diagram

    18/20

  • 7/27/2019 8051 pin diagram

    19/20

  • 7/27/2019 8051 pin diagram

    20/20