Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
94 views

8051 Microcontroller Data

The document discusses the 8051 microcontroller family. It provides details on: 1) The 8051, 8052, and 8031 microcontrollers which make up the original 8051 family from Intel, comparing their features such as RAM, ROM, timers, and I/O pins. 2) Popular 8051 microcontrollers from other manufacturers like the AT89C51 from Atmel (flash memory), DS5000 from Dallas Semiconductor (NV-RAM memory), and one-time programmable versions from various makers. 3) The main features of the 8051 microcontroller architecture including RAM, ROM, serial port, timers, I/O pins, and interrupts on a single chip

Uploaded by

Techqualcer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

8051 Microcontroller Data

The document discusses the 8051 microcontroller family. It provides details on: 1) The 8051, 8052, and 8031 microcontrollers which make up the original 8051 family from Intel, comparing their features such as RAM, ROM, timers, and I/O pins. 2) Popular 8051 microcontrollers from other manufacturers like the AT89C51 from Atmel (flash memory), DS5000 from Dallas Semiconductor (NV-RAM memory), and one-time programmable versions from various makers. 3) The main features of the 8051 microcontroller architecture including RAM, ROM, serial port, timers, I/O pins, and interrupts on a single chip

Uploaded by

Techqualcer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Theory type 1:-

8051 and 8051 Microcontroller


A microcontroller is an economical computer-on-a-chip built for dealing with specific tasks, such
as displaying or receiving information through LEDs or remote controlled devices. The most
commonly used set of microcontrollers belong to 8051 Family. 8051 Microcontrollers continue
to remain a preferred choice for a vast community of hobbyists and professionals.
Through 8051, the world became witness to the most revolutionary set of microcontrollers.
 

8051 Family
Intel fabricated the original 8051which is known as MCS-51. The other two members of the
8051 family are:
i.     8052 – This microcontroller has 256 bytes of RAM and 3 timers. In addition to the standard
features of 8051, this microcontroller has an added 128 bytes of RAM and timer. It has 8K bytes
of on chip program ROM. The programs written for projects using 8051 microcontroller can be
used to run on the projects using 8052 microcontroller as 8051 is a subset of 8052.
 
ii.    8031 – This microcontroller has all the features of 8051 except for it to be ROM-less.  An
external ROM that can be as large as 64 K bytes should be programmed and added to this chip
for execution. The disadvantage of adding external ROM is that 2 ports (out of the 4 ports) are
used. Hence, only 2 ports are left for I/O operations which can also be added externally if
required for execution.
 
Comparison of 8051 family members:

Features 8051 8052  8031 


RAM(bytes) 128 256 128
ROM 4K 8K 0K
Timers 2 3 2
Serial port 1 1 1
I/O pins 32 32 32
Interrupt sources 6 8 6
Table – 1.1 Comparison of 8051 family members

Various 8051 microcontrollers

8051 microcontrollers use two different kinds of memory such as UV- EPROM, Flash and NV-
RAM. Hence 8051 will not be seen in the part number even though it is the most popular
member of the 8051 family.
        i.            8751 – This microcontroller is the UV-EPROM version of 8051. This chip has only 4K

bytes of UV-EPROM. It is required to have access to the PROM burner and the UV-EPROM
eraser to erase the contents inside the chip before it is programmed again. The disadvantage of
using this memory is the waiting time of around 20 minutes to erase the contents in order to
program it again. Due to this limitation, manufacturers fabricated flash and NV-RAM versions of
8051.
 
      ii.            AT89C51 from Atmel Corporation – Atmel fabricated the flash ROM version of 8051

which is popularly known as AT89C51 (‘C’ in the part number indicates CMOS). The flash
memory can erase the contents within seconds which is best for fast growth. Therefore, 8751 is
replaced by AT89C51 to eradicate the waiting time required to erase the contents and hence
expedite the development time. To build up a microcontroller based system using AT89C51, it is
essential to have ROM burner that supports flash memory. Note that in Flash memory, entire
contents must be erased to program it again. The contents are erased by the ROM burner.
Atmel is working on a newer version of AT89C51 that can be programmed using the serial COM
port of IBM PC in order to get rid of the ROM burner.
            
Part
ROM  RAM I/O pins  Timer  Interrupt Vcc Packaging 
Number
AT89C51 4K 128 32 2 6 5V 40
AT89C52 8K 256 32 3 8 5V 40
AT89C105
1K 64 15 1 3 3V 20
1
AT89C205
2K 128 32 3 8 3V 20
1
AT89LV51 4K 128 32 2 6 3V 40
AT89LV52 8K 128 32 3 8 3V 40
Table 1.2 – Versions of 8951 from Atmel (All ROM Flash)
 
There are different versions of packaging and various speed of the products mentioned in the
above table.

Part Number Speed  Pins  Packaging  Use 


AT89C51-12PC 12MHz 40 DIP Plastic Commercial
AT89C51-16PC 16MHz 40 DIP Plastic Commercial
AT89C51-20PC 20MHz 40 DIP Plastic Commercial
Table 1.3 – Various Speeds of 8051 from Atmel
 

Note: The part number AT89C51-16PC where AT – Atmel, C - CMOS (consumes less power),
12 - Speed as 12 MHz, P – Plastic DIP packaging, C - Commercial use. AT89C51-12PC is
favourably used by students for their projects.
 
iii.   DS5000 from Dallas Semiconductor – Dallas Semiconductor fabricated the NV-RAM version
of the 8051 which is known as DS5000. The PC serial port is utilized to load the program onto
the in-built ROM. The advantage of NV-RAM memory is the facility to erase the contents one
byte at a time.
      v.             

Part
RAM ROM Timers I/O pins Interrupts Vcc Packaging 
Number
DS5000-8 128 8K 2 32 6 5V 40
DS5000-
128 32K 2 32 6 5V 40
32
DS5000T-
128 8K 2 32 6 5V 40
8
DS5000T-
128 32K 2 32 6 5V 40
8
Table 1.4 – Versions of 8051 from Dallas Semiconductor
 

Note: ‘T’ signifies the real time clock (RTC) which is different from the timer. Even though
the power is turned off, the real – time clock generates and displays the date and the time
of day.
 
The variety range of speed and packaging versions of DS5000 which is shown in the Table 1.5

Part Number NV-RAM  Speed 


DS5000-8-8 8K 8MHz
DS5000-8-12 8K 12MHz
DS5000-32-8 32K 8MHz
DS5000-32-12 32K 12MHz
DS5000T-8-12 8K 12MHz
DS5000T-32-8 32K 8MHz
Table 1.5 – Versions of 8051 Dallas Semiconductor
 

Note: The part number DS5000-8-8 where 8 - 8K NV-RAM, 8 – Speed of 8MHz. DS5000-8-12


is favourably used by students for their projects.
 
iv.    One - Time - Programmable (OTP) versions of the 8051 – This version of microcontroller is
cheaper and available from various manufacturers. The manufacturers use OTP microcontroller
for mass production because the price per unit is very cheap.

Features of 8051
 
The main features of 8051 microcontroller are:
        i.            RAM – 128 Bytes (Data memory)

      ii.            ROM – 4Kbytes (ROM signify the on – chip program space)

    iii.            Serial Port – Using UART makes it simpler to interface for serial communication.

    iv.            Two 16 bit Timer/ Counter

      v.            Input/output Pins – 4 Ports of 8 bits each on a single chip.

    vi.            6 Interrupt Sources

 vii.            8 – bit ALU (Arithmetic Logic Unit)


viii.            Harvard Memory Architecture – It has 16 bit Address bus (each of RAM and ROM) and 8
bit Data Bus.
    ix.            8051 can execute 1 million one-cycle instructions per second with a clock frequency of

12MHz.
This microcontroller is also called as “System on a chip” because it has all the features on a
single chip. The Block Diagram of 8051 Microcontroller is as shown in Figure 1.1

Figure 1.1 Block Diagram of 8051 Microcontroller


 
 
Memory Architecture
The 4 discrete types of memory in 8051 are:
        i.            Internal RAM – This memory is located from address 0 to 0xff.  The memory locations

from 0x00 to 0x7F are accessed directly. The bytes from 0x20 to 0x2F are bit-addressable.
Loading R0 and R1 the memory location from 0x80 to 0xFF can easily accessed.
      ii.             Special Function Registers (SFR) – Located from address 0x80 to 0xFF of the memory
location. The same instructions used for lower half of Internal RAM can be used to access SFR’s.
The SFR’s are bit addressable too.
    iii.            Program Memory – This is read only memory which is located at address 0. With the

help of 16 bit Special Function Register DPTR, this memory can also save the tables of
constants.
    iv.            External Data Memory – Located at address 0. The Instruction MOVX (Move External)

should be used to access the external data memory.


History of 8051 and Key Developments
Intel Corporation fabricated the 8 – bit microcontroller which was referred as MCS-51 in
1981. 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.
 
Intel permitted other manufacturers to fabricate different versions of 8051 but with the
limitation that code compatibility should be maintained. This has added advantage that if the
program is written then it can be used for any version of 8051 despite of manufacturer.
 
As years passed by, the quality of technology surpassed the expectation of the greatest minds,
with gadgets becoming smaller, sleeker and more efficient. Microcontrollers were seen as the
answer to the requirements raised in advanced electronics. This is the reason why
manufacturers have now focused their production around the following main developmental
aspects:
i.                    Ease-of-use
ii.                  Market availability
iii.                Less power usage
iv.                Smaller processing power
v.                  More integrated features like RF and USB
vi.                Smaller form factors
Applications
The 8051 has been in use in a wide number of devices, mainly because it is easy to integrate
into a project or build a device around. The following are the main areas of focus:
i.             Energy Management:Efficient metering systems help in controlling energy usage in homes and
industrial applications. These metering systems are made capable by incorporating
microcontrollers.
 
ii.           Touch screens:A high number of microcontroller providers incorporate touch-sensing
capabilities in their designs. Portable electronics such as cell phones, media players and gaming
devices are examples of microcontroller-based touch screens.
 
iii.         Automobiles: The 8051 finds wide acceptance in providing automobile solutions. They are
widely used in hybrid vehicles to manage engine variants. Additionally, functions such as cruise
control and anti-brake system have been made more efficient with the use of microcontrollers.
 
iv.         Medical Devices:Portable medical devices such as blood pressure and glucose monitors use
microcontrollers will to display data, thus providing higher reliability in providing medical
results.
          
Programming environment and programmer
Formerly, programmers used machine language for coding. A machine language is a program
that consists of 0s and 1s which was very dreary for the humans
to 
program any computer. In due course of time, assembly language was developed in order to
speed up the programming and make it error-free.  Assembly language is a low level language
which uses an assembler to translate the program into machine code. The high level
programming languages such as BASIC, Pascal, Forth, C, C++, and Java are available to code the
program for 8051. These high level languages make use of a Compiler to translate into machine
code. For example, when a program is written in C, the program needs to be translated into
machine language using C compiler. Usually, Assembly and C language is widely used for 8051
programs as compared to the other high level languages.
 
The 8051 provides a total of four ports for I/O operations. 8051 has 40 pins, of which 32 pins
are set aside for the four ports. PO, P1, P2, and P3 each have 8 pins and can be used for either
input or output. The remaining pins are designated as V rt, GND, XTAL1, XTAL2, RST, EA,
ALE/PROG and PSEN.
 
8051 allows you to manipulate one or all of the bits of a port, thus providing programmers with
a unique and powerful feature. 8051 provides the programmer with the ability to read, write
and modify each port to customize applications as much as possible.

Theory type 2:-

Microcontroler 8051

4.2.1 Introduction

In 1981,Intel Corporation introduced an 8-bit microcontroller called 8051.This microcontroller


had 128 bytes of RAM,4K bytes of on-chip ROM, two timers, one serial port and four ports(each
8-bits wide) all on a single chip. At that time it was also referred to as a “system on a chip”. The
8051 is an 8-bit processor meaning that the CPU can work on only 8-bits of data at a time. Data
larger than 8 bits has to be broken into 8 bits pieces to be processed by the CPU. The 8051 has
a total of four I/O ports, each 8 bits wide. The 8051 can have a maximum of 64K bytes of on-
chip ROM.

4.2.2 Features of 8051

 It provides many functions (CPU, RAM, ROM, I/O, interrupt logic, timer, etc.) in single
package
 8-bit ALU, Accumulator and Registers; hence it is an 8-bit microcontroller
 8-bit data bus - It can access 8 bits of data in one operation
 16-bit address bus - It can access 216 memory locations - 64 kB (65536 locations) each of
RAM and ROM
 On-chip RAM - 128 bytes (data memory)
 On-chip ROM - 4 kB (program memory)
 Four byte bi-directional input/output port
 UART (serial port)
 Two 16-bit Counter/timers
 Two-level interrupt priority.

4.2.3 Members of 8051 Family

There are two other members in the 8051 family of microcontrollers. They are 8052 and 8031.

8052 Microcontroller

The 8052 is another member of 8051 family. The 8052 has all the standard features of 8051 as
well as an extra 128 bytes of RAM and an extra timer. In other words, the 8052 has 256 bytes of
RAM and 3 timers. It also has 8K bytes of on-chip program ROM instead of 4K bytes.

8031 Microcontroller

Another member of 8051 family is the 8031 chip. This chip is often referred to as a ROM-less
8051 since it has 0K bytes of on-chip ROM. To use this chip external ROM is added to it. The
ROM containing the program attached to the 8031 can be as large as 64K bytes. In the process
of adding external ROM containing the program attached to the 8031, two ports are lost. This
leaves only 2 ports for I/O operations. To solve this problem, we can add external I/O to the
8031 by interfacing the 8031 with memory and I/O ports such as 8255 chip.

4.2.4 Comaprison of 8051 Family Members

Table 4.1: 8051 Family Members

FEATURE 8051 8052 8031

ROM 4K 8K 0K

RAM 128 256 128

TIMERS 2 3 2

I/O PINS 32 32 32

SEARIAL PORT 1 1 1

INTERRUPT SOURCES 6 8 6

4.2.5 Block Diagram


Figure 4.1 Block Diagram

Figure shows the block diagram of a typical microcontroller, which is a true

computer on a chip. The design incorporates all of the features found in

micro processor CPU: ALU, PC, SP, and registers. It also added the other

features needed to make a complete computer: ROM, RAM, parallel I/O,

serial I/O, counters, and clock circuit.

4.2.6 Pin Description


Figure 4.2 Pin Diagram

(i)Vcc

Pin 40 provides supply voltage to the chip. The voltage source is +5V.

(ii)GND

Pin 20 is the ground.

(iii)XTAL1 and XTAL2

The 8051 has an on-chip oscillator but requires an external clock to run it. Most often a quartz
crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin 18).The quartz crystal
oscillator connected to XTAL1 and XTAL2 also needs two capacitors of 30pF value. One side of
each capacitor is connected to the ground. There are various speeds of 8051 family. Speed
refers to the maximum oscillator frequency connected to XTAL.

Figure 4.3 Oscillator connections

(iv)RST
Pin 9 is the RESET pin. It is an input and is active high (normally low).Upon applying a high pulse
to this pin, the microcontroller will reset and terminate all activities. This is often referred to as
a power-on reset. Activating a power-on reset will cause all values in the registers to be lost. It
will set program counter to all 0s.

In order for reset input to be effective, it must have a minimum duration of two machine cycles.
In other words, the high pulse must be high for a minimum of two machine cycles before to go
low.

(iv)EA
The 8051 family members such as 8751/52, 89C51/52 all come with on-chip ROM to store
programs. In such cases the this pin is connected to Vcc. For family members such as 8031 and
8052 in which there is no on-chip ROM, code is stored on an external ROM

and is fetched by the 8051/52.Therefore, for 8051 the EA pin must be connected to GND to
indicate that the code is stored externally. EA which stands for “external access” is pin number
31 in the DIP packages. It is an input pin and must be connected to either Vcc or GND. This pin
cannot be left unconnected.

(v)PSEN

This pin is an output pin. PSEN stands for “program store enable”. In an 8051 based system in
which an external ROM holds the program code, this pin is connected to the OE pin of the ROM.

(vi) ALE

ALE (address latch enable) is an output pin and is active high. When connecting an 8051 to
external memory, port 0 provides both address and data. In other words, the 8051 multiplexes
address and data through port 0 to save pins. The ALE pin is used for demultiplexing the
address and data by connecting to the G pin of the 74LS373 chip.

(vii) I/O PORT PINS

The four ports P0, P1, P2, P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET
are configured as inputs, ready to be used as input ports. When the first 0 is written to a port, it
becomes an output. To reconfigure it as an input, a 1 must be sent to the port. To use any of
these ports as an input port, it must be programmed.

(vii)PORT 0

Port 0 occupies a total of 8 pins (pins32-39).It can be used for an input or output. To use the
pins of port 0 as both input and output ports, each pin must be connected externally to a 10K-
ohm pull-up resistor. Port 0 is also designated as AD0-AD7, allowing it to be used for both
address and data. When connecting an 8051 to an external memory, port 0 provides both
address and data. The 8051 multiplexes address and data through port 0 to save pins. ALE
indicates if P0 has address or data. When ALE=0,it provides data D0-D7 but when ALE=1 it has
address A0-A7.

(viii)PORT1
Port 1 occupies a total of 8 pins (pins 1 through 8).It can be used as input or output. In contrast
to port 0, this port does not need any pull-up resistors since it already has pull up resistors.
Upon reset, port1 is configured as an input port. If port 1 has been configured as an output
port, to make it an input port again, it must be programmed as such by writing 1 to all its bits.

(ix)PORT2
Port 2 occupies a total of 8 pins (pins 21 through 28).It can be used as an input or output. Just
like P1.port 2 does not need any pull up resistors since it already has pull up resistors internally.
Upon reset port 2 is configured as an input port. To make port 2 as an input, it must be
programmed as such by writing 1 to all its bits.

(x)Dual role of port 2

In many 8051 systems, P2 is used as simple I/O. But in 8051-based systems, port 2 must be used
along with P0 to provide the 16-bit address for external memory. Port 2 is also designated as
A8-A15, indicating its dual function.

(xi)PORT 3

Port 3 occupies a total of 8 pins, pins 10 through 17.It can be used as input or oputput.P3 does
not need any pull up resistors, just like P1 and P2 did not. Although port 3 is configured as an
input port upon reset, this is not the way it is most commonly used. Port 3 has the additional
function of providing some extremely important signals such as interrupts. Port 3 has an
additional function of providing some extremely important signals such as interrupts. Some of
the alternate functions of P3 are listed below:

P3.0 RXD (Serial input)


P3.1 TXD (Serial output)
P3.2 INT0 (External interrupt 0)
P3.3 INT1 (External interrupt 1)
P3.4 T0 (Timer 0 external input)
P3.5 T1 (Timer 1 external input)
P3.6 WR (External memory write strobe)
P3.7 RD (External memory read strobe).

4.2.7 Memory Space Allocation

1. Internal ROM
The 89C51 has 4K bytes of on-chip ROM. This 4K bytes ROM memory has memory addresses of
0000 to 0FFFh. Program addresses higher than 0FFFh, which exceed the internal ROM capacity,
will cause the microcontroller to automatically fetch code bytes from external memory. Code
bytes can also be fetched exclusively from an external memory, addresses 0000h to FFFFh, by
connecting the external access pin to ground. The program counter doesn’t care where the
code is: the circuit designer decides whether the code is found totally in internal ROM, totally in
external ROM or in a combination of internal and external ROM.
2. Internal RAM
The 128 bytes of RAM inside the 8051 are assigned addresses 00 to 7Fh. These 128 bytes can be
divided into three different groups as follows:
 A total of 32 bytes from locations 00 to 1Fh are set aside for register banks and the
stack.
 A total of 16 bytes from locations 20h to 2Fh are set aside for bit addressable read/write
memory and instructions.
 A total of 80 bytes from locations 30h to 7Fh are used for read and write storage, or
what is normally called a scratch pad. These 80 locations of RAM are widely used for the
purpose of storing data and parameters by 8051 programmers.

You might also like