8051 Micro Controller (1)

Post on 07-Apr-2018

239 views 0 download

Transcript of 8051 Micro Controller (1)

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 1/31

Intel’s

8051

Micro controllericro controller

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 2/31

 August 28, 2008 Y.H.Dandawate 2

Basics

What are Micro controller's ? Why the name Micro controller ?

Basically used for control actions.It is used tocontrol the operation of machine using fixedprogram that is stored in ROM/EPROM and that

does not change over the life time. What is MCS 51 ?

Why to study 8051 ?

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 3/31

 August 28, 2008 Y.H.Dandawate 3

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 4/31 August 28, 2008 Y.H.Dandawate 4

Features of 8051

8 bit ALU. 16 bit PC and DPTR.

8 bit stack pointer and 8 bit PSW.

4K internal ROM

128 bytes of Internal RAM.

32 bits arranged as four,8 bit ports P0-P3. Two 16 bit timer/counters, T0 & T1.

Full duplex serial Port.

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 5/31 August 28, 2008 Y.H.Dandawate 5

Features contd…

Control RegistersTCON,TMOD,SCON,PCON,IP,IE etc (SFR’s).

Two External and three internal interrupt

sources. 0-12 MHz clock.

40 pin DIP package. Works in Power Down and Idle mode.

Powerful Instruction set.

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 6/31

Block Diagram of 8051.

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 7/31

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 8/31 August 28, 2008 Y.H.Dandawate 8

Pin Diagram of 8051

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 9/31

 August 28, 2008 Y.H.Dandawate 9

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 10/31

 August 28, 2008 Y.H.Dandawate 10

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 11/31

Internal RAMOrganization

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 12/31

 August 28, 2008 Y.H.Dandawate 12

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 13/31

 August 28, 2008 Y.H.Dandawate 13

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 14/31

 August 28, 2008 Y.H.Dandawate 14

Internal RAM Organization

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 15/31

 August 28, 2008 Y.H.Dandawate 15

Clock for 8051.

Tin = N * 12 / Clk.Freq

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 16/31

 August 28, 2008 Y.H.Dandawate 16

Program Status Word (PSW)

7 6 5 4 3 2 1 0CY AC F0 RS1 RS0 OV --- P

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 17/31

 August 28, 2008 Y.H.Dandawate 17

I/O Ports of 8051-Port 0

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 18/31

 August 28, 2008 Y.H.Dandawate 18

I/O Ports of 8051-Port 1

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 19/31

 August 28, 2008 Y.H.Dandawate 19

I/O Ports of 8051-Port 2

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 20/31

 August 28, 2008 Y.H.Dandawate 20

I/O Ports of 8051-Port 3

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 21/31

 August 28, 2008 Y.H.Dandawate 21

Memory Interfacing with 8051

How to interface Programmemory(EPROM) up to 64 KB to 8051 ?

How to interface Data memory(RAM)upto 64 KB to 8051 ?

How 8051 distinguishes Program and

data memory operations ?

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 22/31

 August 28, 2008 Y.H.Dandawate 22

Timer Control Register (TCON)

7 6 5 4 3 2 1 0

TF1 :Vector location 001B H.

TF 0: Vector location 000B HIE 1 : Vector location 0013 H

IE 0: Vector location 0003 H

TF 1 TR1 TF0 TR0 IE 1 IT1 IE0 IT 0

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 23/31

 August 28, 2008 Y.H.Dandawate 23

Timer Mode (TMOD)

7 6 5 4 3 2 1 0

Timer 1 Timer 0

Gate C/T M1 M0 Gate C/T M1 M0

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 24/31

 August 28, 2008 Y.H.Dandawate 24

Modes of Timer/Counter

Mode 0 : 5 bit prescaler (13 bit ) Mode 1 : 16 bit timer

Mode 2 : 8 bit Auto reload Mode 3 : TL 0 and TH0 are independent

but TH0 controlled by TR1and TF1.

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 25/31

 August 28, 2008 Y.H.Dandawate 25

Serial Input/Output

Registers used are SCON and SBUFF. There are physically two SBUFF

registers having same address i.e 99 H.

Interrupt is generated whenever data istransmitted and received.

Controller goes to execute ISR for serialcommunication from 0023h.

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 26/31

 August 28, 2008 Y.H.Dandawate 26

Serial Control (SCON) register7 6 5 4 3 2 1 0

SMO SM10 0 Shift register mode

baud=1/12

0 1 8 bit UART baud=variable

1 0 9 bit UART baud= f/32 or f/64

1 1 9 bit UART baud = variable

SM0 SM1 SM2 REN TB8 RB8 TI RI

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 27/31

 August 28, 2008 Y.H.Dandawate 27

Power Control (PCON) Register

7 6 5 4 3 2 1 0

IDLE Mode :The internal clock is gated off to the CPU,but not to the timer,serial

port and all registers maintain the data.POWER DOWN :On chip oscillator is

stopped.But RAM and SFR’s are held.

- - -SMOD GF1 GF0 PD IDL

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 28/31

 August 28, 2008 Y.H.Dandawate 28

Idle and Power Down Hardware

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 29/31

 August 28, 2008 Y.H.Dandawate 29

Interrupt Enable (IE) Register

7 6 5 4 3 2 1 0--EA  ET2 ES ET1 EX1 ET0 EX0

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 30/31

8/6/2019 8051 Micro Controller (1)

http://slidepdf.com/reader/full/8051-micro-controller-1 31/31

THANK YOU