Evolution Of Microprocessors

Used As a CPU of a computer • 8088 • 80x86 • Pentium Used In Control Application 8086 Z 80 MC 6800 Intel 8051 AVR PIC Dallas series Phillips

• • • • • • • •

Microcontroller & Microprocessor
Memory I/O Timer Serial I/O CPU

I/O External *ADC I/O *PWM

Memory Timer CPU *WDT
Serial I/O

External Memory
2

Microcontroller It is a highly integrated device which includes, on one chip, all or most of the parts needed to perform an application control function.

Microcontroller based System  Compact Low Cost Minimum component count Low power requirement Built in functions and memory

Choosing a microcontroller• Speed •Width of data to be processed •Power Consumption • On chip Memory •No of I/O pins and Timers on chip •Availability of development tools •Availability of Microcontroller ICs • Additional features available

Microcontroller Applications:
Television Telephone Copiers Elevators

Body controller of Automobile Irons Remote control Cellular phone

Different parts of PC(printer,modem,disk controller keyboard ) Security system

Home appliances (Microwave oven , Washing machine) Environment control (green house, factory) Digital diary Vending machines

8 – Bit Microcontrollers
• Motorola’s 6811 •Intel’s 8051 •Zilog’s Z8 •Microchip Technology’s PIC 16X

Companies producing Member of 8051 family
Intel Atmel Philips Siemens Dallas Semiconductor AMD

Microcontroller Block Diagram -

Features of 8031 Architecture
• Optimized 8 bit CPU for control applications •Extensive Boolean processing capabilities. •8 bit and 16 bit registers. • 64 K program memory address space • 64 K Data memory address space •128 bytes of on chip data memory •32 bi-directional and individually addressable I/O lines • Two 16-bit timers/counters •Full Duplex UART, programmable in 4 modes 8-bit UART , 9-bit UART , Inter-processor communication link, shift register I/O expander •5 vector interrupts structure with priority levels •On chip clock oscillator

Inside Microcontroller
Ex.INT Interrupt RO M RAM
Timer I/P

Timer/Counter

CPU
OSC Bus Contr ol 4 I/O Ports Serial Port

P0-P3

8051 Block Diagram
ALU A B
PSW

SFR & RAM
8 Bit Data & Add. Bus

I/O

L L

P0

A0-7 D0-7

P 1

I/O

ROM PC DPTR
16- Bit Address Bus EA ALE PSEN XTAL1 XTAL2 RESET

L

P2

I/O A8-15 I/O

L

P3

INT. Counter S.Data

System Timing Interrupts Data Buffers Memory Control

L- Latch

8051 Programming Model
A

E0 7F

B F0

IP

B8

IE

A8

TMOD 89 TH1 8D

TCON 88

FFF

General purpose 30 Area 2F Bit Address 20 Area R.Bank 3 R.Bank 2 R.Bank 1 Registe r 00 Bank 0 R0-R7

TH0 8C SCON 98

TL0 8A

TL1 8B PSW D0

ROM

SBUF 99 S P 8 1

PCON 87

DPTR DPH DPL 83 82

PC

Port 0 80

Port 1 90

Port 2 A0

Port 3 B0

000

* Bit addressable

Versions of 8051 from ATMEL
PART NO RAM ROM I/O
4KB 4KB 1KB 2KB 8KB 8KB 32 3 2 1 5 1 5 3 2 3 2

AT89C5 128 1 AT89LV51 12 8 AT89C1051 64 AT89C2051 128 AT89C52 128

TIMER INTERRUPT. VC C V 2 6 5
2 1 2 3 3 6 3 6 8 8 3 3 3 5 3
12

AT89LV52 128

OVERVIEW OF 8051 FAMILY
OVERVIEW OF 8051 FAMILY

µC
8031

RAM
128 Bytes 128 Byte s 128 Bytes

ROM
NIL

Other features
2 Timers, 1 Serial port, 6 Interrupt sources Same as above

8051 8751

4 KB 4 KB
EPROM

Same as above

8051 Pin Assignments
Vcc AD0 AD7 40 39 22 21 AD1 AD2 AD3 AD4 AD5 AD6 38 37 36 35 34 33 Vp p 32 Prog 31 A8---A15

EA ALE P0.0 -- P0.7 P3.0 --P3.7

30 29 28 27 26 25 24 23 ____
PSEN

P2.0 ----2.7

P1.0 - P1.7 1 2 3 4 5 6 78 19 20 Port 1 Bit 0-7

RST 9 10 11
_____

12
____ INT1

13

14

15 __
WR

16

17

18 Vss XTAL1

Reset

RXD

INT0

TXD

T0

T1

__ RD

XTAL2

Input - Output Pins, Ports
1. 2. 3. 4.
8051 Interact with outside world with I/O ports Each port has a D-type output latch for each pin. Data on the latches is not same as that on the pins

Separate data paths are used to read the latch or pin data 5.Different opcodes access the latch or pin states as appropriate. at ports are TTL Levels. Voltages But currents are IIL=10 µA IoL = 1.6 mA IIH = 10 µA IOH = -60 µA 6.Normally ports are buffered when interfaced to external device.

7.All ports can be used as input / output, To use port as
input , ‘1’ must be written to corresponding port.

PIN DESCRIPTION OF THE 8051
Pin no 1 to 8 : port 1 It can be used as i/o no external pull up resistors are required. Pin no 9 : Reset : I/P active high. Upon applying high pulse to this pin for two machine cycles 8051 will reset and terminate all activities Pin no 10 - pin no 17 are duel functions It is used as Bidirectional I/O port

PIN DESCRIPTION ….

Pin no 18 19 : this pins are provided to connecting a crystal to form an oscillator To use frequency source other than crys.osc.it is connected XTAL1 with XTAL2 open Maximum Crystal frequency is 16 MHz

PIN DESCRIPTION ….

Pin 20 : Ground pin Pin 21 to 28 : Port 2 it is used as I/O port alternate use as high order address bus when external memory is interfaced to 8051 Pin 29 : PSEN : It is O/P pin it is connected to OE pin of ROM Pin no. 30 : ALE / PROG : It is an O/P pin it is used for demultiplex address and data bus it is I/P during flash programming. Pin 31 : EA/VPP : 8051 family members such as 8751 89c51 come with on chip ROM in such a cases EA pin is connected to VCC. VPP : It is connected to 12 V during flash programming. Pin 32 to Pin 39 Port 0 : It is a I/O port it can be used as bi-directional low order address and data bus for external

8051 Timings
All internal operations of 8051 are in synchronous with clock. A Quartz crystal generates a basic internal clock frequency of microcontroller. Typically 1 MHz to 12 MHz clock frequencies are used. Frequency of serial communication decides the particular clock frequency to be used.. The machine cycle made up of 6 T states. Two oscillator pulses define each T state.
One machine cycle requires 12 clock periods. Time required to execute any instruction: Tinst=(12 C)/(Crystal Freq.)

• Machine Cycle: The smallest interval of time to accomplish any simple instruction. T State: Basic time interval for discrete operations of microcontroller.

20

Program Memory
ROM – Used to store program, least expensive for high volume manufacturing. Eg. 8051 ( 4K ROM) EPROM- Used to store program.Special programmer is needed for programming. It takes time for erasing. Eg 8751 ( 4K EPROM) Flash – Electrically erasable and programmable memory. It can have 100 – 1000 program/erase cycles. Eg 89C51 (4K) 89c52 (8K)

CPU Registers
Accumulator : 8 bit register hold results of many instructions. Most versatile register. It is also used in data transfers between 8051 and any external memory.

B Register: It is 8 bit register used with A register for multiplication and division operations. It can be used as general purpose register

Byte Address 1F BANK 3 R0--R7 18 17 BANK 2 10 0F BANK 1 R0--R7 08 R0--R7

Byte Address Bit Address 2F 7F

Internal RAM Organization
Byte Address 7F 78

07 BANK 0 R0 -- R7 00 Working Registers 20 07 00 Bit Addressable 30 General purpose

Program Status Word
CY AC F0 RS1 RS0 OV P

Select Reg. Bank

User flag 0

TCON
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

Ext Int 1 edge Timer 1 run control flag bit Timer 1 overflow flag Ext Int 0 signal type control bit 1- edge trigger 0- level trigger

TMOD
Timer 1 Timer 0

Gate C or /T M1 M0

Gate C or /T M1 M0

Mode of timer 1 –Counter 0- Timer OR gate enable bit
Osc Freq. /12 C or /T =0

T1/0 pin TR1/0 bit in TCON

C or /T =1

To Timer

Gate Bit /INT 1 or 0

SCON(Serial Port Control)
SM0 SM1 SM2 REN TB8 RB8 TI RI

Transmitted bit 8 Serial port mode bits Receive enable bit Transmit interrupt flag

Multiprocessor communication bit. Receive interrupt flag

PCON (Power Mode Control)
SM0D GF1 GF0 PD IDL

Serial baud rate modify bit

Gen. Purpose User Flag Power down bit

Idle mode bit

IE (Intrrupt enable SFR)
EA ES ET1 EX1 ET0 EX0

Interrupt enable bit Enable Timer 1 OF int. Enable serial port interrupt Enable Ext. Int 0

IP (Intrrupt Priority SFR)
PS PT1 PX1 PT0 PX0

Priority of Timer 1 OF int. Priority of serial port interrupt Priority of Ext. Int 0

1- from Serial port when data transmission and reception operation is executed. 2– from timers , when overflow occurs 2- from two input pins INT0, INT1 Each interrupt can be independently enabled and priority will be given using IE and IP register. Interrupt service routine starting address External 0 Timer/Counter 0 External 1 Timer/Counter 1 Serial port 0003h 000Bh 0013h 001Bh 0023h
31

Sign up to vote on this title
UsefulNot useful