0% found this document useful (0 votes)
32 views7 pages

Test Material

The document describes the architecture and components of the 8051 microcontroller. It details the central processing unit, memory organization including RAM, ROM, and registers. It also discusses the timers, serial port, input/output ports, and other special function registers. The 8051 microcontroller is an 8-bit device commonly used in embedded applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

Test Material

The document describes the architecture and components of the 8051 microcontroller. It details the central processing unit, memory organization including RAM, ROM, and registers. It also discusses the timers, serial port, input/output ports, and other special function registers. The 8051 microcontroller is an 8-bit device commonly used in embedded applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

8051 MICROCONTROLLER

Microcontroller:
A microcontroller is a highly integrated single chip, which consists of on chip CPU
(Central Processing Unit), RAM (Random Access Memory), EPROM/PROM/ROM (Erasable
Programmable Read Only Memory), I/O (input/output) – serial and parallel, timers, interrupt
controller.
❖ For example, Intel 8051 is 8-bit microcontroller and Intel 8096 is 16-bit microcontroller.
Microcontroller Consist Of;

1. ALU
2. A-Accumulator
3. B-Register
4. PC-Program Counter
5. PSW Register
6. Stack Pointer
7. DPTR (Data Pointer)
8. Timers\ Counters
9. Input Output Ports
10. Memory organization
11. Internal RAM
12. On chip ROM
13. SFR’S Special Function Registers
14. Oscillator

BLOCK DIAGRAM PF 8051:


ARCHITECTURE PF 8051:

ALU (Arithmetic Logical Unit):


 This unit is used for the arithmetic calculations.
A-Accumulator:
 This register is used for arithmetic operations.
 This is also bit addressable and 8 bit register.
B-Register:
 This register is used in only two instructions MUL AB and DIV AB.
 This is also bit addressable and 8 bit register.
PC-Program Counter:
 Points to the address of next instruction to be executed from ROM o It is 16 bit register
means the 8051 can access program address from 0000H to FFFFH.
 PC always points to 0x0000 of program memory and is incremented each time an
instruction is executed.
PSW Register (8051 Flags):
We can say that PSW is an internal register that keeps track of the computer at every
instant. Generally, the instruction of the result of a program is stored in a single bit register called
a 'flag'. The are7 flags in the PSW of 8051. Among these 7 flags, 4 are math flags and 3 are
general purpose or user flags.

CY AC F0 RS1 RS0 OV _ P

The bits PSW3 and PSW4 are denoted as RS0 and RS1 and these bits are used to select
the bank registers of the RAM location.
P (Parity flag) → PSW 0.0
 1 – odd number of 1 in ACC
 0 – even number of 1 in ACC

Stack Pointer:
 In 8051 RAM locations from 08H to 1FH can be used as stack. Stack is used to store the
data temporarily.
 Stack is last in first out (LIFO).Stack pointer (SP) is a 8bit register.
 It indicates current RAM address available for stack or it points the top of stack.
 Initially by default at 07H because first location of stack is 08H.
 After each PUSH instruction the SP is incremented by one while in MC after PUSH
instruction SP is decremented.
 After each POP instruction the SP is decremented.
DPTR (Data Pointer):
 This is a 16 bit register which is used to furnish address information for internal
and external program memory and for external data memory.
 It is divided into two parts DPH and DPL .
 DPH for Higher order 8 bits, DPL for lower order.

Input Output Ports:


 There are four input output ports available P0, P1, P2, P3.
 Each port is 8 bit wide and has special function register P0, P1, P2, P3 which are bit
addressable means each bit can be set or reset by the Bit instructions (SETB for high,
CLR for low) independently.
 The data at any port which is transmitting or receiving is in these registers.

 The port 0 can perform dual works. It is also used as Lower order address bus (A0 to A7)
multiplexed with 8 bit data bus P0.0 to P0.7 is AD0 to AD7 respectively the address bus
and data bus is demultiplexed by the ALE signal and latch which is further discussed in
details.
 Port 2 can be used as I/O port as well as higher order address bus A8 to A15.
 Port 3 also have dual functions it can be worked as I/O as well as each pin of P3 has
specific function.
 P3.0 – RXD – {Serial I / P for Asynchronous communication Serial O / P
for synchronous communication}.
 P3.1 – TXD – Serial data transmit. o P3.2 – INT0 – External Interrupt 0. o
P3.3 – INT1 – External Interrupt 1.
 P3.4 – T0 – Clock input for counter 0.
 P3.5 – T1 – Clock input for counter 1.
 P3.6 – WR – Signal for writing to external memory.
 P3.7 – RD – Signal for reading from external memory.
 When external memory is interfaced with 8051 then P0 and P2 can’t be worked as I/O
port they works as address bus and data bus, otherwise they can be accessed as I/O ports.

Timers\ Counters:
 The 8051 has two counters/timers which can be used either as timer to generate a time
delay or as counter to count events happening outside the microcontroller.
 The 8051 has two timers: timer0 and timer1. They can be used either as timers or as
counters. Both timers are 16 bits wide. Since the 8051 has an 8-bit architecture, each 16-
bit is accessed as two separate registers of low byte and high byte.
Serial Port:
 There are two pins available for serial communication TXD and RXD o Normally TXD
is used for transmitting serial data which is in SBUF register, RXD is used for receiving
the serial data.
 SCON register is used for controlling the operation.

Memory organization:
 The 8051 microcontroller has 128 bytes of Internal RAM and 4kB of on chip ROM.
 The RAM is also known as Data memory and the ROM is known as program memory.
 The program memory is also known as Code memory.
 This Code memory holds the actual 8051 program that is to be executed.
 In 8051 this memory is limited to 64K. o Code memory may be found on-chip, as ROM
or EPROM. It may also be stored completely off-chip in an external ROM or, more
commonly, an external EPROM.
 The 8051 has only 128 bytes of Internal RAM but it supports 64kB of external RAM. As
the name suggests, external RAM is any random access memory which is off-chip.
 Since the memory is off-chip it is not as flexible interms of accessing, and is also slower.
 For example, to increment an Internal RAM location by 1, it requires only 1 instruction
and 1 instruction cycle but to increment a 1-byte value stored in External RAM requires 4
instructions and 7 instruction cycles. So, here the external memory is 7 times slower.

Internal RAM OF 8051:


 This Internal RAM is found on-chip on the 8051.
 So it is the fastest RAM available, and it is also the most flexible in terms of reading,
writing, and modifying it’s contents.
 Internal RAM is volatile, so when the 8051 is reset this memory is cleared.

On chip ROM:
 In 8051, 4KB read only memory (ROM) is available for program storage.
 This is used for permanent data storage. Or the data which is not changed during the
processing like the program or algorithm for specific applications.
 This is volatile memory; the data saved in this memory does not disappear after power
failure. We can interface up to 64KB ROM memory externally if the application is large.

SPECIAL FUNCTION REGISTERS (SFRs):


 In 8051 microcontroller there certain registers which uses the RAM addresses from 80h
to FFh and they are meant for certain specific operations.
 These registers are called Special function registers (SFRs).
 Some of these registers are bit addressable also.
 The list of SFRs and their functional names are given below.
 In these SFRs some of them are related to I/O ports (P0, P1, P2 and P3) and some of
them are meant for control operations (TCON, SCON, PCON) and remaining are the
auxiliary SFRs, in the sense that they don't directly configure the 8051.

Oscillator: It is used for providing the clock to MC8051 which decides the speed or baud rate of
MC. We use crystal which frequency varies from 4MHz to 30 MHz, normally we use 11.0592
MHz frequency.

The salient features of 8051Microcontroller are:


❖ 4 KB on chip program memory (ROM or EPROM).
❖ 128 bytes on chip data memory (RAM).
❖ 8-bit data bus
❖ 16-bit address bus
❖ 32 general purpose registers each of 8 bits
❖ Two -16 bit timers T0 and T1
❖ Five Interrupts (3 internal and 2 external).
❖ Four Parallel ports each of 8-bits (PORT0, PORT1, PORT2, PORT3) with a total of 32 I/O
lines.
❖ One 16-bit program counter and One 16-bit DPTR (data pointer)
❖ One 8-bit stack pointer
❖ One Microsecond instruction cycle with 12 MHz Crystal.
❖ One full duplex serial communication port.

You might also like