You are on page 1of 5

Experiment - 1

Aim – To study pin diagram and set of instruction for 8051microcontroller.


Theory -
8051 is an 8 – bit Microcontroller i.e. the data bus of the 8051
Microcontroller (both internal and external) is 8 – bit wide. It is a CISC based
Microcontroller with Harvard Architecture (separate program and data
memory).
Since the basic layout of a microcontroller includes a CPU, ROM, RAM, etc.
the 8051 microcontroller also has a similar layout.
A Microcontroller is a VLSI IC that contains a CPU (Processor) along with
some other peripherals like Memory (RAM and ROM), I/O Ports,
Timers/Counters, Communication Interface, ADC, etc.

8051 Microcontroller Basics


8051 is an 8 – bit Microcontroller i.e. the data bus of the 8051
Microcontroller (both internal and external) is 8 – bit wide. It is a CISC based
Microcontroller with Harvard Architecture (separate program and data
memory).
This microcontroller was also referred as “system on a chip” because it has
128 bytes of RAM, 4Kbytes of ROM, 2 Timers, 1 Serial port, and four ports
on a single chip. The CPU can work for only 8bits of data at a time because
8051 is an 8-bit processor. In case the data is larger than 8 bits then it has to
be broken into parts so that the CPU can process conveniently. Most
manufacturers have put 4Kbytes of ROM even though the quantity of ROM
can be exceeded up to 64 K bytes.
Since the basic layout of a microcontroller includes a CPU, ROM, RAM, etc.
the 8051 microcontroller also has a similar layout.
8051 Microcontroller Features
 8 – Bit ALU: ALU or Arithmetic Logic Unit is the heart of a
microcontroller. It performs arithmetic and bitwise operation on binary
numbers. The ALU in 8051 is an 8 – Bit ALU i.e. it can perform
operations on 8 – bit data.
 8 – Bit Accumulator: The Accumulator is an important register associated
with the ALU. The accumulator in 8051 is an 8 – bit register.
 RAM: 8051 Microcontroller has 128 Bytes of RAM which includes SFRs
and Input / Output Port Registers.
 ROM: 8051 has 4 KB of on-chip ROM (Program Memory).
 I/O Ports: 8051 has four 8 – bit Input / Output Ports which are bit
addressable and bidirectional.
 Timers / Counters: 8051 has two 16 – bit Timers / Counters.
 Serial Port: 8051 supports full duplex UART Communication.
 External Memory: 8051Microcontroller can access two 16 – bit address
line at once: one each for RAM and ROM. The total external memory that
an 8051 Microcontroller can access for RAM and ROM is 64KB (2 16 for
each type).
 Additional Features: Interrupts, on-chip oscillator, Boolean Processor,
Power Down Mode, etc.

8051 INSTRUCTION SET


• ACALL - Absolute Call
• ADD, ADDC - Add Accumulator (With Carry)
• AJMP - Absolute Jump
• ANL - Bitwise AND
• CJNE - Compare and Jump if Not Equal
• CLR - Clear Register
• CPL - Complement Register
• DA - Decimal Adjust
• DEC - Decrement Register
• DIV - Divide Accumulator by B
• DJNZ - Decrement Register and Jump if Not Zero
• INC - Increment Register
• JB - Jump if Bit Set
• JBC - Jump if Bit Set and Clear Bit
• JC - Jump if Carry Set
• JMP - Jump to Address
• JNB - Jump if Bit Not Set
• JNC - Jump if Carry Not Set
• JNZ - Jump if Accumulator Not Zero
• JZ - Jump if Accumulator Zero
• LCALL - Long Call
• LJMP - Long Jump
• MOV - Move Memory
• MOVC - Move Code Memory
• MOVX - Move Extended Memory
• MUL - Multiply Accumulator by B
• NOP - No Operation
• ORL - Bitwise OR
• POP - Pop Value From Stack
• PUSH - Push Value Onto Stack
• RET - Return From Subroutine
• RETI - Return From Interrupt
• RL - Rotate Accumulator Left
• RLC - Rotate Accumulator Left Through Carry
• RR - Rotate Accumulator Right
• RRC - Rotate Accumulator Right Through Carry
• SETB - Set Bit
• SJMP - Short Jump
• SUBB - Subtract From Accumulator With Borrow
• SWAP - Swap Accumulator Nibbles
• XCH - Exchange Bytes
• XCHD - Exchange Digits
• XRL - Bitwise Exclusive OR
• Undefined - Undefined Instruction

PIN Diagram –
 Pins 1 to 8 − These pins are known as Port 1. This port doesn’t serve any
other functions. It is internally pulled up, bi-directional I/O port.
 Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its
initial values.
 Pins 10 to 17 − These pins are known as Port 3. This port serves some
functions like interrupts, timer input, control signals, serial communication
signals RxD and TxD, etc.
 Pins 18 & 19 − These pins are used for interfacing an external crystal to
get the system clock.
 Pin 20 − This pin provides the power supply to the circuit.
 Pins 21 to 28 − These pins are known as Port 2. It serves as I/O port.
Higher order address bus signals are also multiplexed using this port.
 Pin 29 − This is PSEN pin which stands for Program Store Enable. It is
used to read a signal from the external program memory.
 Pin 30 − This is EA pin which stands for External Access input. It is used
to enable/disable the external memory interfacing.
 Pin 31 − This is ALE pin which stands for Address Latch Enable. It is
used to de-multiplex the address-data signal of port.
 Pins 32 to 39 − These pins are known as Port 0. It serves as I/O port.
Lower order address and data bus signals are multiplexed using this port.
 Pin 40 − This pin is used to provide power supply to the circuit.
RESULT –
We have successfully studied the 8051 microcontrollers.