Contents - nptel

15 downloads 141 Views 60KB Size Report
M. Krishna Kumar. MAM/M5/LU12/V1/2004. 2. Introduction. • Definition of a Microcontroller. • Difference with a Microprocessor. • Microcontroller is used where ...
Contents • Introduction • Inside 8051 • Instructions • Interfacing

M. Krishna Kumar

MAM/M5/LU12/V1/2004

1

Introduction • Definition of a Microcontroller • Difference with a Microprocessor • Microcontroller is used where ever

M. Krishna Kumar

MAM/M5/LU12/V1/2004

2

Definition • It is a single chip • Consists of Cpu, Memory • I/O ports, timers and other peripherals

M. Krishna Kumar

MAM/M5/LU12/V1/2004

3

Difference Micro Controller • It is a single chip • Consists Memory, • I/o ports

Micro Processor • It is a cpu • Memory, I/O Ports to be connected externally

CPU CPU

MEMORY

MEMORY I/O PORTS

I/O PORTS

M. Krishna Kumar

MAM/M5/LU12/V1/2004

4

Where ever • Small size • Low cost • Low power

M. Krishna Kumar

MAM/M5/LU12/V1/2004

5

Architecture • Harvard university The Architecture given by Harvard University has the following advantages: 1: Data Space and Program Space are distinct 2: There is no Data corruption or loss of data Disadvantage is: 1: The circuitry is very complex.

M. Krishna Kumar

MAM/M5/LU12/V1/2004

6

Features • • • • • • • •

8 bit cpu 64k Program memory (4k on chip) 64k Data memory 128 Bytes on chip 32 I/O Two 16 bit timers Full duplex UART 6 Source/5 Vector interrupts with two level priority levels • On chip clock Oscillator.

M. Krishna Kumar

MAM/M5/LU12/V1/2004

7

Block Diagram External Interrupts Interrupt control

ETC

4k On chip flash 128 Bytes RAM

Counter inputs

Timer 1 Timer 0

CPU

OSC

Bus Control PSEN

M. Krishna Kumar

ALE

4 I/O ports

Serial Port

P0 P2 P1 P3

TXD RXD

MAM/M5/LU12/V1/2004

8

Memory Architecture FFFFH: EXTERNAL

EXTERNAL

INTERNAL

FFH: EA=0

EA=1

EXTERNAL

INTERNAL

00

0000H:

0000

RD

WR

PSEN

M. Krishna Kumar

MAM/M5/LU12/V1/2004

9

SFR Map

M. Krishna Kumar

MAM/M5/LU12/V1/2004

10

Internal Memory 7FH

Scratch Pad 30H

Bit Memory 20H

Bank 3 (R0-R7) 18H 10H

M. Krishna Kumar

Bank 2 (R0-R7)

08H

Bank 1 (R0-R7)

00H

Bank 0 (R0-R7)

MAM/M5/LU12/V1/2004

11

Pin connections

M. Krishna Kumar

MAM/M5/LU12/V1/2004

12