Elr Embedded System

Embed Size (px)

Citation preview

  • 7/31/2019 Elr Embedded System

    1/27

    PresentationPresentationOnOn

    Summer Training Project ReportSummer Training Project Reporttitled astitled as

    EMBEDDED SYSTEMS/8051EMBEDDED SYSTEMS/8051MICROCONTROLLERMICROCONTROLLER

  • 7/31/2019 Elr Embedded System

    2/27

    Different types of systems:Different types of systems:

    1.Open system:1.Open system:where you can use it for various task.where you can use it for various task.

    For e.g.. personal computer.For e.g.. personal computer.

    2. Embedded system:2. Embedded system:

    where you can use it for specific task.itwhere you can use it for specific task.itcontains special purpose compute withincontains special purpose compute within

    the device, and is designed with variousthe device, and is designed with variousfuntions .For e.g. microwave.funtions .For e.g. microwave.

  • 7/31/2019 Elr Embedded System

    3/27

    EMBEDDED SYSTEMSEMBEDDED SYSTEMS

    EmbeddedEmbedded systemssystems areare combinationcombination ofofcomputercomputer H/WH/W andand S/W,S/W, andand perhapsperhapsadditionaladditional mechanicalmechanical oror otherother parts,parts, whichwhich

    areare designeddesigned usingusing uPuP oror uCuC butbut forfor aa specificspecifictasktask toto performperform aa dedicateddedicated functionfunction..

    InIn somesome cases,cases, ESES maymay bebe partpart ofof aa largerlarger

    systemsystem ,, asas isis thethe casecase ofof anan antianti--locklock brakingbrakingsystemsystem inin aa carcar..

  • 7/31/2019 Elr Embedded System

    4/27

    EMBEDDED SYSTEMSEMBEDDED SYSTEMS

    ES generally use microcontroller thatES generally use microcontroller thatcontains many functions of computercontains many functions of computeron a single deviceon a single device

    Motorola and Intel make some of theMotorola and Intel make some of themost popular microcontrollersmost popular microcontrollers

  • 7/31/2019 Elr Embedded System

    5/27

    EMBEDDED SYSTEMEMBEDDED SYSTEMDEVICESDEVICES

    PLANT CONTROL

    Robots

    Industrial Process control

    CONSUMER ELECTRONICSMicrowave Ovens

    Digital Cameras

    rp ane con ro ys em

    Missile Guidance System

    AUTOMOTIVE

    Engine Controller

    Anti-brake lock controller

    DVD Player

    Washing Machine

    TELECOMMUNICATIONSwitchesCellular Phones

  • 7/31/2019 Elr Embedded System

    6/27

    Percentage share of various verticalsPercentage share of various verticalsin Embedded Software marketin Embedded Software market

  • 7/31/2019 Elr Embedded System

    7/27

    Some feature that makes 8051Some feature that makes 8051popularpopular

    88--bit data busbit data bus

    1616--bit address busbit address bus 34 general purpose registers each of 834 general purpose registers each of 8

    bitsbits

    ,,more, or less).more, or less). 3 internal and 2 external interrupts.3 internal and 2 external interrupts.

    Bit as well as byte addressable RAM areaBit as well as byte addressable RAM areaof 16 bytes.of 16 bytes. Four 8Four 8--bit ports, (short models have twobit ports, (short models have two

    88--bit ports).bit ports). 1616--bit program counter and data pointerbit program counter and data pointer

  • 7/31/2019 Elr Embedded System

    8/27

    PIN DIAGRAM OF 8051PIN DIAGRAM OF 8051

  • 7/31/2019 Elr Embedded System

    9/27

    TYPES OF MEMORYTYPES OF MEMORY OnOn--Chip MemoryChip Memory

    External CodeExternal Code

    External RAMExternal RAM

  • 7/31/2019 Elr Embedded System

    10/27

    On chip memoryOn chip memory

  • 7/31/2019 Elr Embedded System

    11/27

    It has four parts on which it can be explained :It has four parts on which it can be explained :

    Register banksRegister banks-- R0,R1,R2 and R4R0,R1,R2 and R4

    are basically used to manipulate data from one memory to anotherare basically used to manipulate data from one memory to another

    memory place.memory place.

    BIT MEMORYBIT MEMORY

    ..

    There are 128 bit variables available to the user, numbered 00h throughThere are 128 bit variables available to the user, numbered 00h through7Fh7Fh

    GENERAL PURPOSE REGISTERSGENERAL PURPOSE REGISTERS

    use to store memory addresses and datause to store memory addresses and data

    SPECIAL FUNCTION REGISTER(SFR)SPECIAL FUNCTION REGISTER(SFR)Special Function Registers (SFRs) are areas of memory that controlSpecial Function Registers (SFRs) are areas of memory that controlspecific functionality of the 8051 processor . Four SFRs permit access tospecific functionality of the 8051 processor . Four SFRs permit access to

    the 8051s 32 input/output linesthe 8051s 32 input/output lines ..

  • 7/31/2019 Elr Embedded System

    12/27

  • 7/31/2019 Elr Embedded System

    13/27

    SFRSFR

  • 7/31/2019 Elr Embedded System

    14/27

    TIMERTIMERThe 8051 comes equipped with two timers,The 8051 comes equipped with two timers,

    both of which may be controlled, set, read,both of which may be controlled, set, read,and configured individually. The 8051 timersand configured individually. The 8051 timers

    1)1) Keeping time and/or calculating the amountKeeping time and/or calculating the amountof time between events,of time between events,

    2) Counting the events themselves,2) Counting the events themselves,3) Generating baud rates for the serial port.3) Generating baud rates for the serial port.

  • 7/31/2019 Elr Embedded System

    15/27

    Timer SFRsTimer SFRs

    The 8051 has two timers which each functionThe 8051 has two timers which each functionessentially the sameway. One timer is TIMER0essentially the sameway. One timer is TIMER0

    and the other is TIMER1.and the other is TIMER1.

    The two timers share two SFRsThe two timers share two SFRs

    (TMOD and TCON) which control the timers.(TMOD and TCON) which control the timers.

    Each timer also has two SFRs, dedicated solelyEach timer also has two SFRs, dedicated solely

    to itself (TH0/TL0 and TH1/TL1).to itself (TH0/TL0 and TH1/TL1).

  • 7/31/2019 Elr Embedded System

    16/27

    Timer SFRSTimer SFRS

  • 7/31/2019 Elr Embedded System

    17/27

    TIMER MODESTIMER MODES

  • 7/31/2019 Elr Embedded System

    18/27

  • 7/31/2019 Elr Embedded System

    19/27

  • 7/31/2019 Elr Embedded System

    20/27

    TCON SFRSTCON SFRS

  • 7/31/2019 Elr Embedded System

    21/27

    InterruptInterrupt

    An interrupt is some event which interruptsAn interrupt is some event which interruptsnormal program executionnormal program execution

    Interrupts give us a mechanism to put onInterrupts give us a mechanism to put on

    subroutine,and then resume normal programsubroutine,and then resume normal programflow as if we had never left itflow as if we had never left it

    Subroutine called an interrupt handler,is onlySubroutine called an interrupt handler,is onlyexecuted when a certain even occurs.executed when a certain even occurs.

  • 7/31/2019 Elr Embedded System

    22/27

    8051 Microcontroller Interrupts8051 Microcontroller Interrupts

    There are five interrupt sources for the 8051,There are five interrupt sources for the 8051,which means that they can recognize 5 differentwhich means that they can recognize 5 different

    event that can interrupt regular programevent that can interrupt regular programexecution.execution.

    Event may be one of theEvent may be one of the

    t mers over ow ng ,rece v ng a c aracter v a t et mers over ow ng ,rece v ng a c aracter v a t eserial port,trasmitting a character via the serialserial port,trasmitting a character via the serialport or one of the two external eventsport or one of the two external events

    Each interrupt can be enabled or disabled byEach interrupt can be enabled or disabled bysetting bits in the IE register. Also, as seen fromsetting bits in the IE register. Also, as seen fromthe picture below the whole interrupt systemthe picture below the whole interrupt systemcan be disabled by clearing bit EA from the samecan be disabled by clearing bit EA from the sameregister.register.

  • 7/31/2019 Elr Embedded System

    23/27

    IE SFRIE SFR

  • 7/31/2019 Elr Embedded System

    24/27

    INTERRUPT HANDLINGINTERRUPT HANDLING

  • 7/31/2019 Elr Embedded System

    25/27

    SERIAL INPUT/OUTPUT PORTSERIAL INPUT/OUTPUT PORT

    One of the 8051s many powerful features is its integratedOne of the 8051s many powerful features is its integrated UARTUART,,otherwise known as a serial port. The fact that the 8051 has anotherwise known as a serial port. The fact that the 8051 has anintegrated serial port means that you may very easily read and writeintegrated serial port means that you may very easily read and write

    values to the serial port. If it were not for the integrated serial portvalues to the serial port. If it were not for the integrated serial port,writing a byte to a serial line would be a rather tedious process,writing a byte to a serial line would be a rather tedious processrequiring turning on and off one of the I/O lines in rapid successionrequiring turning on and off one of the I/O lines in rapid successionto properly "clock out" each individual bit ,including start bits, stopto properly "clock out" each individual bit ,including start bits, stopbits, and parity bits. However, we do not have to do this. Instead,bits, and parity bits. However, we do not have to do this. Instead,we simply need to configure the serial ports operation mode andwe simply need to configure the serial ports operation mode andbaud rate. Once configured, all we have to do is write to an SFR tobaud rate. Once configured, all we have to do is write to an SFR towrite a value to the serial port or read the same SFR to read a valuewrite a value to the serial port or read the same SFR to read a valuefrom the serial port.from the serial port.

    The 8051 will automatically let us know when it has finished sendingThe 8051 will automatically let us know when it has finished sendingthe character we wrote and will also let us know whenever it hasthe character we wrote and will also let us know whenever it has

    received a byte so that we can process it. We do not have to worryreceived a byte so that we can process it. We do not have to worryabout transmission at the bit levelabout transmission at the bit level----which saves us quite a bit ofwhich saves us quite a bit ofcoding and processing time.coding and processing time.

  • 7/31/2019 Elr Embedded System

    26/27

    SCON SFRSCON SFR

  • 7/31/2019 Elr Embedded System

    27/27

    THANK YOUTHANK YOU