Practical No.7: Identify various pin of Microcontroller chip 8051.
A. Theory:
                      Microcontroller had wide range of applications in electronic system
              needing real time processing/control, starting from domestic applications such
              as washing machine, TV and air conditioners. Microcontrollers are also used in
              automobiles, process control industries, cell phones, robotics and in space
              applications.
      B.     8051 Architecture
                       8051 is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline
              package) having 4KB of ROM storage and 128 bytes of RAM storage, two 16-
              bit timers. It consists of four parallel 8-bit ports, which are programmable as well
              as addressable as per the requirement. An on-chip crystal oscillator is integrated
              in the microcontroller.In the 8051 microcontroller architecture, the system bus
              plays a key role to connect all the devices to the central processing unit. This bus
              includes an 8-bit data bus, a 16- bit address bus & bus control signals. Other
              devices can also be interfaced throughout the system bus like ports, memory,
              interrupt control, serial interface, the CPU, timers.
              Pins 1 to 8(Port 1): The Pins 1.0 to 1.7 are 8 Pins of port 1. Each of them can
              be configured as input or output pin.
              Pin 9: It is used to Reset Microcontroller 8051. A positive pulse is given on this
              Pin to reset Microcontroller.
              Pin 10 to 17(Port 3): These Pins are similar to Pins of Port 1. These Pins can be
              used as universal Input or output. These are dual function Pins. Function of each
              Pin is given as
              Pin 10   It is Serial Data Receive.
              Pin 11   It is Serial Data Transmit.
              Pin 12   Interrupt 0 input.
              Pin 13   Interrupt 1 input.
              Pin 14   Counter 0 clock input.
              Pin 15   Counter 1 clock input.
              Pin 16   Writing Signal for Writing content on external RAM.
              Pin 17   Reading Signal to read contents of external RAM.
              Pin 18 and 19: These are input output PINS for oscillator. An internal oscillator
              is connected to Micro controller through these PINS.
              Pin 20: Pin 20 is grounded.
            Figure 1. 8051 microprocessor pin diagram
Pin 21 to 28 (Port 2): These Pins can be configured as Input Output Pins. But
this is only possible in case when we don't use any external memory. If we use
external memory then these pins will work as high order address bus (A8 to
A15).
Pin 29: If we use an external ROM then it should has a logic 0 which indicates
Micro controller to read data from memory.
Pin 30: This Pin is used for ALE that is Address Latch Enable. If
we use multiple memory chips then this pin is used to distinguish
between them. This Pin also gives program pulse input during
programming of EPROM.
Pin 31: If we have to use multiple memories then by applying
logic 1 to this pin instructs Micro controller to read data from both
memories first internal and afterwards external.
Pin 32 to 39(Port 0): Similar to port 2 and 3, these pins can be
used as input output pins when we don't use any external memory.
When ALE or Pin 30 is at 1 then this port is used as data bus, when
ALE pin at 0, then this port is used as lower order address bus(A0
to A7).
Pin 40: VCC +5V power supply.