embeded_system

Upload: radhika-agarwal

Post on 08-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Embeded_System

    1/29

    An embedded system can be defined as those control systems which aredesigned either by microprocessor or microcontroller for a specific tasks. OR An embedded system is some combination of computer hardware & software,either fixed in capability or programmable, that is specifically designed for a

    particular kind of application device.

  • 8/7/2019 Embeded_System

    2/29

    Important Units Ofmicroprocessor/controller

    CPU:Central Processing Unit

    I/O:Input /Output Bus: Address bus & Data bus Memory: RAM & ROM Timer I

    nterrupt

  • 8/7/2019 Embeded_System

    3/29

    Block Diagram of an Embedded System

  • 8/7/2019 Embeded_System

    4/29

    Traffic LightDVD player

    Digital clockMoving message display

  • 8/7/2019 Embeded_System

    5/29

    CPU

    General-PurposeMicro-

    processor

    RAM ROM I/O

    Port

    TimerSerialCOM

    Port

    Data Bus

    Address Bus

    General-Purpose Microprocessor System

    CPU forComputers No RAM, ROM, I/O on CPU chip itself E

    xample--Intel

    s x86

    :8086,8088,80386,80486,

    Pentium

    Many chips on mother board

    General-purpose microprocessor

  • 8/7/2019 Embeded_System

    6/29

    RAM ROM

    I/OPort

    TimerSerialCOMPort

    Microcontroller

    CPU

    A smaller computer. On-chip RAM, ROM, I/O ports... Example:- Motorolas 6811, Intels 8051 and PIC

    16X

    A single chip

    Microcontroller

  • 8/7/2019 Embeded_System

    7/29

    Microprocessor CPU is stand-alone, RAM,

    ROM, I/O, timer areseparate

    designer can decide on theamount of ROM, RAM andI/O ports.

    expensive general-purpose

    Ex. 8085,8086 mp,Motorola 6800, Intels8086, etc.

    Microcontroller

    CPU, RAM, ROM, I/O andtimer are all on a singlechip

    fix amount of on-chipROM, RAM, I/O ports

    for applications in whichcost, power and space arecritical

    single-purposeEx. 8051, PIC mc,Motorola MCs, Phillips,

    etc.

    Microprocessor v/s

    Microcontroller

  • 8/7/2019 Embeded_System

    8/29

  • 8/7/2019 Embeded_System

    9/29

    The 8051 Microcontroller: The 8051 is the first microcontroller of the MCS-51

    family introduced by Intel Corporation at the end of the

    1970s.

    The 8051 family characteristics:o 4K Bytes ROMo 128 Bytes RAMo two timer/counters (16 bit)o A serial porto 32 input/output porto Interrupt controller

  • 8/7/2019 Embeded_System

    10/29

    Microcontroller 8051 internal Architecture

  • 8/7/2019 Embeded_System

    11/29

    Pin Description of the 8051

    1

    23

    45

    6

    78

    910

    11

    1213

    1415

    16

    17

    18

    1920

    40

    3938

    3736

    35

    3433

    3231

    30

    2928

    2726

    25

    24

    23

    2221

    P1.0

    P1.1P1.2

    P1.3P1.4

    P1.5

    P1.6P1.7

    RST(RXD)P3.0

    (TXD)P3.1

    (T

    0)P

    3.4(T1)P3.5

    XTAL2

    XTAL1GND

    (INT0)P3.2

    (INT1)P3.3

    (RD)P3.7

    (WR)P3.6

    VccP0.0(AD0)

    P0.1(AD1)

    P0.2(AD2)P0.3(AD3)

    P0.4(AD4)

    P0.5(AD5)P0.6(AD6)

    P0.7(AD7)

    EA/VPPALE/PROG

    PSEN

    P2.7(A15)

    P2.6(A14)P2.5(A13)

    P2.4(A12)

    P2.3(A11)

    P2.2(A10)

    P2.1(A9)

    P2.0(A8)

    8051IC

    8051

  • 8/7/2019 Embeded_System

    12/29

    Vcc(+5volt)Pin - 40

    Ground(0 volt)Pin-20

    Pin Description

  • 8/7/2019 Embeded_System

    13/29

    Pin Description

    Port 0 fromPin-39 to pin-32

    Used to excess bothdata & address

    Dual functional

  • 8/7/2019 Embeded_System

    14/29

    Microcontroller 8051Pin Description

    Port 1 fromPin-1 to pin-8

    Used as I/O port

  • 8/7/2019 Embeded_System

    15/29

    Pin Description

    Port 2 from

    Pin-21 to pin-28

    Used to excessaddress & as I/O port

  • 8/7/2019 Embeded_System

    16/29

    Microcontroller 8051Pin Description

    Port 3 fromPin-10 to Pin-17

    P3.0 RXD

    P3.1 TXD

    P3.2 IN T0

    P3.3 IN T1P3.4 T0

    P3.5 T1

    P3.6 WR

    P3.7 RD

  • 8/7/2019 Embeded_System

    17/29

    Pin Description

    reset

    crystal

    External memory

    Add. Latchenable

    ProgramStore Enable

  • 8/7/2019 Embeded_System

    18/29

    Addressing Modes

    Immediate addressing modeso ADD A, #23h (Add immediate data to Acc)

    Register addressing modeso ADD A, R2 (Add register to Accumulator)

    Direct addressing modeso ADD A, 40h (Add data at location 40h to Accumulator)

    RegisterIndirect addressing modeso

    ADD A,@R2 (Add indirect RAM

    to Acc)

  • 8/7/2019 Embeded_System

    19/29

    Timers/counters

    The 8051 has 2 timer/counter .They can be used either as timersto generate delay or as counters

    to count events happening outsidethe controller.

    o e.g., traffic light.

  • 8/7/2019 Embeded_System

    20/29

    Timers/Counters

    General 8051 has 2 timer:o Two 16-bit timero The counters are divided into two 8-Bit registers called the

    timerlow (TL0, TL1) and high (TH0, TH1) bytes.o All counters action is controlled by bit states in the timer

    mode control register (TMOD), the timer/counter controlregister (TCON), and certain program instructions.

  • 8/7/2019 Embeded_System

    21/29

    TMOD Register:

    Gate :It controls the way by which timer/counter willstart.

    (set when gate is controlled by hardware)

    C/T: Counter/Timer select bit.(set for counter)

    M1 :Mode bit 1. M0 :Mode bit 0.

  • 8/7/2019 Embeded_System

    22/29

    InterruptsDefinition of Interrupt

    Event that disrupts the normal execution of aprogram and causes the execution of special

    instructions

  • 8/7/2019 Embeded_System

    23/29

    Interrupts

    Program

    time t

  • 8/7/2019 Embeded_System

    24/29

    InterruptsInterrupt

    Program

    time t

  • 8/7/2019 Embeded_System

    25/29

    Interrupts

    Program

    Interrupt Service Routine

    Interrupt

    Program

    time t

  • 8/7/2019 Embeded_System

    26/29

    Interrupts Internal orExternal Handling can be

    enabled/disabled Prioritized

    General 8051:o 3x timer interrupts,o 2x external interruptso 1x serial port interrupt

  • 8/7/2019 Embeded_System

    27/29

  • 8/7/2019 Embeded_System

    28/29

    External Interrupts

    Pins forexternalinterrupts

    P3.2 IN T0

    P3.3 INT

    1

  • 8/7/2019 Embeded_System

    29/29

    Smart card

    ATM

    Health card

    Robotics