8051mc notes industrial electronics

Upload: santhanu-surendran

Post on 04-Jun-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 8051mc Notes Industrial Electronics

    1/32

    SANTHANU S

    ASST PROFESSOR

    DEPT OF ECE, YIT KANNANALLOOR

    INTEL 8051 MICROCONTROLLER

    INTRODUCTION :

    A decade back the process and control operations were totally implemented by the

    Microprocessors only. But now a days the situation is totally changed and it is occupied by the

    new device called Microcontroller. The development is so drastic that we cant find any

    electronic gadget without the use of a microcontroller. This microcontroller changed theembedded system design so simple and advanced that the embedded market has become one of

    the most sought after for not only entrepreneurs but for design engineers also.

    What is a Mi!""#t!"$$%!&

    A single chip computer or A CP with all the peripherals like !AM" !#M" $%# Ports"

    Timers" A&Cs etc on the same chip. 'or e() Motorolas *+,," $ntels +-," /ilogs /+ and P$C,*0 etc1

    MICROPROCESSORS ' MICROCONTROLLERS:

    Mi!"(!"%ss"!:

    A CP built into a single 234$ chip is called a microprocessor. $t is a general5purpose deviceand additional e(ternal circuitries are added to make it a microcomputer. The microprocessor

    contains arithmetic and logic unit 6A37" $nstruction decoder and control unit" $nstructionregister" Program counter 6PC7" clock circuit 6internal or e(ternal7" reset circuit 6internal ore(ternal7 and registers. But the microprocessor has no on chip $%# Ports" Timers" Memory etc.

    'or e(ample" $ntel +-+ is an +5bit microprocessor and $ntel +-+*%+-++ a ,*5bit microprocessor.

    INDUSTRIAL ELECTRONICS ,

  • 8/13/2019 8051mc Notes Industrial Electronics

    2/32

    Fi)*1 +$" -ia)!a. "/ a Mi!"(!"%ss"!*

    MICROCONTROLLER :

    A microcontroller is a highly integrated single chip" which consists of on chip CP 6Central

    Processing nit7" !AM 6!andom Access Memory7" 8P!#M%P!#M%!#M 68rasable

    Programmable !ead #nly Memory7" $%# 6input%output7 9 serial and parallel" timers" interruptcontroller. 'or e(ample" $ntel +-, is +5bit microcontroller and $ntel +-:* is ,*5bit

    microcontroller. The block diagram of Microcontroller is shown in 'ig.;.

    Fig.2.Block Diagram of a Microcontroller

    INDUSTRIAL ELECTRONICS ;

    S%!ia$

    P"!t

    CPU RAM ROM

    IO

    P"!tTi.%!

  • 8/13/2019 8051mc Notes Industrial Electronics

    3/32

    Disti#)ish 2%t3%%# Mi!"(!"%ss"! a#- Mi!""#t!"$$%!

    S*N" Mi!"(!"%ss"! Mi!""#t!"$$%!

    , A microprocessor is a generalpurpose device which is called a

    CP

    A microcontroller is a dedicated chip whichis also called single chip computer.

    ; A microprocessor do not contain

    onchip $%#Ports" Timers" Memories

    etc..

    A microcontroller includes !AM" !#M"

    serial and parallel interface" timers"

    interrupt

    circuitry 6in addition to CP7 in a single

    chip.

    4 Microprocessors are most

    commonly used as the CP inmicrocomputer systems

    Microcontrollers are used in small"

    minimum component designs performingcontrol5oriented applications.

    < Microprocessor instructions are

    mainly nibble or byte addressable

    Microcontroller instructions are both bit

    addressable as well as byte addressable.

    Microprocessor instruction sets are

    mainly intended for catering tolarge volumes of data.

    Microcontrollers have instruction sets

    catering to the control of inputs andoutputs.

    * Microprocessor based system

    design is comple( and e(pensive

    Microcontroller based system design is

    rather simple and cost effective

    The $nstruction set of

    microprocessor is comple( with

    large number of instructions.

    The instruction set of a Microcontroller is

    very simple with less number of

    instructions. 'or" e() P$C microcontrollershave only = instructions*

    + A microprocessor has >ero status

    flag

    A microcontroller has no >ero flag.

    E6OLUTION OF MICROCONTROLLERS :

    The first microcontroller TM4,--- was introduced by Te(as $nstrumentsin the year

    ,:?

  • 8/13/2019 8051mc Notes Industrial Electronics

    4/32

    !AM " a serial port" two ,*5bit Timers " and =; $%# pins. The +-, family has many additions

    and improvements over the years and remains a most acclaimed tool for todays circuit

    designers. $T83 introduced a ,* bit microcontroller +-:* in the year ,:+; . 3ater $T83introduced +-c,:* series of ,*5bit Microcontrollers for mainly industrial applications.

    Microchip" another company has introduced an +5bit Microcontroller P$C ,*C*< in the year

    ,:+.The =;5bit microcontrollers have been developed by $BM and Motorola. MPC - is a =;5bit !$4C controller of Motorola. The

  • 8/13/2019 8051mc Notes Industrial Electronics

    5/32

    COMMERCIAL MICROCONTROLLERS

    There are various manufacturers who are supplying various types of microcontrollers suitablefor different applications depending on the power consumption and the available features..They

    are given below in tables . 'irst the various members of $T83 , family are given in below

    table.

    INTEL MCS 51 Fa.i$ed for control

    applications with e(tensive Boolean processing. $t is available as a

  • 8/13/2019 8051mc Notes Industrial Electronics

    9/32

    &ata pointer register6&PT!7",;+ bytes of !AM and

    + =892it !%)ist%! /"! M$ 'Di>

    PSW =892it P!")!a. Stats W"!->

    SP =892it Sta P"i#t%!>

    PC =192it P!")!a. C"#t%!>

    INDUSTRIAL ELECTRONICS :

  • 8/13/2019 8051mc Notes Industrial Electronics

    10/32

  • 8/13/2019 8051mc Notes Industrial Electronics

    11/32

    A a#- + R%)ist%!s) The A and B registers are special function registers which hold the results

    of many arithmetic and logical operations of +-,.The A register is also called the A.$at"!and as its name suggests" is used as a general register to accumulate the results of a large

    number of instructions. By default it is used for all mathematical operations and also data

    transfer operations between CP and any e(ternal memory.

    The B register is mainly used for multiplication and division operations along with A register.

    M3 AB ) &$2 AB.

    $t has no other function other than as a location where data may be stored.

    Th% R !%)ist%!s) The K!K registers are a set of eight registers that are named !-" !," etc. up toand including !?. These registers are used as au(illary registers in many operations. The K!K

    registers are also used to temporarily store values.

    P!")!a. C"#t%! =PC> : +-, has a ,*5bit program counter .The program counter alwayspoints to the address of the ne(t instruction to be e(ecuted. After e(ecution of one instruction the

    program counter is incremented to point to the address of the ne(t instruction to be e(ecuted.$t is

    the contents of the PC that are placed on the address bus to find and fetch the desired instruction.

    4ince the PC is ,*5bit width" +-, can access program addresses from ----F to ''''F "a totalof *kB of code.

    Sta P"i#t%! R%)ist%! =SP> : $t is an +5bit register which stores the address of the stack top.The 4tack Pointer is used to indicate where the ne(t value to be removed from the stack should

    be taken from. Ghen a value is pushed onto the stack" the +-, first increments the value of 4P

    and then stores the value at the resulting memory location. 4imilarly when a value is popped offthe stack" the +-, returns the value from the memory location indicated by 4P" and then

    decrements the value of 4P. 4ince the 4P is only +5bit wide it is incremented or decremented bytwo. 4P is modified directly by the +-, by si( instructions) P4F" P#P" ACA33" 3CA33"

    !8T" and !8T$. $t is also used intrinsically whenever an interrupt is triggered.

    STACK i# 8051 Mi!""#t!"$$%!: The stack is a part of !AM used by the CP to store

    information temporarily. This information may be either data or an address .The CP needs thisstorage area as there are only limited number of registers. The register used to access the stack is

    called the 4tack pointer which is an +5bit register..4o"it can take values of -- to '' F. Ghen the

    +-, is powered up" the 4P register contains the value -?.i.e the !AM location value -+ is thefirst location being used for the stack by the +-, controller

    There are two important instructions to handle this stack. #ne is the P4F and the #theris the P#P. The loading of data from CP registers to the stack is done by P4F and the loading

    of the contents of the stack back into aCP register is done by P#P.

    80 ) M#2 !* "L= F

    M#2 !, "L;, F P4F *

    P4F ,

    INDUSTRIAL ELECTRONICS ,,

  • 8/13/2019 8051mc Notes Industrial Electronics

    12/32

  • 8/13/2019 8051mc Notes Industrial Electronics

    13/32

    RS1 RS0 R%)ist%! +a# A--!%ss

    - - - --F5-?F

    - , , -+F5-'F

    , - ; ,-F5,?F

    , , = ,+F5,'F

    M%."!< "!)a#iBati"# : The +-, microcontroller has ,;+ bytes of $nternal !AM and ed as below.

    6i7 'our register banks 6Bank-" Bank," Bank; and Bank=7 each of +5bits 6total =; bytes7. The

    default bank register is Bank-. The remaining Banks are selected with the help of !4- and!4, bits of P4G !egister.

    6ii7 ,* bytes of bit addressable area and

    6iii7 +- bytes of general purpose area 64cratch pad memory7 as shown in the diagram below. This

    area is also utili>ed by the microcontroller as a storage area for the operating stack.

    INDUSTRIAL ELECTRONICS ,=

  • 8/13/2019 8051mc Notes Industrial Electronics

    14/32

    The =; bytes of !AM from address -- F to ,'F are used as working registers organi>ed as four

    banks of eight registers each.The registers are named as !-5!? .8ach register can be addressedby its name or by its !AM address.

    'or 80 ) M#2 A" !? or M#2 !?"L-F

    I#t%!#a$ ROM =ONCHIP ROM>: The +-, microcontroller has

  • 8/13/2019 8051mc Notes Industrial Electronics

    15/32

    SPECIAL FUNCTION RE@ISTERS =SFRs> : $n +-, microcontroller there certainregisters

    which uses the !AM addresses from +-h to ''h and they are meant for certain specific

    operations .These registers are called 4pecial function registers 64'!s7.4ome of these registersare bit addressable also.

    The list of 4'!s and their functional names are given below. $n these 4'!s some of them arerelated to $%# ports 6P-"P,"P; and P=7 and some of them are meant for control operations

    6TC#"4C#" PC#..7 and remaining are the au(illary 4'!s" in the sense that they donNt

    directly configure the +-,.

    S*N" S

    , ACCO Accumulator 0E0

    ; BO B5!egister 0F0

    = P4GO Program 4tatus word register 0DO

    < 4P 4tack Pointer !egister 81

    &PT!

    &P3 &ata pointer low byte 8;

    &PF &ata pointer high byte 84

    * P-O Port - 80

    P,O Port , 0

    + P;O Port ; 0A

    : P=O Port = 0+

    ,- $PO $nterrupt Priority control 0+8

    ,, $8O $nterrupt 8nable control 0A8

    ,; TM#& Tmier mode register 8

    ,= TC#O Timer control register 88

    ,< TF- Timer - Figher byte 8C

    INDUSTRIAL ELECTRONICS ,

  • 8/13/2019 8051mc Notes Industrial Electronics

    16/32

    , T3- Timer - 3ower byte 8A

    ,* TF, Timer ,Figher byte 8D

    ,? T3, Timer , lower byte 8+

    ,+ 4C#O 4erial control register 8

    ,: 4B' 4erial buffer register

    ;- PC# Power control register 8

    Th% Oi#-iat%s th% 2it a--!%ssa2$% SFRs

    Ta2$%:SFRs "/ 8051 Mi!""#t!"$$%!

    PARALLEL I O PORTS :

    The +-, microcontroller has four parallel $%# ports" each of +5bits. 4o" it provides the user =;$%# lines for connecting the microcontroller to the peripherals. The four ports are P- 6Port -7"

    P,6Port,7 "P;6Port ;7 and P= 6Port=7. pon reset all the ports are output ports. $n order to makethem input" all the ports must be set i.e a high bit must be sent to all the port pins. This is

    normally done by the instruction @48TBJ.

    8() M#2 A"L-''F A Q ''M#2 P-"A make P- an input port

    PORT 0:

    Port - is an +5bit $%# port with dual purpose. $f e(ternal memory is used" these port pins are usedfor the lower address byte address%data 6A&-5A&?7" otherwise all bits of the port are either input

    or output.. nlike other ports" Port - is not provided with pull5up resistors internally"so for

    P#!T- pull5up resistors of nearly ,-k are to be connected e(ternally as shown in the fig.;.Da$ !"$% "/ ("!t 0) Port - can also be used as address%data bus6A&-5A&?7" allowing it to be

    used for both address and data. Ghen connecting the +-, to an e(ternal memory" port -

    provides both address and data. The +-, multiple(es address and data through port - to save the

    pins. A38 indicates whether P- has address or data. Ghen A38 Q -" it provides data &-5&?" andwhen A38 Q, it provides address and data with the help of a ?

  • 8/13/2019 8051mc Notes Industrial Electronics

    17/32

    P"!t 1:Port , occupies a total of + pins 6pins , through +7. $t has no dual application and acts

    only as input or output port. $n contrast to port -" this port does not need any pull5up resistors

    since pull5up resistors connected internally. pon reset" Port , is configured as an output port. Toconfigure it as an input port" port bits must be set i.e a high bit must be sent to all the port pins.

    This is normally done by the instruction @48TBJ.

    'or 8( )M#2 A" L-''F AQ'' F80

    M#2 P,"A make P, an input port by writing ,s to all of its pins

    P"!t ;:Port ; is also an eight bit parallel port. 6pins ;,5 ;+7. $t can be used as input or outputport. As this port is provided with internal pull5up resistors it does not need any e(ternal pull5up

    resistors. pon reset" Port ; is configured as an output port. $f the port is to be used as input port"all the port bits must be made high by sending '' to the port. 'or e("

    M#2 A" L-''F AQ'' he(

    M#2 P;" A make P;an input port by writing all ,s to it

    Da$ !"$% "/ ("!t ;) Port; lines are also associated with the higher order address lines A+5A,.

    $n systems based on the +?," +:," and &4---" Port; is used as simple $%# port. But" in +-=,5

    based systems" port ; is used along with P- to provide the ,*5bit address for the e(ternal

    memory. 4ince an +-=, is capable of accessing *

  • 8/13/2019 8051mc Notes Industrial Electronics

    18/32

    they are provided internally similar to the case of Port; D Port ,. pon reset port = is configured

    as an output port . $f the port is to be used as input port" all the port bits must be made high by

    sending '' to the port. 'or e("

    M#2 A" L-''F AQ '' he(

    M#2 P=" A make P=an input port by writing all ,s to it

    A$t%!#at% F#ti"#s "/ P"!t 4:P=.- and P=., are used for the !(& 6!eceive &ata7 and T(&6Transmit &ata7 serial communications signals. Bits P=.; and P=.= are meant for e(ternal

    interrupts. Bits P=.< and P=. are used for Timers - and , and P=.* and P=.? are used to provide

    the write and read signals of e(ternal memories connected in +-=, based systems

    S*N" P"!t 4 2it Pi# N" F#ti"#

    , P=.- ,- !(&

    ; P=., ,, T(&

    = P=.; ,;

    < P=.= ,=

    P=.< ,< T-

    * P=. , T,

    ? P=.* ,*

    + P=.? ,?

    Ta2$%: PORT 4 a$t%!#at% /#ti"#s

    I#t%!!(t St!t!%) An interrupt is an e(ternal or internal event that disturbs themicrocontroller to inform it that a device needs its service. The program which is associated with

    the interrupt is called the i#t%!!(t s%!i% !"ti#%6$4!7 or i#t%!!(t ha#-$%!. pon receiving

    the interrupt signal the Microcontroller" finish current instruction and saves the PC on stack.

    Sumps to a fi(ed location in memory depending on type of interrupt 4tarts to e(ecute theinterrupt service routine until !8T$ 6return from interrupt7 pon e(ecuting the !8T$ the

    microcontroller returns to the place where it was interrupted. et pop PC from stack

    The +-, microcontroller hasFI6E interrupts in addition to !eset. They are

    Timer - overflow $nterrupt

    Timer , overflow $nterrupt

    8(ternal $nterrupt -6$T-7

    8(ternal $nterrupt ,6$T,7

    INDUSTRIAL ELECTRONICS ,+

  • 8/13/2019 8051mc Notes Industrial Electronics

    19/32

    4erial Port events 6buffer full" buffer empty" etc7 $nterrupt

    8ach interrupt has a specific place in code memory where program e(ecution 6interrupt serviceroutine7 begins.

    8(ternal $nterrupt - ) ---= F

    Timer - overflow ) ---B F

    8(ternal $nterrupt , ) --,= F

    Timer , overflow ) --,B F

    4erial $nterrupt ) -;= F

    pon reset all $nterrupts are disabled D do not respond to the Microcontroller. These interrupts

    must be enabled by software in order for the Microcontroller to respond to them. This is done by

    an +5bit register called $nterrupt 8nable !egister 6$87.

    I#t%!!(t E#a2$% R%)ist%! :

    8A ) lobal enable%disable. To enable the interrupts this bit must be set Figh.

    555 ) ndefined5reserved for future use.

    8T; ) 8nable %disable Timer ; overflow interrupt.

    84 ) 8nable%disable 4erial port interrupt.

    8T, ) 8nable %disable Timer , overflow interrupt.

    80, ) 8nable%disable 8(ternal interrupt,.

    8T- ) 8nable %disable Timer - overflow interrupt.

    80- ) 8nable%disable 8(ternal interrupt-

    pon reset the interrupts have the following priority.6Top to down7. The interrupt with thehighest P!$#!$T gets serviced first.

    ,. 8(ternal interrupt - 6$T-7

    ;. Timer interrupt- 6T'-7

    =. 8(ternal interrupt , 6$T,7

    INDUSTRIAL ELECTRONICS ,:

  • 8/13/2019 8051mc Notes Industrial Electronics

    20/32

  • 8/13/2019 8051mc Notes Industrial Electronics

    21/32

  • 8/13/2019 8051mc Notes Industrial Electronics

    22/32

    PIN Dia)!a. "/ 8051 Mi!""#t!"$$%!: The +-, microcontroller is available as a

  • 8/13/2019 8051mc Notes Industrial Electronics

    23/32

    6not applicable for +-,7

    !8 4C#.< !eceive enable. 4et or cleared by making this bit

    either , or - foe enable %disable reception.

    TB+ 4C#.= :thdata bit transmitted in modes ; and =

    !B+ 4C#.; :thdata bit received in modes ; and =.it is notused in mode - D mode ,.$f 4M; Q - !B+ is the

    stop bit .

    T$ 4C#., Transmit interrupt flag

    !$ 4C#.- !eceive interrupt flag.

    M-" 4M, )These two bits of 4C# register determine the framing of data by specifyingthe number of bits per character and start bit and stop bits. There are < serial modes.

    4M- 4M,

    - - ) 4erial Mode -

    - , ) 4erial Mode ," + bit data" , stop bit" , start bit

    , - ) 4erial Mode ;

    , , ) 4erial Mode =

    !8 6!eceive 8nable7 also referred as 4C#.

  • 8/13/2019 8051mc Notes Industrial Electronics

    24/32

    P$ &84C!$PT$#

    RST) The !848T pin is an input pin and it is an active high pin. Ghen a high pulse is applied tothis pin the microcontroller will reset and terminate all activities. pon reset all the registers

    e(cept PC will reset to ---- 2alue and PC register will reset to ---? value.

    =E?t%!#a$ A%ss>: This pin is an active low pin. This pin is connected to ground when

    microcontroller is accessing the program code stored in the e(ternal memory and connected to

    2cc when it is accessing the program code in the on chip memory. This pin should not be leftunconnected.

    =P!")!a. St"!% E#a2$%>: This is an output pin which is active low. Ghen themicrocontroller is accessing the program code stored in the e(ternal !#M" this pin is connected

    to the #8 6#utput 8nable7 pin of the !#M.

    INDUSTRIAL ELECTRONICS ;

  • 8/13/2019 8051mc Notes Industrial Electronics

    25/32

    ALE =A--!%ss $ath %#a2$%>: This is an output pin" which is active high * Ghen connected to

    e(ternal memory " port - provides both address and data i.e address and data are multiple(ed

    through port - .This A38 pin will demultiple( the address and data bus .Ghen the pin is Figh "the A& bus will act as address bus otherwise the A& bus will act as &ata bus.

    P0*09 P0*=AD09AD> : The port - pins multiple(ed with Address%data pins .$f themicrocontroller is accessing e(ternal memory these pins will act as address%data pins otherwise

    they are used for Port - pins.

    P;*09 P;*=A89A15> : The port; pins are multiple(ed with the higher order address pins*Ghen

    the microcontroller is accessing e(ternal memory these pins provide the higher order address

    byte otherwise they act as Port ; pins.

    P1*09 P1* : These +5pins are dedicated for Port, to perform input or output port operations.

    P4*09 P4* :These +5pins are meant for Port= operations and also for some control operationslike !ead"Grite"Timer-"Timer, "$T-"$T, "!(& and T(&

    ADDRESSIN@ MODES OF 8051:

    The way in which the data operands are accessed by different

    instructions is known as the addressing modes. There are various methods of denoting the dataoperands in the instruction. The +-, microcontroller supports mainly addressing modes. They

    are

    1* I..%-iat% a--!%ssi#) ."-%

    ;* Di!%t A--!%ssi#) ."-%

    4* R%)ist%! a--!%ssi#) ."-%

    * R%)ist%! I#-i!%t a--!%ssi#) ."-%

    5* I#-%?%- a--!%ssi#) ."-%

    I..%-iat% a--!%ssi#) ."-%: The addressing mode in which the data operand is a constant andit is a part of the instruction itself is known as $mmediate addressing mode. ormally the data

    must be preceded by a L sign. This addressing mode can be used to transfer the data into any of

    the registers including &PT!.

    8() M#2 A" L ;? F ) The data 6constant7 ;? is moved to the accumulator register

    A&& !,"L

  • 8/13/2019 8051mc Notes Industrial Electronics

    26/32

    &irect addressing mode. The direct addressing mode uses the lower ,;+ bytes of $nternal !AM

    and the 4'!s

    M#2 !," e is ,:.=m2 62%;7. The time taken by the A&C to convert analog data into

    digital form depends on the freIuency of clock source. The conversion time of A&C -+-< isaround ,,-us. To use the internal clock a capacitor and resistor are used as shown in the circuit.

    The input to the A&C is given from a regulated power supply and a ,- potentiometer

    INDUSTRIAL ELECTRONICS ;*

  • 8/13/2019 8051mc Notes Industrial Electronics

    27/32

    The 8051 Microcontroller i !e" to #ro$i"e the control i%n&l to the ADC. CS'chi# elect( #ino) ADC i "irectl* connecte" to %ro!n". The #in P1.1+ P1.0 &n" P1., &re connecte" to the #in-R+ RD &n" INTR o) the ADC re#ecti$el*. -hen the in#!t $olt&%e )ro the #reet i $&rie" theo!t#!t o) ADC $&rie &lo $&rie.

    'rom the circuit it is clear that the A&C interfaced directly to the microcontroller. The Port, is

    used as an input port which receives the digital data from the A&C.Port pins P;. and P;.* are

    used for 4#C and 8#C operation.Ghen the conversion is over the A&C will send an interruptsignal to the microcontroller through the pin P;.? .ow the Microcontroller receives digital data

    through the Port,.This data after conversion to decimal data is displayed on the 3C& module .

    The assembly language program for A&C is given below .

    M#2 P, " -'' F Make the port, high and configure port, as $nput port

    +ACK) C3! P;.* ) eneration of 4#C pulse

    48TB P;.

    LOOP SB P;.? " 3##P Gait for conversion" $s conversion overV

    C3! P;. 8nable !ead the digital data

    INDUSTRIAL ELECTRONICS ;?

  • 8/13/2019 8051mc Notes Industrial Electronics

    28/32

    M#2 A "P, !ead digital data through Port,

    48TB P;. &isable read after read operation

    CA33 &$4P3A &isplay the data on 3C& module

    4SMP BAC Continue the conversion process

    80519SERIAL COMMUNICATION :

    +asis "/ S%!ia$ "..#iati"#

    &ata transfer between two electronic devices 68( Between a computer and microcontroller or aperipheral device7 is generally done in two ways

    6i7.4erial data Transfer and

    6ii7.Parallel data Transfer

    4erial communication uses only one or two data lines to transfer data and is generally used forlong distance communication. $n serial communication the data is sent as one bit at a time in a

    timed seIuence on a single wire. 4erial Communication takes place in two methods"

    Asynchronous data Transfer and 4ynchronous data Transfer.

    S%!ia$ Data T!a#s/%!

    As

  • 8/13/2019 8051mc Notes Industrial Electronics

    29/32

    be sent" and to force the clock in the receiver into synchroni>ation with the clock in the

    transmitter.

    S%!ia$ -ata t!a#s.issi"#

    After the 4tart Bit" the individual bits of the word of data are sent .Fere each bit in the word is

    transmitted for e(actly the same amount of time as all of the other bits. Ghen the entire dataword has been sent" the transmitter may add a Parity Bit that the transmitter generates. The Parity

    bit may be used by the receiver to perform simple error checking. Then at least one 4top Bit issent by the transmitter. $f the 4top Bit does not appear when it is supposed to" the A!Tconsiders the entire word to be corrupted and will report a 'raming 8rror.

    Baud rate is a measurement of transmission speed in asynchronous communication " it represents

    the number of bits%sec that are actually being sent over the serial link. The Baud count includesthe overhead bits 4tart" 4top and Parity that are generated by the sending A!T and removed by

    the receiving A!T.

    $n the S

  • 8/13/2019 8051mc Notes Industrial Electronics

    30/32

    S*N" S%!ia$ C"..#iati"# Pa!a$$%$ C"..#iati"#

    , &ata is transmitted bit after the bit in a

    single line

    &ata is transmitted simultaneously

    through group of lines6Bus7

    ; &ata congestion takes place o" &ata congestion

    = 3ow speed transmission Figh speed transmission

    < $mplementation of serial links is not an

    easy task.

    Parallel data links are easily

    implemented in hardware

    . $n terms of transmission channel costssuch as data bus cable length" data bus

    buffers" interface connectors" it is less

    e(pensive

    $t is more e(pensive

    * o " crosstalk problem Crosstalk creates interference between

    the parallel lines.

    ? o effect of inter symbol interference andnoise

    Parallel ports suffer e(tremely frominter5symbol interference 6$4$7 and

    noise" and therefore the data can be

    corrupted over long distances.

    + The bandwidth of serial wires is muchhigher.

    The bandwidth of parallel wires is muchlower.

    : 4erial interface is more fle(ible to

    upgrade+ without changing the hardware

    Parallel data transfer mechanism rely on

    hardware resources and hence notfle(ible to upgrade.

    ,- 4erial communication work effectivelyeven at high freIuencies.

    Parallel buses are hard to run at highfreIuencies.

    INTERFACIN@ DAC 98051 MICROCONTROLLER

    The DAC 0800 i & i#le onolithic 8/it DA con$erter. It h& )&t ettlin% tie o) 100n. Itc&n e "irectl* inter)&ce" to TTL+ CMOS+ PMOS &n" other. It o#er&te &t 2.53 to 4183 !##l*.

    The n!er o) "&t& it in#!t "eci"e the reol!tion o) the DAC ince the n!er o) &n&lo%o!t#!t le$el i e!&l to ,+ 6here n i the n!er o) "&t& it in#!t. There)ore+ &n 8/in#!t DAC!ch & the DAC0808 #ro$i"e ,5 "icrete $olt&%e 'or c!rrent( le$el o) o!t#!t.

    The interfacing circuit is shown below. port ,6+ bits of the microcontroller is connected to the

    input data lines of &AC5-+.The reference current is determined by the resistor !, and the

    reference voltage 2 ref. The resistor !;is generally eIual to !, to match the input impedance ofreference source. The output 6taken from pin number < is observed either on a digital multimeter

    or on a cathode ray oscilloscope.

    INDUSTRIAL ELECTRONICS =-

  • 8/13/2019 8051mc Notes Industrial Electronics

    31/32

    The o!t#!t c!rrent Io i c&lc!l&te" & )ollo6:

    $oQ 2ref%!,WAo%; H A,%< H A;%+ H 1 HA?%;*X

    The o!t#!t $olt&%e 3o i ot&ine" & )ollo6: 3oIo 9 R1

    Ass%.2$< La#)a)% P!")!a.

    MO3 A+ DATA9 ; 'A( D&t&

    START : MO3 MP START ; Re#e&t

    555555555555555555555(((555555555555555555555

    REFERENCE )

    ,. Muhammed Ali Ma>idi" Sanice illies Pie Ma>idi" @The +-,Microcontroller and 8mbedded 4ystemsJY Pearson

    8ducationAsia.

    ;. Ayala" The Microcontroller =!&edition. Thomson $ndia.

    INDUSTRIAL ELECTRONICS =,

  • 8/13/2019 8051mc Notes Industrial Electronics

    32/32

    P!%(a!%- 2< : Sa#tha# S

    Assista#t P!"/%ss"!

    D%(a!t.%#t "/ ECE

    YIT, Ka##a#a$$""!