You are on page 1of 35

EMBEDDED SYSTEM DESIGN

LAB MANUAL OF MCES LAB

INDEX
S.No. Experiment Performed Study of Universal Motherboard & !"1 & P#$ Mi%ro%ontroller Daughter &oard along 'ith Development (ool )Environment of *eil soft'are for Mi%ro%ontroller programming. ,-P to generate 1! *./ S0uare 1ave 'ithout interrupt. +. ,-P to generate 1! *./ S0uare 1ave using interrupt. 2. 3. 4a51rite an ,-P to add + numbers and display the result on -EDS in &inary form. 4b51rite an ,-P to subtra%t + numbers and display the result on -EDS in &inary form. 4%51rite an ,-P to multiply t'o numbers and Display the result on Ports. 4d51rite an ,-P to ma6e -EDs blin6 at a fre0uen%y of 1./su%h that 'hen -ED 1 is on7 -ED + is off and vi%e versa. 4e51rite an ,-P to display alternate -EDS. 4f51rite a program of flashing -EDs %onne%ted at port 1 of the mi%ro%ontroller. 1rite an ,-P to display Embedded System Design on 1r intelligent -$D display 1rite an ,-P to display series of numbers on seven segment display. ,-P for P1M based Speed $ontrol of D$)Stepper Motor using !"1 Mi%ro%ontroller. ,-P for (raffi% -ight $ontroller using !"1 Mi%ro%ontroller. ,-P for (emperature Measurement & to display (emperature on -$D display. ,-P for ,utomati% Motion of a $ar. Date Signature 1.

". 8. 9. . :. 1!.

Experiment No: 1
UNIVERSAL Board has on board 4a5 ,D$ se%tion. 4b5 ;($ & EEP;<M se%tion. 4%5 D#SP-,= 4-$D7 -ED7 & 9>SE?5 se%tion. 4d5 #NPU( S1#($.ES 4PUS. &U((<N & D#P S1#($.5 se%tion. 4f5;E-,= se%tion. 4e5 &U@@E; se%tion ERI !ERALS RE%UIRE&EN'S Part No. Spe%ifi%ations "#ER SU L$

,D$! !:$$N >&#( >$.,NNE-7 1!!s. DS12!9 83A 7 SE;#,- #+$ ;eal (ime $lo%6. +3$!3 3* serial EEP;<M. -$D 18 x + %hara%ter -$D &U@@E; "B ;E-,= ",)+"!B ,$

Boltage ;ating H)> " B H)> 1+B

$urrent ;ating 1, 1,

P.#-#PS 4P :$"1;D+&N5

D,U?.(E; &<,;D
(EA'URES C :$"1 $entral Pro%essing Unit C <n>%hip Dlash Program Memory 'ith #n>System Programming 4#SP5 and #n> ,ppli%ation Programming 4#,P5 %apability C &oot ;<M %ontains lo' level Dlash programming routines for do'nloading via the U,;( C $an be programmed by the end>user appli%ation 4#,P5 C Parallel programming 'ith 9$"1 %ompatible hard'are interfa%e to programmer C Supports 8>%lo%6)1+>%lo%6 mode via parallel programmer 4default %lo%6 mode after $hipErase is 1+>%lo%65 C 8>%lo%6)1+>%lo%6 mode Dlash bit erasable and programmable via #SP C 8>%lo%6)1+>%lo%6 mode programmable Eon>the>flyF by SD; bit C Peripherals 4P$,7 timers7 U,;(5 may use either 8>%lo%6 or 1+>%lo%6 mode 'hile the $PU is in 8>%lo%6 mode C Speed up to +! M./ 'ith 8>%lo%6 %y%les per ma%hine %y%le 43! M./ e0uivalent performan%e5G up to 22 M./ 'ith 1+ %lo%6s per ma%hine %y%le C Dully stati% operation C ;,M expandable externally to 83 6bytes C Dour interrupt priority levels C Seven interrupt sour%es C Dour >bit #)< ports

C Dull>duplex enhan%ed U,;( I Draming error dete%tion I ,utomati% address re%ognition C Po'er %ontrol modes I $lo%6 %an be stopped and resumed I #dle mode I Po'er do'n mode C Programmable %lo%6>out pin C Se%ond DP(; register C ,syn%hronous port reset C -o' EM# 4inhibit ,-E5 C Programmable $ounter ,rray 4P$,5 I P1M I $apture)%ompare

UN#BE;S,- &<,;D

ANAL") '" DI)I'AL *"NVER'ER +AD*,-,./


(eat0res:
Easy interfa%e to all mi%ropro%essors <perates ratio metri%ally or 'ith " BD$ or analog span adJusted voltage referen%e No /ero or full>s%ale adJust re0uired >%hannel multiplexer 'ith address logi% !B to "B input range 'ith single "B po'er supply <utputs meet ((- voltage level spe%ifi%ations ,D$! ! e0uivalent to MM93$:3: ,D$! !: e0uivalent to MM93$:3:>1 ;esolution &its (otal UnadJusted Error K1L+ -S& and K1 -S& Single Supply " BD$ -o' Po'er 1" m1 $onversion (ime 1!!

1e2 Spe3i4i3ations

*IR*UI' DIA)RA& ("R AD*

$<N(;<- & $.,NNESE-E$( -#NES D#?#(,- <U(PU(

*IR*UI' DIA)RA& ("R DIS LA$ SE*'I"N


*"N'R"L DA'A

LED DIS LA$ SE*'I"N

*IR*UI' DIA)RA& ("R S'E

ER &"'"R

Stepper motor

*IR*UI' DIA)RA& ("R RELA$ SE*'I"N

RL6

RL1

Externa5 16 V S0pp52

8.=V Batter2 *IR*UI' DIA)RA& ("R R'* 7 E6 R"&

86.9=- *r2sta5

S:0are ;a<e o0tp0t

R'* 7 S#I'*!

$onne%tors

R'* 7 E6 R"&
R'* DS18,9 (EA'URES

;eal>time %lo%6 4;($5 %ounts se%onds7 minutes7 hours7 date of the month7 month7 day of the 'ee67 and year 'ith leap>year %ompensation valid up to +1!! "8>byte7 battery>ba%6ed7 nonvolatile 4NB5 ;,M for data storage ('o>'ire serial interfa%e Programmable s0uare 'ave output signal ,utomati% po'er>fail dete%t and s'it%h %ir%uitry

$onsumes less than "!!n, in battery ba%6up mode 'ith os%illator running <ptional industrial temperature rangeM >3!N$ to H "N$ ,vailable in >pin D#P or S<#$ Under'riters -aboratory 4U-5 re%ogni/ed

E6 R"& 6>*,> (EA'URES -o'>voltage and Standard>voltage <peration I +.9 4B$$ O +.9B to "."B5 I 1. 4B$$ O 1. B to "."B5 #nternally <rgani/ed 1+ x 41*57 +"8 x 4+*57 "1+ x 43*57 1!+3 x 4 *5 or +!3 x 418*5 +>'ire Serial #nterfa%e S%hmitt (rigger7 Diltered #nputs for Noise Suppression &i>dire%tional Data (ransfer Proto%ol 1!! 6./ 41. B5 and 3!! 6./ 4+."B7 +.9B7 "B5 $ompatibility 1rite Prote%t Pin for .ard'are Data Prote%tion >byte Page 41*7 +*57 18>byte Page 43*7 *7 18*5 1rite Modes Partial Page 1rites are ,llo'ed Self>timed 1rite $y%le 4" ms max5 .igh>reliability I Enduran%eM 1 Million 1rite $y%les I Data ;etentionM 1!! =ears ,utomotive ?rade7 Extended (emperature and -ead>Dree Devi%es ,vailable

P#$ 18D 99, D;,U?.(E; $,;D

(EA'URES:?
!i@h? er4orman3e RIS* * UM A <nly 2" single>'ord instru%tions to learn C ,ll single>%y%le instru%tions ex%ept for program bran%hes7 'hi%h are t'o>%y%le C <perating speedM D$ I +! M./ %lo%6 input D$ I +!! ns instru%tion %y%le C Up to * x 13 'ords of Dlash Program Memory7 Up to 28 x bytes of Data Memory 4;,M57 Up to +"8 x bytes of EEP;<M Data Memory C Pinout %ompatible to other + >pin or 3!)33>pin P#$18$AAA and P#$18DAAA mi%ro%ontrollers eriphera5 (eat0res: A (imer!M >bit timer)%ounter 'ith >bit pres%aler C (imer1M 18>bit timer)%ounter 'ith pres%aler7 %an be in%remented during Sleep via external %rystal)%lo%6 C (imer+M >bit timer)%ounter 'ith >bit period register7 pres%aler and posts%aler C ('o $apture7 $ompare7 P1M modules > $apture is 18>bit7 max. resolution is 1+." ns > $ompare is 18>bit7 max. resolution is +!! ns > P1M max. resolution is 1!>bit

C Syn%hronous Serial Port 4SSP5 'ith SP#P 4Master mode5 and #+$P 4Master)Slave5 C Universal Syn%hronous ,syn%hronous ;e%eiver (ransmitter 4US,;()S$#5 'ith :>bit address dete%tion C Parallel Slave Port 4PSP5 I bits 'ide 'ith external ;D7 1; and $S %ontrols 43!)33>pin only5 C &ro'n>out dete%tion %ir%uitry for &ro'n>out ;eset 4&<;5 Ana5o@ (eat0res: A 1!>bit7 up to >%hannel ,nalog>to>Digital $onverter 4,)D5 C &ro'n>out ;eset 4&<;5 C ,nalog $omparator module 'ithM > ('o analog %omparators > Programmable on>%hip voltage referen%e 4B;ED5 module > Programmable input multiplexing from devi%e inputs and internal voltage referen%e > $omparator outputs are externally a%%essible Spe3ia5 &i3ro3ontro55er (eat0res: A 1!!7!!! erase)'rite %y%le Enhan%ed Dlash program memory typi%al C 17!!!7!!! erase)'rite %y%le Data EEP;<M memory typi%al C Data EEP;<M ;etention Q 3! years C Self>reprogrammable under soft'are %ontrol C #n>$ir%uit Serial ProgrammingP 4#$SPP5 via t'o pins C Single>supply "B #n>$ir%uit Serial Programming C 1at%hdog (imer 41D(5 'ith its o'n on>%hip ;$ os%illator for reliable operation C Programmable %ode prote%tion C Po'er saving Sleep mode C Sele%table os%illator options C #n>$ir%uit Debug 4#$D5 via t'o pins $M<S (e%hnologyM C -o'>po'er7 high>speed Dlash)EEP;<M te%hnology C Dully stati% design C 1ide operating voltage range 4+.!B to "."B5 C $ommer%ial and #ndustrial temperature ranges C -o'>po'er %onsumption

)enera5 ro3ed0res 4or -,B1 mi3ro3ontro55ers


1. +. 2. 3. ". 8. Double $li%6 on the i%on *E#- uB#S#<N 2 present on the des6top. (he follo'ing 'indo' 'ill be popped>up sho'ing uB#S#<N 2. $lose the existing ProJe%t if exists. ?o to the proJe%t & %li%6 on ne' proJe%t. Ma6e a folder on des6top & give file name e.g 4xy/.asm5 or 4xy/.%5. 'hen you %li%6 on the save button 7follo'ing 'indo' opens sho'ing RSele%t Devi%e for (arget 1S. 9. Sele%t Philips & P :%"1;D+xx mi%ro%ontroller and then %li%6 <*. . (hen sele%t N< on the pop>up given belo'. :. (hen ma6e a Ne' Dile. 1!.1rite or %opy your %ode there & save it 'ith extension .% or .asm depending on your %oding 4xy/.asm5. 11.?o to target & then sour%e group7 right %li%6 on there & %li%6 on the option E,dd Diles to the ?roupSSour%e ?roup 1S F. 1+.Sele%t your asm or % file 'hi%h you 'ant to add.4xy/.asm5 and then add. 12.;ight %li%6 (arget 1. ?o to the option for target7 %li%6 on output &ti%6 on %reate hex file option and then <*. 13.No' %li%6 on E(ranslate %urrent fileF7 E&uild (argetF and E;ebuilt all target filesF. 1".#t 'ill sho' you ! errors & ! 'arning on <utput 1indo'.

,fter performing all these steps the %hip 'ill be %onfigured through E$E D-,S. .

.o' to use E$E flash


1. , 'indo' 'ill be popped>up +. Set baud rate :8!! 7sele%t 'or6ing %omport of P$ to hard'are and soft'are %ommuni%ation 2. No' sele%t hex file to burn in %hip through bro'se option and open. 3. $li%6 on flash option reset hard'are mi%ro%ontroller 'ill appear . ". No' press reset s'it%h on hard'are board and flash 'ill burn 'ith ">8 Se%onds. 8. ,gain press reset s'it%h on hard'are board to run your program or to see output.

)enera5 ro3ed0res 4or I* 1=(-99A mi3ro3ontro55ers 1. Double $li%6 on the i%on S<U;$E &<<S( #DE present on the des6top. +. (hen a 'indo' 'ill be popped>up 2. No' go to settings and sele%t target. , dialog box 'ill appear7 in this dialog box sele%t our %ontroller named P#$18D 99,7 then %li%6 o6. 3. No' go to settings and sele%t toolsuit. , dialog box 'ill again appear7 in this dialog box sele%t C2C-plus7 and then %li%6 o6 ". No' go to settings and sele%t options. , dialog box 'ill again appear 'ith a display name C2C-plus compiler option7 no' sele%t tools7 no' go to assembler option and %hoose 8. No' go to proJe%ts and sele%t ne'7 no' spe%ify the path 'here you 'ant to save your proJe%t and name7 %li%6 o6. 9. , pop up box 'ill appear you may sele%t Eempty or with empty source fileF and %li%6 o6.

. No' 'rite your program . ,fter you had 'ritten your program go to build and first sele%t %ompilers then assembler then build. ,ny error or 'arning 'ill be displayed in the dialog box.
,fter performing all these steps the %hip 'ill be %onfigured through PPPv2 .

.o' to use PPPv2


1. No' after you had su%%essfully %reated your ..ex file you 'ould use an P#$ programmer %alled EPPPv2F. Double $li%6 on the i%on present on the des6top. +. No' go to options and sele%t options then sele%t version + and %li%6 o6. 2. ,fter that go to options and sele%t %onfigure P#$ mi%ro%ontroller and do the follo'ing displayed settings. 3. ,fter that %hoose your hex file and sele%t send to P#$ mi%ro%ontroller.

Experiment No: 6
AI& : AL to @enerate 1, 1!C s:0are ;a<e ;itho0t interr0pts . ro@ram: <;? !!!!. M<B (M<D7 T1!. ,?,#NM M<B (-17 T!D+. M<B (.17 T!DD. SE(& (;1 &,$*M UN& (D17 &,$* $-; (;1 $P- P+.2 $-; (D1 SUMP ,?,#N

G timer 17 mode 1 418>bit5 G (-1OD+7 lo' byte G (.1ODD7 high byte G start the timer 1 G stay until timer rolls over G stop timer 1 G%omp. P+.2 to get hi7 lo G %lear timer flag1 G reload timer sin%e mode1 G is not auto>reload

END

Experiment No: 6
AI& : AL to @enerate 1, 1!C s:0are ;a<e ;itho0t interr0pts .

L")I*M Dor generation of s0uare 'ave7 'e firstly %onfigure timer 1 to operate
in mode 17 then load 18 I bit value DDD+. in (- &(. register7 after 'hi%h the timer must be started by SE(& instru%tion. ,s the timer is started 7it %ounts up until it rea%hes its time limit of DDDD. 7 'hen over flo's 7 it sets high a flag bit %alled timer Dlag 4(D5.&y monitoring timer Dlag. (imer %an be stopped by using $-; (;1. (hen output on port + is %omplemented to generate s0uare 'ave. (hen timer flag is %omplemented to generate s0uare 'ave .(hen timer flag is %leared and loop is rotated to %ontinue generation of s0uare 'ave.

Experiment No: 8
AI& : AL to @enerate a s:0are ;a<e o4 1, 1!C 4re:0en32 0sin@ Interr0pts. ro@ram: <;? !!!!. -UMP M,#N G by>pass interrupt ve%tor table

G#S; for (imer ! to generate s0uare 'ave <;? !!!&. G (imer ! interrupt ve%tor table $P- P+.2 G toggle P+.2 pin M<B (-!7T !D+. G (-!OD+7 lo' byte of timer M<B (.!7T !DD. G (-!ODD7 .i byte ;E(# G return from #S; G(he main program for initiali/ation M,#NM <;? !!2!. M<B (M<D7 T !1. M<B (-!7T!D+. G after ve%tor table spa%e G (imer !7 mode 1 G (-!OD+7 lo' byte of timer

.E;EM

M<B (.!7T!DD. M<B #E7 T +. SE(& (;! SUMP .E;E END

G (.!ODD7 .igh byte of timer G #EO 1!!!!!1! 4bin5 enable (imer ! G Start timer !

Experiment No: 8
AI& M #rite an AL to @enerate a s:0are ;a<e o4 1, 1!C 4re:0en32 0sin@
interr0pts.

L")I* M Dor generation of 1! *./ s0uare 'ave 'e firstly ma6e our program
exe%ute at M,#N 'hi%h starts beyond #N( ve%tor spa%e .M,#N initiali/es timer ! and sets it for the mode17timer operation M,#N then enables timer ! interrupted by initiali/ing #E to 1!!!!!1! then it Just it Just 'aits around letting the interrupt routine to do the 'or6. (imer ! is loaded 'ith value DDD+ . to generate s0uare 'ave of 1!6h/.#f the timer #N( in #E register is enabled7 'henever (D is raised. (he mi%ro%ontroller is interrupted and Jumps to interrupt ve%tor table to servi%e #S; .(he !"1 mi%ro%ontroller 'ill %he%6 for the %ondition automati%ally and

'hen %ondition is satisfied7 'ill Jump to a subroutine7 exe%ute the %ode7 then return. #n this %ase subroutine 'ill %omplement the output at port 1.+7 then ;E(1 instru%tion else !"1 mi%ro%ontroller that interrupt routine has finished.

N"'E 1: 1hen using <;? !!!!. in the very first line then mi%ro%ontroller
upon 'a6e up go to M,#N7 'here <;? !!!!. entry address for !"1 ;ESE(.

N"'E 6: 1hen using SUMP !!!&. 'hi%h is repla%ed by <;? !!!&.7 it is a


start of #S; for timer ! to generate s0uare 'ave.

N"'E 8: 1hen using SUMP !!2!&. 'hi%h is repla%ed by <;? !!2!&.7 it is


a start of main program for initiali/ation.

Experiment No: ? >+a/


AI&: #rite an AL to add 6 n0mbers and disp5a2 the res05t on LEDS in
Binar2 4orm. mov mov add Mov hereM sJmp end a7T!3h r17T!". a7;1 P!7a here

Experiment No: ? >+a/


AI&: #rite an AL to add 6 n0mbers and disp5a2 the res05t on LEDS in
Binar2 4orm.

L")I*M
#n this program7 'e 'ill use mi%ro %ontroller for addition of t'o numbers and displaying the result on -EDS provided on 6it. #n this program port ! is used as output port. Dor example in above program t'o inputs are ta6en as !3 and !" and result is moved to port !.

Experiment No: ? >+b/


AI&: #rite an AL to s0btra3t 6 n0mbers and disp5a2 the res05t on LEDS
in Binar2 4orm. mov mov subb Mov hereM sJmp end a7T!:h r17T!". a7;1 P!7a here

Experiment No: ? >+b/


AI&: #rite an AL to s0btra3t 6 n0mbers and disp5a2 the res05t on LEDS
in Binar2 4orm.

L")I*M
#n this program7 'e 'ill use mi%ro %ontroller for subtra%tion of t'o numbers and displaying the result on -EDS provided on 6it. #n this program port ! is used as output port. Dor example in above program t'o inputs are ta6en as !: and !" and result is moved to port !.

Experiment No: ? >+3/


AI&: #rite an AL to m05tip52 t;o n0mbers and Disp5a2 the res05t on
orts. mov mov mul mov a7T!2h b7T!3. ab p!7a

hereM sJmp here end

Experiment No: ? >+3/


AI&: #rite an AL to m05tip52 t;o n0mbers and Disp5a2 the res05t on
orts.

L")I*M
#n this program7 'e 'ill use mi%ro %ontroller for multipli%ation of t'o numbers and displaying the result on -EDS provided on 6it. #n this program port ! is used as output port. Dor example in above program t'o inputs are ta6en as !2 and !3 and result is moved to port !.

Experiment No: ?B+a/


AI&: #rite an AL
<;? M<B $-; $P$PM<B to maDe LEDs b5inD at a 4re:0en32 o4 1 !C s03h that ;hen LED1 is onE LED6 is o44 and <i3e <ersa. !!!!. (M<D7T1!. P+.2 P+.2 P+.3 ;27T13

?<(<M

Gtimer 17 mode 1 is sele%ted G%lear pin 2 of port + G%omplement port +.2 G%omplement port +.3 Gmove de%imal no. 13 in ;2 reg.

,?,#NM

M<B (-17T!!. M<B (.17T!!. SE(& (;1 UN& $-; $-; DUN@ SUMP END (D17&,$* (;1 (D1 ;27,?,#N ?<(<

Gtimer 1 is started G%lear timer 1 G%lear (D1 Gde%rement and Jump if ;2V! GJump to ?<(<

&,$*M

Experiment No: ? B+a/


AI&: #rite an AL
L")I*:?
#n this program 'e are s'i%hing <n one -ED and s'it%hing <DD another -ED simultaneously at the fre0uen%y of 1 ./. (his program is designed 'ithout the use of interrupt. #n this program7 'e ta6e input from the mi%ro%ontroller port + and %onne%t that port of -ED se%tion of the universal board. #n this7 de%imal no 13 is used to approximate the mi%ro%ontroller %y%le to 1 se%. to maDe LEDs b5inD at a 4re:0en32 o4 1 !C s03h that ;hen LED1 is onE LED6 is o44 and <i3e <ersa.

Experiment No: ? B+b/


AI&: #rite an AL o4 a5ternate s;it3hin@ o LEDFs one b2 one 3onne3ted at
port 6 o4 mi3ro3ontro55er. org !!!!. M<B (M<D7T1!. $-; P+.2 ?<(<M $P- P+.2 $P- P+.3

M<B ;27T13 ,?,#NM M<B (-17T!!. M<B (.17T!!. SE(& (;1 UN& (D17&,$* $-; (;1 $-; (D1 DUN@ ;27,?,#N SUMP ?<(<

&,$*M

END

Experiment No: ? B+b/


AI&: #rite an AL o4 a5ternate s;it3hin@ o LEDFs one b2 one 3onne3ted at
port 6 o4 mi3ro3ontro55er.

L")I*M
#n this program7 'e 'ill use the mi%ro %ontroller for s'it%hing the -EDS in alternate manner. .ere (imer 1 is used for this purpose. (he output is ta6en a%ross P<;( +. (imer 1 is used in mode 1.

Experiment No: ? =
AI&: #rite an AL o4 (5ashin@ LEDs 3onne3ted at port 1 o4 the
mi3ro3ontro55er.

startM mov a%all mov a%all

p17T!!h delay p17T!ffh delay

lJmp start DE-,=M M<B (M<D7T1!. M<B ;27T". ,?,#NM M<B (-17T! . M<B (.17T!1. SE(& (;1 &,$*M UN& (D17&,$* $-; (;1 $-; (D1 DUN@ ;27,?,#N ;E( END

Experiment No: ? =
AI&: #rite an AL o4 (5ashin@ LEDs 3onne3ted at port 1 o4 the
mi3ro3ontro55er.

L")I*M

#n this program7 'e 'ill use mi%ro %ontroller for flashing of -EDS provided on 6it. #n this program port 1 is used as output port. .ere timer 1 is used in mode 1 i.e. as a 18 bit timer.

Experiment No:? AI& : AL 4or stepperGd3 motor 3onne3ted at port , o4 the mi3ro3ontro55er. ro@ram:? <rg !!!!.

startM mov a%all mov a%all mov a%all mov a%all

p!7T!1h delay p!7T!+h delay p!7T!3h delay p!7T! h delay

G%all delay subroutine G%all delay subroutine G%all delay subroutine G%all delay subroutine

lJmp start DE-,=M M<B again1M ,?,#NM &,$*M M<B M<B M<B SE(& UN& $-; $-; dJn/ (M<D7T1!. ;27T" (-17T! . (.17T!1. (;1 (D17&,$* (;1 (D1 r27again G(imer 17 mode 1 is sele%ted

;E( END

Experiment No:? AI& : AL 4or stepperGd3 motor 3onne3ted at port , o4 the mi3ro3ontro55er. L")I*:?

#n a stepper motor7 'e have 3 'indings and ea%h one gets ex%ited at a time using mi%ro%ontroller. 1hen a first output %omes from a mi%ro%ontroller7 the first 'inding of a motor gets ex%ited and the rotor moves a step of :! degree. Similarly this pro%ess is repeated for se%ond7 third and fourth output of a mi%ro%ontroller and se%ond7 third and fourth 'inding of the motor gets ex%ited in the same manner and hen%e the motor rotates and %omplete its one %y%le.

Experiment No: 9
Aim: AL 4or 'emperat0re &eas0rement 7 to disp5a2 'emperat0re on L*D Disp5a2. ro@ram:

<rg !!!!h mov a7T2 h a%all %ommand a%all delay mov a7T!Eh a%all %ommand a%all delay mov a7T!1h a%all %ommand a%all delay mov a7T!8h a%all %ommand a%all delay mov a7T 3h a%all %ommand a%all delay mov a7TS(S a%all dataline a%all delay mov a7TSES a%all dataline a%all delay mov a7TSMS a%all dataline a%all delay mov a7TSPS a%all dataline a%all delay mov a7TSES a%all dataline a%all delay mov a7TS;S a%all dataline a%all delay mov a7TS,S a%all dataline a%all delay mov a7TS(S a%all dataline a%all delay

Ginitiali/e -$D + lines7 "A9 matrix G%all %ommand subroutine G%all delay subroutine Gdisplay on7 $ursor on G%all %ommand subroutine G%all delay subroutine G%lear -$D %ommand G%all %ommand subroutine G%all delay subroutine Gmove %ursor right G%all %ommand subroutine G%all delay subroutine Gfor%e %ursor to begin at "th segment71st line G%all %ommand subroutine G%all delay subroutine Gdisplay letter ( G%all dataline subroutine G%all delay subroutine Gdisplay letter E G%all dataline subroutine G%all delay subroutine Gdisplay letter M G%all dataline subroutine G%all delay subroutine Gdisplay letter P G%all dataline subroutine G%all delay subroutine Gdisplay letter E G%all dataline subroutine G%all delay subroutine Gdisplay letter ; G%all dataline subroutine G%all delay subroutine Gdisplay letter , G%all dataline subroutine G%all delay subroutine Gdisplay letter ( G%all dataline subroutine G%all delay subroutine

mov a7TSUS a%all dataline a%all delay mov a7TS;S a%all dataline a%all delay mov a7TSES a%all dataline a%all delay %ommand M mov p17a %lr p+.! %lr p+.+ setb p+.1 a%all delay %lr p+.1 ret delay M mov r37T!DDh next M mov r27T!DDh here M dJn/ r27here dJn/ r37next ret dataline M mov p17a setb p+.! %lr p+.+ setb p+.1 a%all delay %lr p+.1 ret end

Gdisplay letter U G%all dataline subroutine G%all delay subroutine Gdisplay letter ; G%all dataline subroutine G%all delay subroutine Gdisplay letter E G%all dataline subroutine

Experiment No: 9
Aim: AL 4or 'emperat0re &eas0rement 7 to disp5a2 'emperat0re on L*D Disp5a2. L")I*:

-M2" is a temp. sensor 2 pin #$. <utput 4pin no. 25 of -M 2" is ta6en & fed to external input U2:. No' short UP 28 &29 & adJust ;1!4(rim port5 to +."8 mB D$ 'hi%h is measured at pin no. 12&13 of ,D$ ! !:. No' %onne%t bit Digital Data port to -ED se%tion.

Note: *onne3tion detai5 $onne%t Mi%ro%ontroller Port>2 to UP>1 of (emperature $ard. $onne%t Mi%ro%ontroller Port>! to ,D$ #nput4,bove bit Digital data5 $onne%t Mi%ro%ontroller Port>1 to UP>+4Data5 of -$D Display. $onne%t Mi%ro%ontroller Port>+ to UP>"4$ontrol5 of -$D Display. $onne%t U2:4,bove trim port 5 to output of -M2" but ?ND of -M2" is not %onne%ted. $onne%t bit Digital Data port to -ED se%tion.

You might also like