ALL Interview Basics

Embed Size (px)

Citation preview

  • 8/21/2019 ALL Interview Basics

    1/38

    Microprocessors &

    Microcontrollers

  • 8/21/2019 ALL Interview Basics

    2/38

    Microprocessor ?

     A microprocessor is multi programmable clock driven

    register basedsemiconductor device that isused to fetch , process and

    execute a data withinfraction of seconds.

  • 8/21/2019 ALL Interview Basics

    3/38

    Microprocessors

    • CPU for Computers

    • No RAM, ROM, I/O on CPU chip itself 

    • Example Intel!s x"#, Motorola$s #"%x%

    3

  • 8/21/2019 ALL Interview Basics

    4/38

    Microcontroller

    • A smaller computer• Onchip RAM, ROM, I/O ports'''

    • Example Motorola$s #"((, Intel$s "%)(,

    *ilo+$s *" an PIC

    Suresh.P.Nair , HOD - ECE , RCET 4

  • 8/21/2019 ALL Interview Basics

    5/38

    Microprocessor vs.Microcontroller

    Microprocessor• CPU is stanalone, RAM,

    ROM, I/O, timer areseparate

    • -esi+ner can ecie onthe amount of ROM, RAMan I/O ports'

    Expansi.e

    • ersatilit0

    • 1eneralpurpose

    Microcontroller• CPU, RAM, ROM, I/O an

    timer are all on a sin+lechip

    • 2ix amount of onchipROM, RAM, I/O ports

    • 2or applications in 3hich

    cost, po3er an space arecritical

    • Not Expansi.e

    • 4in+lepurpose5

  • 8/21/2019 ALL Interview Basics

    6/38

    Microprocessor ?

     A microprocessor is multi programmable clock driven

    register basedsemiconductor device that isused to fetch , process and

    execute a data withinfraction of seconds.

  • 8/21/2019 ALL Interview Basics

    7/38

     56E "%") AN- I54 7U44E4

    The 8085 is an 8-bit general purposemicroprocessor64K Byte of memory.It has 40 pins.

    It can run at a maximum freuency of ! "#$.

    %&&ress Bus.'(6 bit) *ata Bus. '8 bit) 

    +ontrol an& ,tatus ,ignals.oer supply an& freuency./xternally Initiate& ,ignals.,erial I1 ports.

  • 8/21/2019 ALL Interview Basics

    8/38

    2la+ Re+ister

    CYCYPP AC ACZZSSD0D0D1D1D2D2D3D3D4D4D5D5D6D6DD

    The flags are affected by the arithmetic and logical

    instruction

  • 8/21/2019 ALL Interview Basics

    9/38

    Classi8cation of instructionset

     According to word size orbyte size it is classied into

    3 types. 1 byte instruction

    ! byte instruction and

    3 byte instruction

  • 8/21/2019 ALL Interview Basics

    10/38

    ( 90te instruction

    "t includes the #pcode and the#perand in the same byte.

    $x. %#& A,'$x. (%) '

    $x. A*A '

    $x. +A

  • 8/21/2019 ALL Interview Basics

    11/38

    Opcoe an operan

    -he task to be performedis called #pcode

    -he data to be operated iscalled #perand.

  • 8/21/2019 ALL Interview Basics

    12/38

    : 90te instruction

    -he rst byte species theoperation cod eand the next

    byte species the operand$x. %&" A, 1

    $x. /0" A, 3

  • 8/21/2019 ALL Interview Basics

    13/38

    ; 90te instruction

    -he rst byte species theopcode and the next two

    bytes species the 12 bitaddressdata.

    $x. 4" 5, 6

    $x. 7%) 6

  • 8/21/2019 ALL Interview Basics

    14/38

    Timing Diagram is a graphical representation. Itrepresents the execution time taken by eachinstruction in a graphical format. The execution

    time is represented in T-states.

    Instruction Cycle:  The time required to execute an instruction .

    Machine Cycle:  The time required to access the memory orinputoutput de!ices .

    T-"tate:•The machine cycle and instruction cycle takesmultiple clock periods. •# portion of an operation carried out in one

    system clock period is called as T-state. !"##e!$e% &' C.(")u# AP*EEE,+CET

  • 8/21/2019 ALL Interview Basics

    15/38

     5imin+ ia+rams• The 8085 microprocessor has 7 basic machine

    cycle. They are

    1. Op-code Fetch cycle(4T or 6T).

    . !emory read cycle ("T)

    ". !emory #rite cycle("T)

    4. $%O read cycle("T)

    5. $%O #rite cycle("T)6. $nterr&pt 'cno#lede cycle(6T or 1T)

    7. *&s idle cycle

    !"##e!$e% &' C.(")u# AP*EEE,+CET

  • 8/21/2019 ALL Interview Basics

    16/38

    !"##e!$e% &' C.(")u# AP*EEE,+CET

  • 8/21/2019 ALL Interview Basics

    17/38

    45A instructionex STA 526A

  • 8/21/2019 ALL Interview Basics

    18/38

    It re;5 ;'memor0 rea>;5

    ='Memor0 3rite>;5

  • 8/21/2019 ALL Interview Basics

    19/38

    Timing diagram for INC0H

    • Fetcing te !pcode "#H fromte memor$ %&25H.

    • 'ead te port address C0H from%&26H.

    • 'ead te content of port C0H andsend it to te acc(m(lator.

    • )et te content of port is 5*H.

  • 8/21/2019 ALL Interview Basics

    20/38

    It re=5memor0 rea>;5

    I/O rea>;5

  • 8/21/2019 ALL Interview Basics

    21/38

    !+T

    instr(ctionMacines

    C$cles,&0T-&.instr(ction fetc,%T-

    2.memor$ read ,/T-/.I! rite ,/T-

  • 8/21/2019 ALL Interview Basics

    22/38

    Classi1cation ofInstr(ction Set

    • -ata 5ransfer Instruction

    • Arithmetic Instructions

    • @o+ical Instructions

    • 7ranchin+ Instructions

    • Control Instructions

  • 8/21/2019 ALL Interview Basics

    23/38

    IN5ER2ACIN1

  • 8/21/2019 ALL Interview Basics

    24/38

    ":)) PPI•  5he 255 chip is also calle as

    3rogramma4le 3eriperal Interface'

    •  5he Intel$s ":)) is esi+ne for use 3ithIntel$s "9it, (#9it an hi+her capa9ilit0microprocessors

    • It is exi9le an economical'

    CON5RO@ BOR-

  • 8/21/2019 ALL Interview Basics

    25/38

    CON5RO@ BOR-RE1I45ER>CBR

  • 8/21/2019 ALL Interview Basics

    26/38

    Modes of !peration of255

    #it Set'eset,#S'- ModeSet'eset 4its in 3ort C

    I! Mode Mode 0 ,Simple inp(to(tp(t- Mode & ,Handsae mode- Mode 2 ,#idirectional "ata

    Transfer-

  • 8/21/2019 ALL Interview Basics

    27/38

    7rite a program to initiali8e 255 in tecon1g(ration 4elo.,ass(me address of teC7 register as 2/H-.,&- 3ort A o(tp(t it andsae,2- 3ort # inp(t it andsae

    ,/- 3ort C) o(tp(t ,%-3ort C+ inp(t

    Sol(tion

    & 0 & 0 & & & 0 = AEH

    M9I A:A*H  ; LOAD CONTROL WORD

    !+T 2/H  ; SEND CONTROL WORD

    Program:

  • 8/21/2019 ALL Interview Basics

    28/38

    Find te control ord for te registerarrangementof te ports of Intel 255 for mode 0operation.3ort A !(tp(t: 3ort # !(tp(t: 3ort C+ !(tp(t: 3ort C) !(tp(t

    Solution:

    & 0 0 0 0 0 0 0 = 80H

    The ontrol !or" regi#ter $or the a%o&e'ort# o$ (ntel 8)** i# 80H+

    #asics of serial

  • 8/21/2019 ALL Interview Basics

    29/38

    #asics of serialcomm(nication

    &.Transmitter A parallelin, serialoutshift re+ister

    2.'eceiver A serialin, paralleloutshift re+ister'

    2

    Parallel Tran#$er 

    TRANS,(TTER

  • 8/21/2019 ALL Interview Basics

    30/38

    TRANS,(TTER 

    Reei&er 

  • 8/21/2019 ALL Interview Basics

    31/38

    IN5E@ ":)(U4AR5

    +,$/' 2,3/O,O+

  • 8/21/2019 ALL Interview Basics

    32/38

    + ,$/' 2,3/O,O+

    '2,3/O,O+ / 3$/

    T/',!$TT/ (+'/T-Pro+ramma9le chip esi+ne fors0nchronous an as0nchronous serial atatransmission

    :" pin -IP

    Co.erts the parallel ata into a serial stream of 9its suita9le for serial

    transmission' Recei.es a serial stream of 9its an con.ert 

    it into parallel ata 90tes to 9e rea 90 amicroprocessor'

  • 8/21/2019 ALL Interview Basics

    33/38

    IN5E@ ":);/":)=

     5IMER/COUN5ER

  • 8/21/2019 ALL Interview Basics

    34/38

    INT*) 2;< =

    3rogramma4le>e$4oard"ispla$

    Interface

  • 8/21/2019 ALL Interview Basics

    35/38

  • 8/21/2019 ALL Interview Basics

    36/38

    "%)( 2amil0

    •  5he "%)( is a su9set of the "%):

    •  5he "%;( is a ROMless "%)( – A external ROM to it

     – ou lose t3o ports, an lea.e onl0 : ports for I/Ooperations

    36

  • 8/21/2019 ALL Interview Basics

    37/38

    (nterru'tControl

    CP-

    ./ RO,

    )8 1RA,

    OSC1u#

    Control. (2O Port#

    SerialPort

     of 05&

    T3D R3DP0 P P) P4

  • 8/21/2019 ALL Interview Basics

    38/38

    "%)( Memor0 4tructure

          E    5     t    e    r    n    a      l

    E3T (NT)8

    S6R    E    5     t    e    r    n    a      l

    P ,Data ,emor7 

    ./  ./ 

    EA =0

    EA =

    ./ 

    0/ 

    051 i!r"!"/$r"##er Suresh PNair HOD ECE RCET 3