Chapter 01

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

Thursday, August 29, 2019 www.iiu.edu.

pk 1
 Text Books
 Digital Electronics, Malvino, Brown (Chapter 10)
 8051 Microcontroller and Embedded Systems, Ali Mazidi
2nd edition.
 Lecture notes:
 vle.iiu.edu.pk
 Course Outline
 Assembly Language Prog.
 Timer/Counter
 Interrupts
 Real-world Interfacing

Thursday, August 29, 2019 www.iiu.edu.pk 2


Thursday, August 29, 2019 www.iiu.edu.pk 3
 Microprocessor = CPU on a single chip.
 ALU + registers + control +…
 uP contains no RAM, no ROM, and no I/O ports on the
chip itself.
 Microcontroller (uC)
 A microcontroller has a CPU (a microprocessor) in addition
to a fixed amount of RAM, ROM, I/O ports, and a timer all
on a single chip.

Thursday, August 29, 2019 www.iiu.edu.pk 4


 Use a microprocessor or microcontroller to do one
task only e.g. Printer
 PC is used for any number of applications e.g. Word
processor, print-server, bank teller terminal, video
game player, network server, internet terminal.
 A PC contains or is connected to various embedded
products. e.g. Keyboard, printer, modem, disk
controller, sound card, CD-ROM driver, mouse.
 For example, inside every mouse there is a
microcontroller to perform the task of finding the
mouse position and sending it to the PC.

Thursday, August 29, 2019 www.iiu.edu.pk 5


 Home: microwave, intercom, telephones, security
systems, garage door openers, answering machines,
fax machines, home computers, TVs, cable TV tuner,
VCR, camcorder, remote controls, video games,
cellular phones, musical instruments, sewing
machines, lighting control, paging, camera, pinball
machines, toys, exercise equipment
 Office: Telephones, computers, security systems, fax
machines, copier, laser printer, color printer, paging.
 Auto: Trip computer, engine control, air bag, ABS,
instrumentation, security system, transmission
control, climate control, cellular phone, keyless entry.
Thursday, August 29, 2019 www.iiu.edu.pk 6
 What is the highest speed that the uC supports?
 Does it come in 40-pin DIP (dual inline package) or a
QFP (quad flat package), or some other packaging
format? This is important in terms of space,
assembling, and prototyping the end product.
 Power Consumption is especially critical for battery-
powered products
 The amount of RAM and ROM on chip.
 The number of I/O pins and the timer on the chip.
 How easy it is to upgrade to higher-performance or
lower power-consumption versions.
Thursday, August 29, 2019 www.iiu.edu.pk 7
 Cost Per Unit. This is important in terms of the final
cost of the product in which a microcontroller is
used.
 The availability of an assembler, debugger, a code-
efficient C language compiler, Simulator and
technical support on web.
 Availability at College Road, Rawalpindi

Thursday, August 29, 2019 www.iiu.edu.pk 8


MLF (Micro Lead frame Package) PDIP (Plastic Dual Inline Package )

Holder PLCC ( Plastic leadless Chip Carrier ) TQFP (Thin Plastic


Quad Flat Package )
Thursday, August 29, 2019 www.iiu.edu.pk 9
 In 1981, Intel Corporation introduced
an 8-bit microcontroller called the 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.
 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-bit
pieces to be processed by the CPU.
 The 8051 has a total of four I/O ports, each 8 bits
wide.
Thursday, August 29, 2019 www.iiu.edu.pk 10
 Although the 8051 can have a maximum of 64K bytes
of on-chip ROM, many manufacturers have put only
4K bytes on the chip.
 The 8051 became widely popular after Intel allowed
other manufacturers to make and market any flavors
of the 8051 they please with the condition that they
remain code-compatible with the 8051.
 This has led to many versions of the 8051 with
different speeds and amounts of on-chip ROM
marketed by more than half a dozen manufacturers.

Thursday, August 29, 2019 www.iiu.edu.pk 11


External Interrupts

Timer 0
Interrupt 4k 128 bytes
Control ROM RAM Timer 1

CPU

OSC Bus Serial


4 I/O Ports
Control Port

P0 P2 P1 P3 TXD RXD
Addr/Data

Thursday, August 29, 2019 www.iiu.edu.pk 12


PSEN’ - use external Program memory ALE – Address/Data multiplexing
EA’ – 5V for internal ROM, 0V for external ROM
 Table 1-2: Some Companies Producing a Member
of the 8051 Family

Company Web Site


Intel www.intel.com/design/mcs51
Atmel www.atmel.com
Philips/Signetics www.semiconductors.philips.com
Siemens www.sci.siemens.com
Dallas Semiconductor www.dalsemi.com

Thursday, August 29, 2019 www.iiu.edu.pk 14


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

Thursday, August 29, 2019 www.iiu.edu.pk 15


 This chip is often referred to as a ROM-less 8051
since it has 0K bytes of on-chip ROM.
 To use this chip you must add external ROM to it.
 This external ROM must contain the program that
the 8031 will fetch and execute.
 The ROM containing the program attached to the
8031 can be as large as 64K bytes.
 In the process of adding external ROM to the 8031,
you lose two ports.
 To solve this problem, you can add external I/O
(using 8255) to the 8031.

Thursday, August 29, 2019 www.iiu.edu.pk 16


 Table 1-4:Comparison of 8051 Family Members

Feature 8051 8052 8031


ROM (on chip program space in bytes) 4K 8k 0k

RAM (bytes) 128 256 128

Timers 2 3 2

I/O pins 32 32 32

Serial port 1 1 1

Interrupt sources 6 8 6

Thursday, August 29, 2019 www.iiu.edu.pk 17


 Make ROM (cheap if large quantity)
 Problem: you cannot change the program!
 Make writable ROM
 PROM: (P=programmable) write-once
 EEPROM: electrically erasable PROM
 UV-EPROM: erasable w/ultraviolet(UV) light
 Flash: a type of EEPROM
 NV-RAM: non-volatile RAM

Thursday, August 29, 2019 www.iiu.edu.pk 18


 The 8051 is available in different memory types, such
as UV-EPROM, flash, and NV-RAM, all of which
have different part numbers.
 The UV-EPROM version of the 8051 is the 8751.
 The flash ROM version is marketed by many
companies including Atmel, Dallas Semiconductor.
 The Atmel Flash 8051 is called AT89C51, while
Dallas Semiconductor calls theirs DS89C4xO
(DS89C420/430/440).
 There is also an OTP (one-time programmable)
version of the 8051 made by various manufacturers.

Thursday, August 29, 2019 www.iiu.edu.pk 19


 Another popular version of the 8051 is the DS5000 chip
from Dallas Semiconductor.
 The on-chip ROM for the DS5000 is in the form of NV-
RAM. The read/write capability of NV-RAM allows the
program to be loaded into the on-chip ROM while it is in
the system.
 This can be done even via the serial port of an IBM PC.
This in-system program loading of DS5000 via a PC serial
port makes it an ideal home development system.
 Another advantage of NV-RAM is the ability to change
the ROM contents one byte at a time. Contrast this with
UV-EPROM and flash memory in which the entire ROM
must be erased before it is programmed again.

Thursday, August 29, 2019 www.iiu.edu.pk 20


Part No. ROM RAM I/O Timer Interrupt Vcc Clock Other
Pins
AT89C55 20K 256 32 3 8 5V 33 Watch Dog Timer

AT89S8253 12K 256 32 3 9 3-5 24 WDT, ISP, SPI,


2K EEPROM
AT89S53 12K 256 32 3 9 5V 33 ISP, SPI, WDT

AT89C52 8K 256 32 3 8 5V 24 ---


AT89S52 8K 256 32 3 8 5V 33 ISP, WDT

AT89S51 4K 128 32 2 6 5V 33 ISP, WDT

AT89C51 4K 128 32 2 6 5V 24 ---


AT89C2051 2K 128 15 2 6 3-6 24 Analog Comp.

AT89C1051 1K 64 15 1 3 3-6 24 Analog Comp.

Notice AT89C51-12PC where "C" before the 51 is for CMOS, which has a low
power consumption, "12" indicates 12 MHz, "P" is for plastic DIP package,
and "C" is for commercial (vs. "M" for military)

Thursday, August 29, 2019 www.iiu.edu.pk 21


Thursday, August 29, 2019 www.iiu.edu.pk 22

You might also like