SlideShare ist ein Scribd-Unternehmen logo
Gajjar Parth Sunilkmar
180420109009
ELE(M) 3rd
YR
Micro Processor & Micro Controller
May 2021
30th
April, 2021
INDEX PAGE
MPMC 180420109009
SR No. DESCRIPTION DATE
1. Study of Block Diagram and Pin diagram of 8051 microcontroller 08 Feb. 2021
2. Introduction to KEIL μVISION4 IDE, assembler, compiler, linker,
simulator, debugger and assembler directives
08 Feb. 2021
3.
Block Data Transfer:
1. Internal RAM to Internal RAM data Transfer
2. External RAM to Internal RAM data Transfer
3. Code Memory to Internal RAM data transfer
4. Reverse Block of Data in internal RAM
5. Data Transfer with overlapping addresses
15 Feb. 2021
4.
1. Finding Washing Machine and TV Set code from a set of data
2. Find the number of vowels from a string available in code
memory.
3. Separate ODD/Even Numbers
4.Separate POSITIVE/NEGATIVE Numbers
08 Mar. 2021
5.
Code Conversion & Multibyte deminal addition
1. Hex to ASCII conversion using subroutine
2. ASCII to Hex comversion
3. Hex to BCD digit Separation
4. BCD to Hex conversion
5. Multibyte decimal number addition
22 Mar. 2021
6.
Port Programming
1. Indicate the status of S/W pressed on LED
2. If S1 is pressed then display 55H and if S2 is pressed Display
0AAH.
29 Mar. 2021
7.
Timer Programming
1. Generate a Square wave of 1 kHz frequency on P1.0 pin using
timer-0 in mode-1.
2. Generate a Square wave of 1 kHz frequency on P1.0 pin using
timer-0 in mode-2.
3. Update and display real time second on port-0 using timer-0 in
mode-1
5 April. 2021
8.
Seven Segment Display
1. Draw an Interfacing scheme to interface four common
cathode seven-segment LEDs with 8051 and using this interfacing
scheme write an embedded 'C' program to dipslay passing year.
2. Write an embedded 'C' program that updates and displays
real-time second and minute on 4-digit common cathode seven
segment display
26 April 2021
9.
LCD Display Draw an Interfacing scheme to interface 20x2 LCD
display with 8051.
1. Write an embedded 'c' program that displays "-- Welcome To--
"in line-1 and "--SCET, SURAT--" in line-2 of LCD display.
2. Write an embedded ‘c’ program that updates and displays
Real-Time Clock data on LCD.
26 April 2021
10. Serial Communication 26 April 2021
INTRODUCTION TO
KEIL VISION IDE AND
OTHERS
NAME : Gajjar Parth Sunilkumar
Enrollment : 180420109009
Submitted To :
1. Dr. Nilesh Shah
2. Prof. Dimple Bhanabhagwanwala
Date Of Submission : 27th
February, 2021
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
AIM :
Introduction to KEIL μVISION4 IDE, assembler, compiler, linker, simulator,
debuggerand assembler directives. Study of software development cycle using KEIL
IDE.
INTRODUCTION TO KEIL μVISION4 IDE :
− The Keil C51 development tools offer numerous features and advantages that
help you to develop embedded applications quickly and successfully. Find out
more about the supported devices and the possible tool combinations available
for the different 8051 variants.
− The following block diagram shows the components involved in the build process.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
µVISION INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) :
− The µVision4 IDE is a window-based software development tool that combines
project management and a rich-featured editor with interactive error
correction, option setup, make facility, and on-line help.
− Use µVision4 to create source files and organize them into a project that
defines your target application.
C COMPILER : The Keil Cx51 Compiler is a full ANSI implementation of the C
programming language and supports all standard features of the C language. In
addition, numerous extensions have been included to directly support the 8051
and extended 8051 architecture.
MACRO ASSEMBLER : The Keil Ax51 Macro Assembler supports the
complete instruction set of the 8051 and all 8051 derivatives.
LIBRARY MANAGER : The LIBx51 Library Manager allows you to create the
object library from object files created bythe compiler and assembler. Libraries
are specially formatted, ordered program collections of object modules that may
be used by the linker at a later time. When the linker processes a library, only
those object modules necessary to create the program are used.
LINKER/LOCATER : The Lx51 Linker/Locater creates the final executable
8051 program and combines the object files created by the compiler or
assembler, resolves external and public references, and assigns absolute
addresses. In addition, it selects and includes the appropriate run-time library
modules.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
µVISION4 DEBUGGER :
The µVision4 Debugger is ideally suited for fast and reliable program debugging.
The debugger includes a high-speed simulator capable of simulating an entire
8051 system including on-chip peripherals and external hardware.
The µVision4 Debugger provides several ways to test programs on target
hardware:
− Use the Keil ULINK USB-JTAG adapter for downloading and testing your
program.
− Install a target monitor on your target system and download your program
using the built-in monitor interface of the µVision Debugger.
− Use the Advanced GDI interface to attach and use the µVision4 Debugger
front end with your target system.
RTOS KERNEL :
The RTOS Kernel, describes the advantages of using a real-time kernel like the Keil
RTX51 Tiny in embedded systems.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
STEPS FOR SOFTWARE DEVELOPMENT USING KEIL
µVERSION4 IDE
Step-1 : Open keil µversion4 IDE :
Open keil µversion4 IDE, the window screen look like as shown below.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step:-2 : create new project, save project and select device :
Select an empty folder and enter the project name, for example Project. The
fileextension is *.UVPROJ for MDK version 4, or .UVPROJX for later versions.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Select device for a project [NXP (founded by Philips) in select Device Dialog box]
Then select P89V51RD2 microcontroller from device database for NXP
Semiconductor.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step-3 : Configure project, set frequency, enable hex file
generation, specify memory blocks :
Select options for target by right click on Target and set frequency.
Select output options for target and tick on Create option for generating Hex file
during Buildproject.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step-4 : Develop Source file by opening editor and save it with
.A51 or .C
Using the menu or toolbar, Create a source file with the menu File - New. This
opens anempty file in the editor window.
Write any Program using editor and save the file (menu File - Save As) to
make useof the syntax coloring feature.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step-5 : Add source file to source group.
You can add files in several ways to a project. The most common way is to click on a
Source group in the window Project and use the context menu Add New Item to
Group
or Add Existing Files to Group.
By clicking ADD button the file will be added in group in the project.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step-6: Build the target by clicking on Project menu and then
Build Target option.
The Build Output window displays errors, warnings, and build messages during
the build process. Double-click a message to open the corresponding source file for
correction and again build target until there is zero error and no warning.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
Step-7 : Start debugger for verification of program logic
Debugging of program starts with clicking on the start debug session step
by step. itcan be stop bye same button.
After click on the start debug button, debugger window look like as shown below.
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
ASSEMBLER DIRECTIVES
EQU directive
− The EQU directive is used to replace a number by a symbol.
− Syntax:Name EQU Constant
− For example:
MAXIMUM EQU 99 After using this directive, every appearance of the label
“MAXIMUM” inthe program will be interpreted by the assembler as the
number 99 (MAXIMUM = 99). Symbols may be defined this way only once
in the program. The EQU directive is mostly used at the beginning of the
program therefore.
SET directive
− The SET directive is also used to replace a number by a symbol. The
significant difference compared to the EQU directive is that the SET
directive can be used an unlimited number oftimes:
− SPEED SET 45SPEED SET 46SPEED SET 57
BIT directive
− The BIT directive is used to replace a bit address by a symbol. The bit
address must be in therange of 0 to 255 (00 H to FF H).
− Syntax: Name BIT 8051 bit
− For example:
TRANSMIT BIT PSW.7; Transmit bit (the seventh bit in PSW register); is
assigned the name “TRANSMIT”OUTPUT BIT 6 ;Bit at address 06 is assigned
the name “OUTPUT”RELAY BIT81 ;Bit at address 81 (Port 0)is assigned the
name ;”RELAY”
CODE directive
− The CODE directive is used to assign a symbol to a program memory
address. Since the maximum capacity of program memory is 64K, the
address must be in the range of 0 to65535(0000 H to FFFF H).
− Syntax: Name CODE code address
− For example:
RESET CODE 0 ;Memory location 00h called “RESET”TABLE CODE
1024;Memorylocation 1024h called “TABLE”
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
DATA directive
− The DATA directive is used to assign a symbol to an address within internal
RAM and SFR. The address must be in the range of 0 to 255 (00 H to FF H).
It is possible to change or assign anew name to any register.
− Syntax: Name DATA data address
− For example:
TEMP12 DATA 32 ;Register at address 32 is named ;as “TEMP12”STATUS_R
DATA D0h ;PSW register is assigned the name ;”STATUS_R”
IDATA directive
− The IDATA directive is used to change or assign a new name to an
indirectly addressedregister. It is an address of entire internal RAM.
− Syntax: Name IDATA idata address
− For example:
TEMP22 IDATA 32 ;Register whose address is in register ;at address
32 is named as “TEMP22”TEMP33 IDATA T_ADR ;Register whose
address is in ;register T_ADR is named as “TEMP33”
XDATA directive
− The XDATA directive is used to assign a name to registers within external
(additional) RAMmemory. The addresses of these registers cannot be
larger than 65535 (0000 h to FFFF H).
− Syntax: Name XDATA xdata address
− For example:
TABLE_1 XDATA 2048 ;Register stored in external; memory at address
2048 is named; as“TABLE_1”
ORG directive: Origin
− The ORG directive is used to specify a location in program memory
where the programfollowing directive is to be placed.
− Syntax: ORG address
− Address can be given in either in hex or decimal.
− For example:
BEGINNING ORG 100 ... ...ORG 1000hTABLE .......... This program starts
at location 100. The table containing data is to be stored at location 1024 (1000h).
MPMC 180420109009
INTRODUCTION TO KEIL VISION IDE AND OTHERS
USING directive
− The USING directive is used to define which register bank (registers R0-R7)
is to be used in theprogram.
− Syntax: USING Bank no.
− USING 0 ;Bank 0 is used (registers R0-R7 at RAM-addresses 0-7)USING 1
;Bank 1 is used (registers R0-R7 at RAM-addresses 8-15)USING 2 ,Bank 2
is used (registers R0-R7 at RAM-addresses 16-23)USING 3 ;Bank 3 is used
(registers R0-R7 at RAM-addresses 24-31)
END directive: End of program
− The END directive is used at the end of every program. The assembler will
stop compilingoncethe program encounters this directive.
− Syntax: END
− For example:
END ;End of program
DB directive
− The DB directive is used for writing specified value into program memory. If
several values are specified, then they are separated by a comma. If ASCII
array is specified, it should be enclosedwithin single quotation marks.
− For example: CSEG DB 22,33,’Alarm’,44 If this directive is preceded by a
label, then the labelwill point to the first element of the array. It is the number
22 in this example.
kactieal -3
Block diagsa daa dsansen
6 Jodena inkemal samo
i xeama am eam
iCode od
Kevexse block da
anser Lh
visioN
Initialze Sousco pointe Cao H) Ro
initial ze denstioatfon poinHe CuO H) RL
oRalize Counte C10) D
Get Souace.Data
COPY Sou veo dato to denghnatio o
O CTenmen Souace &dengtination pointea by
deCoement Counter by
rer
ts NO
COunte
YES
End
RHe An Bo51 pnaam to aanse o sel en 8bik
OunobeK gtoxeo inlenal_RAM 20 H to intemal
RAM
CSEG AT OC00H
MOV RO, F30H ninialfze 0urco poiote to SouneD dorta
ininteanal RAM ah 30 H
MOV R 0H iaithalize denstoahin painte iomal
RAM at 0 H
MOV R, 0 iniha lize CouoUL 10.
MOV A, Ko Get doto oum ioema RAM DOÍOed
b y
Sou&c poine
MOV @R A_ Store dota nm intem.al RAM o
poinHed denshinoton poioHe
INC Ro
INC R
DINZ Ra, Chec Cauole 0elgeump h
focreroeaot Souepointe
desbinohon paioHek
HERE STMP HERE
END
Result
le
D:OX 30 29 66 88 6 34 63 55 48
olp - 2 G 8 16 34 63 s5 48
D: ox40 14
visioN
tave t
inttialize
ioitHouze
Sousce. pointe i000 H) DPTR
deshioation pointere CHO H R
nialze counHer=10 CioDO OM
qet Souace ata
CoP Souoce data O dlensth'n aho
increment Sousce denshinahon poiote by
decrement couoter b 1
NO
COunte
= O2
YES
End
2. COuite assembly4 levelmquaqe pDaaam t 1aosek LO bi
dota aNalable exkmal RAM mm ooo)H
Stouhing
iotmal RAM. m(40) H
CSEG AT Oado H
MOV DPTR,E100OH iaitialize 90ur painiet hspuree
dota in exemal RAM_1000H
MOV K,E 40H inithtaize deshnohon Pointe n Soum
data io iotema RAM c uOH
MOV Ra, 10 1oihalze counter 10
MoVX A,DPTR Get data.Jro extexnalL RAM
paotedDuSougCo pointer
MONCOR, A Stooe data in tenal RAn1
Doioteo by desinotion Pointek
INC DPTR
R
oeaement_ Souree pOinteu
NC inCveament deshhoanon nte
DINZ Re, d checK Counte =o else
ump
wai
HERE STMP HERE
EN D
|esalt
Memay
OX
OXIoooLaddress1
8 6 2 31 6 o5
X O
X00lO00 O 23
Memc 2 D 0x4o addess
D0740 1O 23 31 4 58 6 12 81 O5
Memcr 05
visioN
Date
PageNo.
3. CONite Assembu level lanquaqepDgaam do oan.ser
Staadiog m
en- 9 bik data alailab le.
C10002H
0 co.de 2emoy
iotema RAMoDm CAo H
CSEG AT O000 H
MOV DPTR,# 1oooHinhalize Souar paioteg
MOV Ri HoH inialize destioahion poioteg
MoN R3, 600 initialize CowoHer 10
Li CLR A cea A bepre etarhoa oew
MovC. A,@A+DPIR Get dato om Saurce poio-esc n
CCCuoulat
MOV (O Ri A Get doda mm accuoularhr to deshiocdhan
1NC DPTR
INC R1
10co emen SouC Doioler_
1oCeoeot deshoohon poi0ter
DTNZ R3,L1 ehek Couoea 0 else ump hb_
LL
HERE 6JMP HERE
ND
Kesut
Meooy 1 7 C: Oxlbo0 Loddvess
Cox1000 03 22 33 4t 5566 17 88 99a
olp
Memosy-2 D 0x4o address]
D:ox4o 03 22 33 44 55 6614 8 99
A Quality Product by
unges
Your Lucky Brand Teacher'sSignature
Date
PageNo.
CWuite aggembly leveL anguage poDganm Bo5L poncessox
leveL
acnske 3-hi data Qvhilablo- inte2rpal RA atatinqoDm
0 H11 39H n S ame loCatino but in i0Veaseaeyerse code
AT 0000H
MOV R0, E 30H fnitialize 90utce poio1e
MOV RL#39H inihio ize desto
oahoopoioer
MOV R3 inihai z COuote =5
L MOV A,RO latching data m.m Souere p0iner dn alcumulator
KCH A,R4 inerehongiog doto cSauaca uith desho ahon
locohon ayailablo data
MOv ( RO , H oching desito hion locethon3 doa laila ble
in acuoulato Souc locahioo
INC RO ce0 ent SoubO locoion
DEC R1
DJNZ R3,Li check COunHea
decne ment dehioahionOcotho0
= 0 e se ump
do abLe L
HERE STMP HERE Oait
END
KesuH2
D:OK30 O4 22 33 u s5 66 99
olp
:0K 30 79 6G 5S G 33 22
AQultyProductby
Gnges
Your Lucky Brand
Teacher's Signature
Date
PageNo.
Weile a9senb anquaqe pmoan 3051 200Ce9Saa t
so ner 8-bit Tam data auailablo in io-fema RAM staahoq-
Om 30 H to i0-emal RAMStrahoq Dm35 H_Ovealapp.ing9-
exishog Data
CSEGAL OoO0H
MOV RO 89Hinitialize 30uepniotear aih 0cohon o data sek
MOV RL, 3EH Sinihalizo. desthootion pnioker ithlucatio.n zanse
MOV R3, 0 inihlalu2o ounte
Li MOV A RO got data Dm Souacapainterdn alcumalatmy
Mov (o RL,A 20tch dota nm_ocCuroulatosh deshnahon
DEC KRO decoenment Souc poine
DEC R de ce roentdeshoohon 0oiatex
DTNZ R3, 21 eheck Couoler = elseump
to Lable Li.
HERE STM HERE waik
END
Kesult
DOx30 05 11 22 33
D0X35 55 66
o o3A
D O 3 F Oo
D:O 30 O5 22 33
D:Ox35 65 22 33
DOx3A 55 GC 74 88
AQUalily Productby
GUnger DOK3F 0o
Teacher's Signature
Your LuckY E5rand
Q
ITH a
A3 H
de. •
CSEG AT 0C)c)O K
• MO)
a
o ".I.." l,
e f<il 'llQL[z.e_. WM Cot.to~'lr =- o
#- o C) • rnrh·alrze. w coun+-e?t :: o
0
cl- oo+ct, t1Dm Sou'lr"U
Li • chec.K. 'tf e.nol d.o+a..
lf:fl r
lvisk,NI
i Ce-1 do-lo. {7-o.,, :n-1,~ ---.
fbin-k...dv bcJ ~ulnP ~•o-k~
- .
'h
<Da.fo. z: =
"'- FFH 2
"'- ~
Ves louipuJ; 7 -~
--4,e_su.J/;- r~
tvO
-
¼/M C'ou()~ 'a' ......
,
::: ++ :L
L
'
~ Coun..e~ '-
,.
::: -+-+ i i
rJo 1
V--- ---
j
1
:L ]
I 1
0
-
C:rNt A.. # OA3 11 , L2.
.. c.h ecJ< tp'lf" WM.. c.oc:l e.
.,
,)c... R-~ • : () C.."ae.M er, b WM ~vn+ey
'
_
C,:J~? L3 " c..hec.K &"!( (~t do¼
,
L2. :
; ch€..LJ<. 'hn<" TV eoa,a_
L3 :
INC.. ~~
.
, ?n c.'"If e n;,er? l::- E3o u-n.t.- po lo ,k ¥
; d?sp')Otl WM Cou()l:- on A,-.t -o
MOJ 4<., RL<
WAlT ~
-------tt--------------------------------'
-------tt--------------------------------'
-----;::===::-tr-----------------------------_.;-'
lviiio•I
I
f<ea .. L 0
• 0
f/o •
e.
I I
.,.
rn:~ x. 3o : Ag DO ~b 9C Do A3 OC) 00 "O CfC. eo 83 ~ A3
I"); OX4t>
. C)Q A3 93 oo (!)O
. oc 9C oo P.3 B3 12.a 00 Oo JW n
): 0 X.EO : A3 co ~ a ~6 (33 60 PS oo 06 0 (J /3'-3 00 ~3 00
• 0/o ~
I I
~ p"'~'= - (' 1- .. '
13 1--.;. 0
pc; : 0 '> 0~ a ✓- . "'
~
P,ns ! (fi ')(' (l' '6 ~ " 0 a ✓ d
' •
,,.;:p ?c:rr;:: - 1 '::- .. o--S - , (:)
P-1 0
0 e) X: ('J {; ... . . ✓✓ ~
P,<)4. 0
~ 1<: b 6 I ✓✓
. . . .. " .
•
tvislor,J
e
POAIN !
,,
0
CLR
A :ff 20H
Sou'2re0-
vowel ouoH~ ,:: 0
pc,i O.eJ... bcf S'OU'b"U-- p 0 o,+e t'
• C.i ecJ<. 7f encl
C L9- • c~e ~ " a 11
-------H-----..:..J..c.t...1--l-l----1.1--.----;~=--'--____.:.;:;.x;.._-e=;.;;._-.:;;,;.__ _ _ _ _ _ _ _ _ _ _~
5JMP $-K o-a.
tvislONI
in:+:alize Sou~ po;o~~ -to
coole. ""f't'OCfG':/ == ".DPT'R
l
' ) L' , ..
,n,TJQ 12€; Vo weL cou()./e 'a" : 0
']et do-b.. guf'( {!_()de. ro~"°oti'j
~10-ecl qj s~u~ poin-le'iY
tJo
(
:
.
ee'. L'.3 •
/9 • C1NE A. ff .., c'oe.c...K ~
., e,,
..
.
~'.TMP 6-<.H> •
'k> +o ne,cl-:- do-fa
I y
' J
11
I
II
13
.,
CJN£. A "':f t1,", 'llt
.,
Dheel<- ~
e o'
,
' -t
I
,_,
'
~:11"'1 p 6¥-'?
.. to Ob<.t" c::ilo-h::t
1 ao
I u
I
I•
!;
i:f t:c' _ LS • Ch~<.
19 • C:IN E A ., ~~ r O,
C
, -
P-.TM P c::v,P
,
afl -to (1p')(.f- Jo+-a
' ,.J
....
us ·. CJtJF A_ #- E."-4>_ 1 r: 0
chee1, i:.oz( f -LI'
" -
-~Kr ~
Mal A.. 9<S
A"D'D A.~ • ~n c.:6 eN?eot vowe.l Ctlun t
~
<f)A A • kclM)~L oA :I..LG ':
' .._;
MOJ ~5, A
I~ " t tJr TI?TR
0
to A - ---✓- 0 f)¼-:
0
, gou?a• ru,,.,n.lP'lt
I
- 61~? ACRlrJ
11?~M()AT~ :
MO/ PO • tf<5 • d ,a.("'o.u Co tAf')C:- ~...:b - 0 ,
, {')(")
I
'1
WA1':
~TMO l.)AIT
E l'1 :Q_
lvlsloif)
I"""'"
/1
i
~KPAtdl
:
• •
•
'
:1
i
rilo
:
~
~
I I
,
II pf"'211: -- {' t Bi+.9 . ,
0
!
()(') ~
0 / [Cf ✓✓ 1; ✓
0 • - Q
P;nQ : ,,., " r er " . ~ ✓/ ~ 0 ✓
-
~
lvlsloNI
•
e
f)
ruac~eo. 4
+he~ 50
---'--------1~----------------------------------i
CSE AT OBOo H
MDJ
'ff 30 H
SET
0
, -I
MOJ RO d oe.--h"na-H'
eve"' r() e('l) be,s'l
MO ✓ R #SOH
Q
:,
c,d_.,,l (()e"'1b~-rs
• 0
cese,ec..t
,R1N (j)
.,
" get da+c.t,
booJ{ - I
to ?Ji h
/n(·-ha/!'2e., Soub po/"k~ =- Ro (b:>nK,o)
i"; h'a l·ze_ c,'00 f?P), ()O,ofe'i[ ~ R, (fxH•K --4)
t'n,-h'o l/u.,, Gv;;:,v '14', pu,'n fe'lr' -=- Ro ( bon.l', JI.)
r
7)aUlc.t., O 'D() d()-1-a., ro 9}y~CQ.. -12.veo clq½_ to Ioeo.f,"o<)
p1ro-l{<)QJ.., ~ e-1&> po,·ok 7r"
Joc.o+i~o n poin-k,L ~ oiop poit>W
tocieroe<>c e>'DD po1·o+~
!'n c.:lferoe n I: gou1CL- po,n-/-P'lf
de ocemet? t' C()t.ln -le)'
I'
!
f<lC. A ; }(.D+t.J~ bi+S ,.A' --Hvrovqh CP~ fo ~bf:-
MO! (o) RD ., A ; S-m~ do-k1- ..fo £VGrv oles-n'na-fio0 po,nJecr
INC' Rri'l ~ fn~u~t £V£(J ol~+i0-'"-, nn?n"N!''r
'
~JM9 ,~K P
O'DD:
R1r A ) )-W-to4e. bH·s t>l_ ~ p.:, ~"!5) V.'f h_ Co~ fo 14..+
~
Mt}J (o) R ~ F • s-ta-re. ~a~ .ft- fl 'f)'i) de.~-H oa-h·n n lfll'li°f'l~'11'
' I
,. 1NC... R G
fnC~('()ent'. 01)) ~.ffto-ht)r"") ,
O"infea-
'")
,
'
~<9 •
0
rt R R8r) ; AeP.o)p(""I.:- .9(/lQ,Q~~ banJ< - f
I.J
•
tr.Jr R0 ~ :nfl 'T("P r-oP f')b a.,1, J 'M'°C,.... no in~Y
1):1Nz ie.~ ~ AOAIN
WAY, :
.~:-TM'.) WA,
j;Nl)
II!
-
(J{e~,d~ II>
• 0
fID :
l<ft'I~
/
r)')( ~
0
06 I l 2..Q 33 44 55 66 <as
~ 11" gq
rJJ()'
I ,
1): O;(~o 0
~e 22 '-14 6b 8-&
I
,
1): 0 -X5()
0
I 1 3.3 5S '=!::, C, '}
D
lvisloM
.....
•
0
1r = 10
• 0 , ? ,,,
I ,,wfi Q LI 2 e_,
5ET6
4)
bant<-,
ArN ~
• x.a,+a-fe. b,+s
+er.
&taijt
:n,-Ha llze.. SouPJCJ!- poin-/t'?r - t ~ Ro ( conl<-0)
1
~i'+iollu tve.- nvro. pao.fe-;,- - fJ. ~ R. (b,Mt<-,)
,°n; 'a lt.z.e -Ve. nurn . Oin-le i,- - 3 ~ Ro (ban><-' )
//n?+fo /;u.., Coun-k'ff: 10 /
J,
no
!5-ttRre- -Ne. ~d:oa
?n lo~+ioo ~clQ_J
~ "N~ po,o+e'b'" - 2
S1't>1re. --ve, -Head.i'n'd
fn )oea--H·an ~v?d.a..of..
~ ~ 0,0~'5" -3
[ ,•nc?Serneot: 9oucfC.fl- po?o-le-r
J 
L dee creme.ob c.a un -/ey
t 
Co
NEGATIVE :
RRr A ; )-(o-ro.fe._ bi'.-<;
{' ,
A fhrroua h. , ' +n ..adC1hr
MtJJ (o) Q - A ~ ,'?I do+a +o -Je.. ~u de A~_, p un .,_ •
ffl l ~ -~ 1"1-( 1 ,1 l'l.: ,£"
- - 1
~r Q
,
~ (" (!'Xt'f'(),0()~ -ve.. de.s+?oa-4,'>nn t"V fy,,+e'l(
91
- '
_q<P :
r'l..9. Ran • de.a,e.ec.,; J'llJ__Q ~Sie'2J' bani-< - J
.,
V
1rJr f<l1)
. (,)
-i " n~~el"()e()~ SOU'ir/'b r>l'l .,n-k!f)('
I
• r:r,rJz. f<3 , FG AIN
WfT
Pi,M'() 'W{)1"
~N~
'KP~I ~
,Cl
e ...
~ ) (") : - " -,Lt -5 -~8
- l1 } ,, t)
r:>:+ 25 33 F2 5b f7R jJC)
1): t)')( qD 0 f~ ~, /9
(if) If) !
I I /
T): C);(~O
0
0-=f Q5 33 se 41 1q
t)
'T'i ~ (') X -
~O
~
F5 r2 f'8 fJD
.,
-
-  -14 -5 -4 g
lvisloNl
1JacAi
Date:
Page No.:
Of
Q "-
o-
( AS - J. )
CJoe.
ti
f
CSECt A1 C) e)O H
i EX 2. AS e.. l 0
0
#"OAH Li.
L • /._2_
A #O~H
L -:f3QH
cs~c Ai. 000 H
MA
a,
MO) gp #SCH •
•
MOl A "J 30 H
NL A #" or H
AC.-ALL HE~ 2. Ase..,t f
"oe
t'-1 ()) 4oH A •
'
Mov A H
L----~~----
AN L A , ~ Oto H
! . - - - - - - 1 - - - - - - -
SWA~ ~ A
'-----
Teacher's Signature_ _ _ _ _ _ _ _--!
-~
c~l ti e,,c our(d:>el(
1
/ Sepeir~ 1£9We¥ dt8,'l::- ~
-- 1 l
[ HE-x 2 ~Sc.1J e.u.b-.,,u+rn_e..
___
r::-~ AS~ - U') I
~ r -
,.-q-el::--H-~r-o~~ -___]/
~e,'l)Q-te.. ~:9he'?r" d(8i°l _
---
,----______l¥----~---,
(Ht X 2 ASC.j
Nd
-1
Q
Iadol. 3o 1-l
~
~
--YES
]
Date : I I
Page No.:
Aa.c.u HE?<2AP,f ~ c.al Su.b"'><"l"lu-h°n,.,,
MCl L..t1 H - A ! ,:,J.-.....,., A!=!.C.1 h~o h .o ,r -t •o~.-
/
CJ 0
.lA'T 0
S"JM? WArT
0
.::ND
r-- .. 1-<e.a.w.'c ,.
'"
d D :.
l ,
'I) ~ CJ X2,o 0
9F
•
0 ID :
I I
m: C)')(:.lto " i{6 -'?-b .---:,, Ase..u va'lc,.e
<
L '1s  ' Lt
ASa..t.1 Vq'kt
01-, ll F IJ
~
I
A
.,,.,.,,ryl~
~ '
Y
our Lucky Btend Teacher's Signature
Date: I
Page No.:
'l-1frn ! WJ.ti'-1e.
(j_ U ,J I 0
<"ll-1m r.e~ o/nila bl e.. YJ 1f'l4e?rnn RA-IVL l"l,- ?.I' 1-1
~f 0~ o- /.i(') H •
~r-----1---- - - -- - - -- - - - - -- --------1
CSEQ AT 0000 H.
MD1 A. 30 H
0
" get A'lr11 J(l1 ,12.
/
V
r .'TN E. A.,-=:flH .. Li. • ('r, fY1 n,-, '°" ,/u._ ro D ,O.. oo).. (2,., 01 '
""
Q(),,..J
u V l-
L1- 0
'j C. L2. .. a.. }.-aQ r~ qpl-
" "I C!.aJrJ,<-4
u <J .l <I
5VB6 A.., *01 H • . ~~ O"l ,,
, ~I I I
L2. ~ C..LR.. C..
0
Ru h-h(acl:- '' 30 ''
MOf PO .. A
IJ
8:tM? WAYT
A UUBJlty Product
~-
Your Lucky Brand Teacher's Signature-__________
[
I
LS+aci'tj
r
~et- ASCI. v o Lue.
1
Sub--hroc~ o'=t H
9
~ Su.b-cfa c~ 'cc:> H l
t

t 5 -foaC... f-( f;_)( Volt., e 
dtsp?ay Rec. vo1u.e.- 0-0 Po'61- -o
1
~
7
•
-.
Cl
0
X 40 . !
C
•
I
1) 0
01 0 Lt
0
0 •
:D
. (!) y_:Lt
'
~
• Wki'-k
fY).
•
9-b{;
1.t2 H
Co~~ •
•
MOl 6
AB
J L-10 H
Date:
Page No.:
Qfu 05
Me~
uiJcdeot
Rf~ ol: '-10 H CBen 2
(Be_'D :!.
ODeS
30i
'
1
·1-LhJ II
Teacher's Signature__________
8to?S t
r
dt v~ de... a Ccc,roulo-fu¥ w:th 10 /
9to7ft, .s;em,n de Y ?fe..511 f- ,>n
lf.Q H-. 1oeo -¼)-on
Date: I I
Page No.:
fYf)) A~ ~ • Cle!:- 9-l(l' ...... J.r, --'t>'A' d)_
, O"'iiev:',..,, •S dvr~.~t1C :,...-+n
~ V
...,
a.er ·- ,' -.l-..- .
MOV B.i='10
f)j AB
o , d3 1 ,
, ,"' s,an
Ml"'l'l '-t2. H, 6
0
., 8en:)'be. "ones " r-.AO.t~,,~ A~.. l .
I V
M oJ L< I I-{ .. A •
" 5--'01r€.,
e~ 'TE tJS ,,
()r ~t-+fo () a.:~n:
, I J
11. IA·"'' •
0
~
5:SMP wAT
I=N1)
0 Q1-'.Q.1 l.- •
,,
f /p:.


I
.,
'D ~ 07<,'.?.f"'l 0
f=F
Q
o lo :..
I I /
D~ o ttio
0
02 05 Olt
I>
~
,,
11
,,
:1
Ao.iAy,:;r
(!;'
Teacher's Signature
~ Yourf..ud<y&ond
-,,
Date: I I
Page No.:
'f). ~ ~im • (J)X I,-le., (i(l 11 t)('.) o.v1 h111 tone111n,.. 0. n·xr-1 O~n t'Y' ,f'h,.., I-
• d (.} J
, 0-
n,,,...:lr.J-..1o
.
·- ca- - h, 1- 9; ?e. P,f"T) nvrr,hPi'r' ,,,....
r J
?n+hrnat RA-Ni ol.,.. ~f) H_ Cecro 3) "" 3J K (13 CD a) -
/
?JQ )-- lf?if1) i l ;'n--1-1 1?_.f- (?a,,'.,i,, /p,,., I- H£.X 0,(1-' q--h--x-i:i<l
/,,
val11P
p
{(tJ.... ; -., I QANl, al:- !., () 1-1 •
KEX RJ)
CcXDF e
- A II
;-
-
I
C'9EG A1 CCOOH
MOJ A., 3e H
e
Sf12.-: '
1
HON'' Bt-<D d,"a?~
I
V 'CJ
M01 B~ W'We)
,
.
'">
MJL A6 ~ {'{)uJ.+fn 1u
A
' a
MO) 'R j_ 9 > ~ Jie.su.lt /() 4€,l'Y) 0. rz5eg/s,k2r .
V
MOJ A~ 'o 1-l
~
qe..b ti -kos IJ
Be.CD deqJt
' D '-'
- Mfrl 6 .,. :tt: I·(')
·
::-. A~
#
('() LU1"Jolu
MJL -'
V
ATJDC A"l R1 " o.dci(-Hoo dJ. N'lIll.{'ol.u .91tsJ.lt vei°th
~ ~'l/ t/)•~ .t,LSc.ff
V V 1
A1>nc, A~ 32H
/J
' a.cc,,kto0 ~11 "ones 11
8C..'!) digir- c.01-t+-t Sum o'. p~v;.,.,.,.,
V
" V
'-tt> H" A
,,
MD J
' 61m-e. H I::?< VoU-4 e,.. c1l;- 40 H.
r11AT ~
6~M9 r<lA1
E)'i)
A
(:,~
Teacher's Signature
Yoorl.JJcky8tan<I
...
'I HUN,, BCJD di~~ 
Sto'Ce. Jle.sut+- Jn ,femp ,
rcreats~}r t(j_
addM-foD d/5 ~s c.t.JJ- w'+-4
Vo.~ 1; +e,r,1
o. ~(S1o¥
J,
11
OflJEB ''
,
l
Date: I I
Page No.:
- ft{P Cll l+.- •
"
f / D •
..
I I .,.
'T)~ ri -x: ~ (') ~
02.. C3 09
#'
.I"' J() 16
•
I f ✓
ff) : 0 -xlt 0 • ~r
0
,-
5~5 Pnrn • ~JJJ{ (ff., 098ernbL, lano1,rro p n?rtJa 'Xnrv"I. to o .... 'I..
• Q.(1,
n • l
d (J ✓ I 0
-, l}
:l-r.1 ln ,<n"' rn,11..L.."h,,..J..p rit?f'}<Y1n L adJ,-h'o1'
D a <.J
g956<l=7:J9 +- q 05 5 r, =t c, S ;:
CC)DE •
• e
rPii=c A, (')000 -1
MOJ R: .. it= e:>~ · •• "-h' ,. coun-4-e'lr -=- -4
- .. 1n, Q I z._e_
~
= Mtl'il Ro .. :¼½:- SaH - fn:-4,"Qlize... fVI io+etJ" l-,..,.,,. ('l(.H'tL~""' - ,r
' 50ulS<e.
. ~
MOJ R1. ~ -:f: 40 H ; i'"74-i'o1:-.... "-Ou_,, a 1-.- nc.,fY)i.....,...,. - ':!
I
-
~E,R R:3D : 5e,:;,,,_I- no:>a ?,,.La,"
~a.nK 1
u
MD'l RO f) :f50 H •. fn(-h"q V,o d ~-1-i'n" -h'o n Ml lf'l+e~ ~ O(').::t,.,.,,,..,..
7
I ~
C...LR ~SC) • d.e-5e.lec't- <oea(~r,y
~"'~ - 1
.. u
L1.: t'I(")] A.. (o) Rf" ; 11..o+rh. 2.. dio f+'3 of}... '1uN">be~ - l.
'-'
"
....,
F1)'0C., A .. (a:) <:. • c_cl_-U.... - .2. d.(~ ?+~ oi.. ()u.rnh•,.. - f)
~
(;! I.J
"""
DA A • ,.l.,., ?,-..,..,.. '. ,.,_f?,~o4- Cl'l...
"" O()<l u-ioy
-,I ...
I
AQUIJ/ity,~
~- Teacher's Signature
Yourl.,JckyBmnd
~
/h/Hql"ze.. ..Sou~ po;n-leb"" ~ oumbe-r :L = Ro (booK-o)
ir, 1+-lQ L•2e,,, sou~ poio4t'~ e>11 f>vm btZ) - .2, ::: R1- lbal) K- 0 )
,, 00 II
,,,,,f-H'al/z_e.. Co 1
.m-,..er f?3 = Lt CbonK - o)
- ·i-
I J_L l
In I nq •z_e. des,ttna+i"o<) po/ o-k"r'
Q
~ do.-+o... ~('( (O..e'lroct.. ~~'
)oio4ecl 0d Sol.lerc.a... poin-te.'lr
Q.cd,~O< t~;+(.. ~ J ci ON'umv.lo-foy
w,-tt... 2,"cl nv<Y>be~ ,o o+n-oo.L QfM-
 '5--ft, 'lJe.- answe~ 1() des-hoo-hon pui""~" foe. l
1
 ioctJl"~enb- des-b't1crlicm ()Q''lt,y
Jc
[:nc.oe"'?eot" _Sou&a- Po,,.,+eir i ~ gp - 2. 
J✓
I itlC0"l."rOe11b- covn-k'll" b¥ 1.. ~
i
/(),
A}(J
:,~ II () 1 II
1
, f/
Jps.fina1'1011 po,11t-,,;y d,.~+t~f"c:l~'on po,'~'r"

)

 ') 4:
r
•
Date : I
Page No. :
Roo • 6e1ec.k is~~ book' - 1
~
Ro A •
3-tv-ire.... an
Ro ; "Cbl"Menl;- d<?s+ioo..f.,·
dese.l e bank'-
5ETB RS See.d:
• •
5G
55 90
D ~ o x so ~ i 3 65 IQ._ §-0 o .1..
A
Teacher's Signature__________
Date
dachicaL -6 Page No. :
6.1 Aim Wxite assemhly lanquag.e pongam fo incneme
a COuoHe Sutrh aod s poesseol
deCoeMeot a Couoe i Soitch 32 3 poessCol
CukpukEthe Coun tex Value a POE1
CODE
CSEG AT O000H
MOV R3,HOoH
Mov P2,# OFF H Coaquze
ioitiade Couptea
povt2Os p
REP
J3 P2.2, LL ump SL s 0ot _pvessedd
NC R3
PLR3 display 0n 0nt
Mov
LLJB P2.1,L2 np S2 is ot paessed
DEC R3
Mov P1, R3 dspo 00po
L2 STMP REP
END
AQualiltyProductby
Ginger
Your Lucky Brand Teacher's Signature
Stort
inithaG2e COune =
Cookguoe P2 = 1 pr S2
P2.2 r SL 0s p Pios
YES incoearoent
Coun ter
PTesse d
NO
YES Decse ment
82 1s
COun ter
Presse
NO
isplay the Count on Pot-
Date
PageNo.
Kesut
p Pont2
P2 OXFB VVVVV V V
bifs
RosioxFB
agt 3 yules i/p
bi
Poat V _ V
PL OA03
PiosOK03
bits O
Poat2
P2 0xFO V
RosOxFO ,
bits O
Pan
PL0K02 V
Pns Ko2
AQuelily Productby
Ginges Teacher's Signature.
Your Lucky Brand
Date
Page No. :
6.2 Alm COxte an assemblylangtiag.e 0DQAam
&
display95 H_i Switc h S1 s pesseo
display
displayOAA H
EShowlo be clisploel On Paxt-1
SOite h S2 S 00esseol
CODE
CSEG AT 0000 H
MOV P2,FOFFH Conhauxe paut90s inpu
REP
JB P2.1 LL ump S1 snot Poesse
Moy P 55H displa
55
55H in olp Pot-1
Li JB P2.2 Aump i 2 hs not pressed
MOV PL, OAAH lo disploy oAA H a_auhout
Poat-
L9 sTMP REP
END
A Quality Product by
Gnger
Your Lucky Brand Teacher's Signature
Stoat
Co0gube. P2.1 os SI Onod
toA P2.2 hvr S2 os ilP Piog
yES
disploy 55H
S1 is
at Poot1
Pres3 ed
NO
displayAAH
ex Pout-1/
S2 is YES
Poessed
Date
Page No.
Kesutt
2tp
Poat-2 ,bits bits. 0
P2: oxFD VVVVVV V
RosoKFD V/ / S .
elp
Poxt- 11 bts
PL 0K35
,. .
Pios 55
Poat- 9 bits
P2 Ox FB
PosoxFB V
Poo 1L bit S
PLOx
AA V. v,
Hos O AOAA VV, Vv
AQUalityProductby
Gngers Teacher's Signature
Your Lucky Brand
Date
PageNo.
oac-hicaL -
1Aim Wmte assemblypoDgaanm that genexaies gae pulge
0 KHZ aequeocuLh50 L Duty o4cle oo
Pi.o pio o 3051uSing hmer o mado.1
Hssume osellatox se . 0592 MHz,
eCoDE
SQW EQU PL.0
CSEG AT O000 H
CLR SW S0w = O
MOV TMOD,#OI 3 Cookjguxe himeo-o io mode -L
MON TLO,33 lood inihial_cauc
MOV THO EEH Shghes bts o nitial cost
SETB TRO Stoat timer
tOAITTBC TFO,NEXT cheak o imer oveou
TMP WALIT
NEXT MOV TLO,t33HSReloadioial Count
MOV THo,#E OFEH
CPL SQW (onplero ent p1.o bik
STMP cOAIT
END
'hesut
(uasor-1 25.45192 Sec
Cussoo 2 25. 4S 293 Secel
lioe peiee 1 oee
Cinge 1KH2 uene Teacher'sSignature
(Stost
Cleav Poot-1 bit o
ConBgu ime - 0 in modle L
oihal Coun o TLO THO /
Stas hme O
No
TFO 1
YES
Kelo ao oithaL C0unb+0 TOdTHo
tog9 le bit Plo
MPMC Practical-7.1 180420109009
OUTPUT AT LOGIC ANALYZER
Date
Page No.
T.2 A Wefe_gssembly a09aam fhat qenera-tee gake pulse6 0
KHz equeo.cu oth50 Duty Cyale oo PL0pio
B051 uSing limer 0 mado- 2
Asume 0ellator e l05 12 MKz
CODE
SQW EQU Pi.0
CSEG AT O000 H
CLR
MOV MOD 02 3 Coogqupe dimea o io mode-2
Mov TLO# LAH l0ad 8-bit 10HaL couot
MOV THO, LAH
MOV R3,#O0 User couoter
SE T3TRO Stast oe&
COAIT TBC TFO, NEXT check or mea oveou
STMP WAIT
NEXT 2 INC R3 í9Cvemeob C0uoter
Uses
CINE R3,#02 WAIT CheuK os hwp fones Oveou
MOy K3, E O0H Heset Ounteg
CPL SQD
SIMpALT
10ggle the pulse
END
Quality Productby
Ginger
Your Lucky EBrand Teacher's Signature
(Staat
Clea Poat bit-o
Coo 9ube timer O io mode -2
nih'hze ovelow co unter = o
Looo hha L Count h TIO d THol
tos himer O
/
NO
TFO =iy
yES
incoement oveow Cuntex
COunlea = 2
yES
Reset Couokr to o
go99 99 le he Pot bib PL.o
Date
PageNo.
Kesult 2
LuasoxL 13.13363 Sec
Cunsor 2 13.13463 Sec
Clime pemoc LCuoLe
O. O| Sec
LmSe c
1KHz eguen.Cu
AQualityProductby
gen
Your LuckyBrand Teacher's Signature.
MPMC Practical-7.2 180420109009
OUTPUT AT LOGIC ANALYZER
Date
Page No.
13 Aim Wole asSembly2o09aam tha updaies and displat
tme Secono Oo Pot0 8051 Usino
Himed O20 m0de L
Assuma 0SCillatx
e .012 MHZ
CoDE
TOLSB EQD OFDH
TOMSB EQO BH
CSFG AT OOO0H_
R3, oH Counes=00
MOV R o0H
MOV
Sec O0
MOV P0, Ry
MOV TMOD E0LH 3 Coobue
3dispo3 0n Post-o
imeo 0ode -
MOV TLD, FTOLSB load tial COuo
MOV THO, TOMS3
SETB TRO Stax iroer
OAIT TBC TFO , NEXTcheok ro Oveo
ST MP C0AIT
NET MOV TLO,#TO19B Reloao Lbtial Cos
MOv THo ToSB
INC R3 ocaemeot bsey couoten
CTNE R3, H20,wAIT chec r 1ee
MOV R3 #00H 2 Aese COuoer to oo
Mov A, Ku
AQualyProductby
Ginger
Your Lucky Brand
Teacher'sSignature
onepe Stoot
User COunte k3 0
9etond. ountear Ru = O
ioihalize
initial/2ee
CooBgue imer o in mode-l
ood inihal couo TLO THO
ChecK fur fimoe oveolow
taatimer -O
NO
YES
TFO== 1
TFO O
7eload himer oun kr
n cotm ent counwr Rs
NO
R3 20
YES
make counter o d odd 1 to gnd
NO
>
dsploy Second
second = bo
00 Post- o
YES
rmolke Second coun ter Ru = 0
Date
Page No. :
ADD A, #o1 H upda te Sec idecimol
DA A decimaladjus
CTNE A # 60H, SKIP cheuk or 60 Sec
MOV A, OoH Reset sec Ount
SKIP MOV Ru, A_
MOy Po, R4_ displou Sec
BTMP 0 AT
END
Kestl
Poat 0 4 bits -
Po Ox59
Kos0KOo
Post-O bis
PO OKIOD
aller 5 Sec's
Caorn
Set nd lock_
9taafe m Seconol
AQuality Productb
inger
Your Lucky Brand Teacher's Signature
SEVEN SEGMENT
DISPLAY
NAME : Gajjar Parth Sunilkumar
Enrollment : 180420109009
Submitted To :
1. Dr. Nilesh Shah
2. Prof. Dimple Bhanabhagwanwala
Date Of Submission : 30th
April, 2021
MPMC 180420109009
PRACTICAL – 8.1
AIM : Draw an Interfacing scheme to interface four common cathode seven-segment
LEDs with 8051 and using this interfacing scheme write an embedded 'C' program to
display passing year.
CODE :
#include<reg51.h>
#define t0lsb 0x00
#define t0msb 0xEE
bit bdata displayflg = 0;
sbit SEL0 = P2^5;
sbit SEL1 = P2^6;
sbit SEL2 = P2^7;
sbit LE = P3^7;
unsigned char dispdata[4] = {2,0,2,1};
unsigned char code seven_seg[10] = {0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f};
void t0isr (void);
void display (void);
unsigned char disppos=0;
void main(void)
{
P0 = 0;
SEL0 = 0;
SEL1 = 0;
SEL2 = 0;
LE=1;
TMOD = 0x01;
TL0 = t0lsb;
TH0 = t0msb;
ET0 = 1;
TR0 = 1;
EA = 1;
while(1)
{
if (displayflg==1)
{
displayflg = 0;
display();
}
MPMC 180420109009
}
}
void t0isr (void) interrupt 1
{
TL0 = t0lsb;
TH0 = t0msb;
displayflg = 1;
return;
}
void display (void)
{
switch(disppos)
{
case 0:
SEL0 = 0;
SEL1 = 0;
break;
case 1:
SEL0 = 1;
SEL1 = 0;
break;
case 2:
SEL0 = 0;
SEL1 = 1;
break;
case 3:
SEL0 = 1;
SEL1 = 1;
break;
}
P0 = seven_seg[dispdata[disppos]];
disppos++;
if (disppos==4)
disppos=0;
}
OUTPUT :
MPMC 180420109009
PRACTICAL – 8.2
AIM : Write an embedded 'C' program that updates and displays real-time second
and minute on 4-digit common cathode seven segment display
CODE :
#include<reg51.h>
#define t0lsb 0x00
#define t0msb 0xEE
bit bdata displayflg = 0;
sbit SEL0 = P2^5;
sbit SEL1 = P2^6;
sbit SEL2 = P2^7;
sbit LE = P3^7;
unsigned char dispdata[4] = {2,0,2,1};
unsigned char code seven_seg[10] = {0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f};
void t0isr (void);
void display (void);
void rtc (void);
unsigned char disppos=0, cnt = 0;
unsigned char sec = 0, min = 0;
void main(void)
{
P0 = 0;
SEL0 = 0;
SEL1 = 0;
SEL2 = 0;
LE = 0;
TMOD = 0x01;
TL0 = t0lsb;
TH0 = t0msb;
ET0 = 1;
TR0 = 1;
EA = 1;
while(1)
{
if (displayflg==1)
{
displayflg = 0;
MPMC 180420109009
display();
}
}
}
void t0isr (void) interrupt 1
{
TL0 = t0lsb;
TH0 = t0msb;
displayflg = 1;
return;
}
void display (void)
{
switch(disppos)
{
case 0:
SEL0 = 0;
SEL1 = 0;
break;
case 1:
SEL0 = 1;
SEL1 = 0;
break;
case 2:
SEL0 = 0;
SEL1 = 1;
break;
case 3:
SEL0 = 1;
SEL1 = 1;
break;
}
P0 = seven_seg[dispdata[disppos]];
disppos++;
if (disppos==4)
disppos=0;
}
void rtc (void)
{
sec++;
MPMC 180420109009
if(sec == 60)
{
sec = 0;
min++;
if (min == 60)
{
min = 0;
}
dispdata[0] = min/10;
dispdata[1] = min%10;
}
dispdata[2] = sec/10;
dispdata[3] = sec%10;
return;
}
OUTPUT :
INTERFACING 20*2
LCD DISPLAY
NAME : Gajjar Parth Sunilkumar
Enrollment : 180420109009
Submitted To :
1. Dr. Nilesh Shah
2. Prof. Dimple Bhanabhagwanwala
Date Of Submission : 30th
April, 2021
MPMC 180420109009
PRACTICAL – 9.1
AIM : Draw an Interfacing scheme to interface 20x2 LCD display with 8051. Write an
embedded 'c' program that displays "--Welcome To--" in line-1 and "--SCET, SURAT--
" in line-2 of LCD display.
CODE :
#include<reg51.h>
sbit RS = P2^7;
sbit RWB = P2^6;
sbit EN = P2^5;
sbit BUSY = P0^7;
unsigned char msg1[14] = {"--Welcome To--"};
unsigned char msg2[15] = {"--SCET, SURAT--"};
void lcd_cmd (unsigned char);
void lcd_data (unsigned char);
void ready(void);
void lcd_initialize(void);
unsigned char i, j, value;
void main (void)
{
P2 = 0;
EN = 0;
P0 = 0;
lcd_initialize();
lcd_cmd(0x80); // set DDRAM address for line-1
for (i=0; i<=13; i++)
{
lcd_data(msg1[i]);
}
lcd_cmd(0xc0); // set DDRAM address for line-2
for(i=0; i<=14; i++)
{
lcd_data(msg2[i]);
}
while(1);
}
MPMC 180420109009
void lcd_cmd(unsigned char value)
{
ready();
RS = 0; // select command register
RWB = 0; // write command to lcd
P0 = value;
EN = 1; // latch command
EN = 0;
return;
}
void lcd_data(unsigned char value)
{
ready();
RS = 1; // select command register
RWB = 0; // write command to lcd
P0 = value;
EN = 1; // latch command
EN = 0;
return;
}
void ready (void)
{
BUSY = 1; // Configure P0.7 as i/p point
RS = 0; // select command register
RWB = 1; // read command from lcd
EN = 1; // latch command
EN = 0;
while(BUSY ==1)
{
EN = 0;
EN = 1;
}
EN = 0;
}
void lcd_initialize(void)
{
lcd_cmd(0x3c); // 8bit/char, 2-line, 5*10
lcd_cmd(0x06); // right entry mode
lcd_cmd(0x0E); // display on, cursor on, non
blinking cursor
lcd_cmd(0x01); // clear lcd, home cursor
return;
}
MPMC 180420109009
OUTPUT :
--Welcome To--
--SCET, SURAT--
PRACTICAL – 9.2
AIM : Write an embedded ‘c’ program that updates and displays Real-Time Clock
data on LCD.
CODE :
#include<reg51.h>
#define lsb 0xb0
#define msb 0x3c
sbit RS = P2^7;
sbit RWB = P2^6;
sbit EN = P2^5;
sbit BUSY = P0^7;
unsigned char msg1[16] = {"--DigitalClock--"};
unsigned char disp_data[8] = 0;
void lcd_cmd (unsigned char);
void lcd_data (unsigned char);
void ready(void);
void lcd_initialize(void);
void display_clock(void);
void rtc(void);
void t0isr(void);
bit bdata secfig = 0;
unsigned char i, j, cnt = 0, sec = 0, min = 0, hr = 0;
void main (void)
{
EN = 0;
TMOD = 0x01; // configure timer-0 in timer mode-1
TL0 = lsb; // load count for 50 ms overflow time
TH0 = msb;
MPMC 180420109009
ET0 = 1; // enable timer-0 overflow inturrept
lcd_initialize();
lcd_cmd(0x80); // set DDRAM address for line-1
for(i=0; i<16, i++)
{
lcd_data(msg1[i]);
}
lcd_cmd(0xc0); // set DDRAM address for line-2
for(i=0; i<16; i++)
{
if(i == 2 | i == 5)
lcd_data(':');
else
lcd_data(disp_data[i]+'0');
}
TR0 = 1; // start timer-0
EA = 1; // enable 8051 inturrept system
while(1)
{
if(secflg == 1)
{
secflg = 0;
rtc();
}
} // end of while
} // end of main
void t0isr(void) interrupt 1
{
TL0 = lsb; // reload timer count
TH0 = msb;
cnt++;
if(cnt == 20) // check for 1 sec
{
cnt = 0;
secfig = 1;
}
return;
}
void diplay_clock(void)
{
lcd_cmd (0xc0);
for(i=0; i<8; i++)
{
if( i == 2 | i == 5)
MPMC 180420109009
lcd_data(':');
else
lcd_data(disp_data[i]+'0');
}
return;
}
void rtc(void)
{
sec++;
if (sec==60)
{
min = 0;
min++;
if(min == 60)
{
min = 0;
hr++;
if(hr == 24)
hr = 0;
disp_data[0] = hr/10;
disp_data[1] = hr%10;
}
disp_data[3] = min/10;
disp_data[4] = min%10;
}
disp_data[6] = sec/10;
disp_data[7] = sec%10;
display_clock();
}
void lcd_cmd(unsigned char j)
{
ready();
RS = 0; // select command register
RWB = 0; // write command to lcd
P0 = j;
EN = 1; // latch command
EN = 0;
return;
}
void lcd_data(unsigned char value)
{
ready();
RS = 1; // select command register
RWB = 0; // write command to lcd
P0 = j;
EN = 1; // latch command
EN = 0;
MPMC 180420109009
return;
}
void ready (void)
{
BUSY = 1; // Configure P0.7 as i/p point
RS = 0; // select command register
RWB = 1; // read command from lcd
EN = 1; // latch command
EN = 0;
while(BUSY ==1)
{
EN = 0;
EN = 1;
}
EN = 0;
}
void lcd_initialize(void)
{
lcd_cmd(0x3c); // 8bit/char, 2-line, 5*10
lcd_cmd(0x06); // right entry mode
lcd_cmd(0x0E); // display on, cursor on, non blinking
cursor
lcd_cmd(0x01); // clear lcd, home cursor
return;
}
SERIAL
COMMUNICATION
NAME : Gajjar Parth Sunilkumar
Enrollment : 180420109009
Submitted To :
1. Dr. Nilesh Shah
2. Prof. Dimple Bhanabhagwanwala
Date Of Submission : 30th
April, 2021
MPMC 180420109009
PRACTICAL – 10.1
AIM : Write an embedded C program code to Transmit ‘A’ Serially continuously
CODE :
#include<reg51.h>
// fclk = 11.0592 MHz and 12 clocks per cycle
#define baud_9600 253
/* fclk = 11.0592 MHz and 6 clocks per cycle
#define baud_9600 250
fclk = 18.432 MHz and 12 clocks per cycle
#define baud_9600 251
fclk = 18.432 MHz and 62 clocks per cycle
#define baud_9600 250
*/
void main(void)
{
unsigned char i
SCON = 0x40; // serial mode 1 - 8bit variable baudrate
TMOD = 0x20; // timer 1 in mode 2
TH1 = baud_9600;
TL1 = baud_9600;
TR1 = 1;
for(i=0; i<10; i++)
{
SBUF = 'A';
while(TI == 0); // wait till transmission is completed
TI = 0;
}
}
MPMC 180420109009
PRACTICAL – 10.2
AIM : Write an embedded C program code to Receive Serially continuously.
CODE :
#include<reg51.h>
// fclk = 11.0592 MHz and 12 clocks per cycle
#define baud_9600 253
/* fclk = 11.0592 MHz and 6 clocks per cycle
#define baud_9600 250
fclk = 18.432 MHz and 12 clocks per cycle
#define baud_9600 251
fclk = 18.432 MHz and 62 clocks per cycle
#define baud_9600 250
*/
void main(void)
{
SCON = 0x40; // serial mode 1 - 8bit variable baudrate
TMOD = 0x20; // timer 1 in mode 2
TH1 = baud_9600;
TL1 = baud_9600;
TR1 = 1;
REN = 1; // enable recieve
while(1)
{
while(RI == 0); // wait till transmission is completed
RI = 0;
P1 = SBUF;
}
}
MPMC 180420109009
PRACITCAL – 10.3
AIM : Write an embedded C program code to Transmit and Receive Serially
continuously.
CODE :
#include<reg51.h>
// fclk = 11.0592 MHz and 12 clocks per cycle
#define baud_9600 253
/* fclk = 11.0592 MHz and 6 clocks per cycle
#define baud_9600 250
fclk = 18.432 MHz and 12 clocks per cycle
#define baud_9600 251
fclk = 18.432 MHz and 62 clocks per cycle
#define baud_9600 250
*/
unsigned char i = 0;
unsigned char msg[100];
unsigned char count = 0;
void main(void)
{
SCON = 0x40; // serial mode 1 - 8bit variable baudrate
TMOD = 0x20; // timer 1 in mode 2
TH1 = baud_9600;
TL1 = baud_9600;
TR1 = 1;
REN = 1; // enable recieve
ES = 1;
EA = 1;
while(1);
}
void serial_isr(void) interrupt 4
{
if(T1 == 1)
{
T1 = 0;
SBUF = msg[1]-0x20;
i++;
if(i>count)
TR1 = 0;
}
MPMC 180420109009
if(RI = 1)
{
RI = 0;
if(SBUF != '$')
{
msg[i] = SBUF;
i++;
count++;
}
else
{
i = 0;
SBUF = msg[i]-0x20;
i++;
}
}
}

Weitere ähnliche Inhalte

Ähnlich wie Micro Processor & Micro Controller Practical Notes_Electrical Engineering GTU.pdf

learning STM -32
learning STM -32 learning STM -32
learning STM -32
SeoTechnoscripts
 
STM -32
STM -32STM -32
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
Info plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercisesInfo plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercises
Mahmoud Hassan
 
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDEIntroduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
Pantech ProLabs India Pvt Ltd
 
Lab mke1503 mee10203 02
Lab mke1503 mee10203 02Lab mke1503 mee10203 02
Lab mke1503 mee10203 02
wanrizegillah
 
Firmware Debugging with PICkit2
Firmware Debugging with PICkit2Firmware Debugging with PICkit2
Firmware Debugging with PICkit2
IT de Veracruz
 
IBM iSeries Terminal Based Performance Testing with Rational Performance Tester
IBM iSeries Terminal Based Performance Testing with Rational Performance TesterIBM iSeries Terminal Based Performance Testing with Rational Performance Tester
IBM iSeries Terminal Based Performance Testing with Rational Performance Tester
Winton Winton
 
VLSI Training presentation
VLSI Training presentationVLSI Training presentation
VLSI Training presentation
Daola Khungur
 
Application specific Programming of the Texas Instruments ...
Application specific Programming of the Texas Instruments  ...Application specific Programming of the Texas Instruments  ...
Application specific Programming of the Texas Instruments ...
butest
 
xapp744-HIL-Zynq-7000
xapp744-HIL-Zynq-7000xapp744-HIL-Zynq-7000
xapp744-HIL-Zynq-7000
Umang Parekh
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Embarcados
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manual
RohiniHM2
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Ismailkhan77481
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
Wecon HMI PI Series Q&A
Wecon HMI PI Series Q&AWecon HMI PI Series Q&A
Wecon HMI PI Series Q&A
Lily Zheng
 
Documentation
DocumentationDocumentation
Documentation
Rajesh Seendripu
 
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery BoardProgramming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
Gaurav Verma
 
Ecad final
Ecad finalEcad final
Ecad final
Srinivas Sri
 
Altera up1
Altera up1Altera up1
Altera up1
Emery Laura Ttito
 

Ähnlich wie Micro Processor & Micro Controller Practical Notes_Electrical Engineering GTU.pdf (20)

learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
STM -32
STM -32STM -32
STM -32
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
 
Info plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercisesInfo plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercises
 
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDEIntroduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB® IDE
 
Lab mke1503 mee10203 02
Lab mke1503 mee10203 02Lab mke1503 mee10203 02
Lab mke1503 mee10203 02
 
Firmware Debugging with PICkit2
Firmware Debugging with PICkit2Firmware Debugging with PICkit2
Firmware Debugging with PICkit2
 
IBM iSeries Terminal Based Performance Testing with Rational Performance Tester
IBM iSeries Terminal Based Performance Testing with Rational Performance TesterIBM iSeries Terminal Based Performance Testing with Rational Performance Tester
IBM iSeries Terminal Based Performance Testing with Rational Performance Tester
 
VLSI Training presentation
VLSI Training presentationVLSI Training presentation
VLSI Training presentation
 
Application specific Programming of the Texas Instruments ...
Application specific Programming of the Texas Instruments  ...Application specific Programming of the Texas Instruments  ...
Application specific Programming of the Texas Instruments ...
 
xapp744-HIL-Zynq-7000
xapp744-HIL-Zynq-7000xapp744-HIL-Zynq-7000
xapp744-HIL-Zynq-7000
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manual
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
 
Wecon HMI PI Series Q&A
Wecon HMI PI Series Q&AWecon HMI PI Series Q&A
Wecon HMI PI Series Q&A
 
Documentation
DocumentationDocumentation
Documentation
 
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery BoardProgramming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
Programming the ARM CORTEX M3 based STM32F100RBT6 Value Line Discovery Board
 
Ecad final
Ecad finalEcad final
Ecad final
 
Altera up1
Altera up1Altera up1
Altera up1
 

Mehr von Parth Gajjar

Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdfSwitch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
Parth Gajjar
 
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Parth Gajjar
 
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Parth Gajjar
 
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdfEY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
Parth Gajjar
 
Management Information System (MIS) Project - Lotus Thread Company Limited & ...
Management Information System (MIS) Project - Lotus Thread Company Limited & ...Management Information System (MIS) Project - Lotus Thread Company Limited & ...
Management Information System (MIS) Project - Lotus Thread Company Limited & ...
Parth Gajjar
 
MBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
MBA Case Study Presentation Organization Theory & Decision - Parth GajjarMBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
MBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
Parth Gajjar
 

Mehr von Parth Gajjar (6)

Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdfSwitch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
Switch Gear & Protection Practical Notes_Electrical Engineering GTU.pdf
 
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
 
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...Electric Vehicle, it's types and Battery Management System_Summer Internship ...
Electric Vehicle, it's types and Battery Management System_Summer Internship ...
 
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdfEY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
EY Techathon 4.0 Solution by Parth Gajjar & Team.pdf
 
Management Information System (MIS) Project - Lotus Thread Company Limited & ...
Management Information System (MIS) Project - Lotus Thread Company Limited & ...Management Information System (MIS) Project - Lotus Thread Company Limited & ...
Management Information System (MIS) Project - Lotus Thread Company Limited & ...
 
MBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
MBA Case Study Presentation Organization Theory & Decision - Parth GajjarMBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
MBA Case Study Presentation Organization Theory & Decision - Parth Gajjar
 

Kürzlich hochgeladen

一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
architagupta876
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 

Kürzlich hochgeladen (20)

一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 

Micro Processor & Micro Controller Practical Notes_Electrical Engineering GTU.pdf

  • 1. Gajjar Parth Sunilkmar 180420109009 ELE(M) 3rd YR Micro Processor & Micro Controller May 2021 30th April, 2021
  • 2. INDEX PAGE MPMC 180420109009 SR No. DESCRIPTION DATE 1. Study of Block Diagram and Pin diagram of 8051 microcontroller 08 Feb. 2021 2. Introduction to KEIL μVISION4 IDE, assembler, compiler, linker, simulator, debugger and assembler directives 08 Feb. 2021 3. Block Data Transfer: 1. Internal RAM to Internal RAM data Transfer 2. External RAM to Internal RAM data Transfer 3. Code Memory to Internal RAM data transfer 4. Reverse Block of Data in internal RAM 5. Data Transfer with overlapping addresses 15 Feb. 2021 4. 1. Finding Washing Machine and TV Set code from a set of data 2. Find the number of vowels from a string available in code memory. 3. Separate ODD/Even Numbers 4.Separate POSITIVE/NEGATIVE Numbers 08 Mar. 2021 5. Code Conversion & Multibyte deminal addition 1. Hex to ASCII conversion using subroutine 2. ASCII to Hex comversion 3. Hex to BCD digit Separation 4. BCD to Hex conversion 5. Multibyte decimal number addition 22 Mar. 2021 6. Port Programming 1. Indicate the status of S/W pressed on LED 2. If S1 is pressed then display 55H and if S2 is pressed Display 0AAH. 29 Mar. 2021 7. Timer Programming 1. Generate a Square wave of 1 kHz frequency on P1.0 pin using timer-0 in mode-1. 2. Generate a Square wave of 1 kHz frequency on P1.0 pin using timer-0 in mode-2. 3. Update and display real time second on port-0 using timer-0 in mode-1 5 April. 2021 8. Seven Segment Display 1. Draw an Interfacing scheme to interface four common cathode seven-segment LEDs with 8051 and using this interfacing scheme write an embedded 'C' program to dipslay passing year. 2. Write an embedded 'C' program that updates and displays real-time second and minute on 4-digit common cathode seven segment display 26 April 2021 9. LCD Display Draw an Interfacing scheme to interface 20x2 LCD display with 8051. 1. Write an embedded 'c' program that displays "-- Welcome To-- "in line-1 and "--SCET, SURAT--" in line-2 of LCD display. 2. Write an embedded ‘c’ program that updates and displays Real-Time Clock data on LCD. 26 April 2021 10. Serial Communication 26 April 2021
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. INTRODUCTION TO KEIL VISION IDE AND OTHERS NAME : Gajjar Parth Sunilkumar Enrollment : 180420109009 Submitted To : 1. Dr. Nilesh Shah 2. Prof. Dimple Bhanabhagwanwala Date Of Submission : 27th February, 2021
  • 17. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS AIM : Introduction to KEIL μVISION4 IDE, assembler, compiler, linker, simulator, debuggerand assembler directives. Study of software development cycle using KEIL IDE. INTRODUCTION TO KEIL μVISION4 IDE : − The Keil C51 development tools offer numerous features and advantages that help you to develop embedded applications quickly and successfully. Find out more about the supported devices and the possible tool combinations available for the different 8051 variants. − The following block diagram shows the components involved in the build process.
  • 18. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS µVISION INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) : − The µVision4 IDE is a window-based software development tool that combines project management and a rich-featured editor with interactive error correction, option setup, make facility, and on-line help. − Use µVision4 to create source files and organize them into a project that defines your target application. C COMPILER : The Keil Cx51 Compiler is a full ANSI implementation of the C programming language and supports all standard features of the C language. In addition, numerous extensions have been included to directly support the 8051 and extended 8051 architecture. MACRO ASSEMBLER : The Keil Ax51 Macro Assembler supports the complete instruction set of the 8051 and all 8051 derivatives. LIBRARY MANAGER : The LIBx51 Library Manager allows you to create the object library from object files created bythe compiler and assembler. Libraries are specially formatted, ordered program collections of object modules that may be used by the linker at a later time. When the linker processes a library, only those object modules necessary to create the program are used. LINKER/LOCATER : The Lx51 Linker/Locater creates the final executable 8051 program and combines the object files created by the compiler or assembler, resolves external and public references, and assigns absolute addresses. In addition, it selects and includes the appropriate run-time library modules.
  • 19. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS µVISION4 DEBUGGER : The µVision4 Debugger is ideally suited for fast and reliable program debugging. The debugger includes a high-speed simulator capable of simulating an entire 8051 system including on-chip peripherals and external hardware. The µVision4 Debugger provides several ways to test programs on target hardware: − Use the Keil ULINK USB-JTAG adapter for downloading and testing your program. − Install a target monitor on your target system and download your program using the built-in monitor interface of the µVision Debugger. − Use the Advanced GDI interface to attach and use the µVision4 Debugger front end with your target system. RTOS KERNEL : The RTOS Kernel, describes the advantages of using a real-time kernel like the Keil RTX51 Tiny in embedded systems.
  • 20. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS STEPS FOR SOFTWARE DEVELOPMENT USING KEIL µVERSION4 IDE Step-1 : Open keil µversion4 IDE : Open keil µversion4 IDE, the window screen look like as shown below.
  • 21. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step:-2 : create new project, save project and select device : Select an empty folder and enter the project name, for example Project. The fileextension is *.UVPROJ for MDK version 4, or .UVPROJX for later versions.
  • 22. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Select device for a project [NXP (founded by Philips) in select Device Dialog box] Then select P89V51RD2 microcontroller from device database for NXP Semiconductor.
  • 23. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step-3 : Configure project, set frequency, enable hex file generation, specify memory blocks : Select options for target by right click on Target and set frequency. Select output options for target and tick on Create option for generating Hex file during Buildproject.
  • 24. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step-4 : Develop Source file by opening editor and save it with .A51 or .C Using the menu or toolbar, Create a source file with the menu File - New. This opens anempty file in the editor window. Write any Program using editor and save the file (menu File - Save As) to make useof the syntax coloring feature.
  • 25. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step-5 : Add source file to source group. You can add files in several ways to a project. The most common way is to click on a Source group in the window Project and use the context menu Add New Item to Group or Add Existing Files to Group. By clicking ADD button the file will be added in group in the project.
  • 26. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step-6: Build the target by clicking on Project menu and then Build Target option. The Build Output window displays errors, warnings, and build messages during the build process. Double-click a message to open the corresponding source file for correction and again build target until there is zero error and no warning.
  • 27. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS Step-7 : Start debugger for verification of program logic Debugging of program starts with clicking on the start debug session step by step. itcan be stop bye same button. After click on the start debug button, debugger window look like as shown below.
  • 28. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS ASSEMBLER DIRECTIVES EQU directive − The EQU directive is used to replace a number by a symbol. − Syntax:Name EQU Constant − For example: MAXIMUM EQU 99 After using this directive, every appearance of the label “MAXIMUM” inthe program will be interpreted by the assembler as the number 99 (MAXIMUM = 99). Symbols may be defined this way only once in the program. The EQU directive is mostly used at the beginning of the program therefore. SET directive − The SET directive is also used to replace a number by a symbol. The significant difference compared to the EQU directive is that the SET directive can be used an unlimited number oftimes: − SPEED SET 45SPEED SET 46SPEED SET 57 BIT directive − The BIT directive is used to replace a bit address by a symbol. The bit address must be in therange of 0 to 255 (00 H to FF H). − Syntax: Name BIT 8051 bit − For example: TRANSMIT BIT PSW.7; Transmit bit (the seventh bit in PSW register); is assigned the name “TRANSMIT”OUTPUT BIT 6 ;Bit at address 06 is assigned the name “OUTPUT”RELAY BIT81 ;Bit at address 81 (Port 0)is assigned the name ;”RELAY” CODE directive − The CODE directive is used to assign a symbol to a program memory address. Since the maximum capacity of program memory is 64K, the address must be in the range of 0 to65535(0000 H to FFFF H). − Syntax: Name CODE code address − For example: RESET CODE 0 ;Memory location 00h called “RESET”TABLE CODE 1024;Memorylocation 1024h called “TABLE”
  • 29. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS DATA directive − The DATA directive is used to assign a symbol to an address within internal RAM and SFR. The address must be in the range of 0 to 255 (00 H to FF H). It is possible to change or assign anew name to any register. − Syntax: Name DATA data address − For example: TEMP12 DATA 32 ;Register at address 32 is named ;as “TEMP12”STATUS_R DATA D0h ;PSW register is assigned the name ;”STATUS_R” IDATA directive − The IDATA directive is used to change or assign a new name to an indirectly addressedregister. It is an address of entire internal RAM. − Syntax: Name IDATA idata address − For example: TEMP22 IDATA 32 ;Register whose address is in register ;at address 32 is named as “TEMP22”TEMP33 IDATA T_ADR ;Register whose address is in ;register T_ADR is named as “TEMP33” XDATA directive − The XDATA directive is used to assign a name to registers within external (additional) RAMmemory. The addresses of these registers cannot be larger than 65535 (0000 h to FFFF H). − Syntax: Name XDATA xdata address − For example: TABLE_1 XDATA 2048 ;Register stored in external; memory at address 2048 is named; as“TABLE_1” ORG directive: Origin − The ORG directive is used to specify a location in program memory where the programfollowing directive is to be placed. − Syntax: ORG address − Address can be given in either in hex or decimal. − For example: BEGINNING ORG 100 ... ...ORG 1000hTABLE .......... This program starts at location 100. The table containing data is to be stored at location 1024 (1000h).
  • 30. MPMC 180420109009 INTRODUCTION TO KEIL VISION IDE AND OTHERS USING directive − The USING directive is used to define which register bank (registers R0-R7) is to be used in theprogram. − Syntax: USING Bank no. − USING 0 ;Bank 0 is used (registers R0-R7 at RAM-addresses 0-7)USING 1 ;Bank 1 is used (registers R0-R7 at RAM-addresses 8-15)USING 2 ,Bank 2 is used (registers R0-R7 at RAM-addresses 16-23)USING 3 ;Bank 3 is used (registers R0-R7 at RAM-addresses 24-31) END directive: End of program − The END directive is used at the end of every program. The assembler will stop compilingoncethe program encounters this directive. − Syntax: END − For example: END ;End of program DB directive − The DB directive is used for writing specified value into program memory. If several values are specified, then they are separated by a comma. If ASCII array is specified, it should be enclosedwithin single quotation marks. − For example: CSEG DB 22,33,’Alarm’,44 If this directive is preceded by a label, then the labelwill point to the first element of the array. It is the number 22 in this example.
  • 31. kactieal -3 Block diagsa daa dsansen 6 Jodena inkemal samo i xeama am eam iCode od Kevexse block da anser Lh visioN
  • 32. Initialze Sousco pointe Cao H) Ro initial ze denstioatfon poinHe CuO H) RL oRalize Counte C10) D Get Souace.Data COPY Sou veo dato to denghnatio o O CTenmen Souace &dengtination pointea by deCoement Counter by rer ts NO COunte YES End
  • 33. RHe An Bo51 pnaam to aanse o sel en 8bik OunobeK gtoxeo inlenal_RAM 20 H to intemal RAM CSEG AT OC00H MOV RO, F30H ninialfze 0urco poiote to SouneD dorta ininteanal RAM ah 30 H MOV R 0H iaithalize denstoahin painte iomal RAM at 0 H MOV R, 0 iniha lize CouoUL 10. MOV A, Ko Get doto oum ioema RAM DOÍOed b y Sou&c poine MOV @R A_ Store dota nm intem.al RAM o poinHed denshinoton poioHe INC Ro INC R DINZ Ra, Chec Cauole 0elgeump h focreroeaot Souepointe desbinohon paioHek HERE STMP HERE END Result le D:OX 30 29 66 88 6 34 63 55 48 olp - 2 G 8 16 34 63 s5 48 D: ox40 14 visioN
  • 34. tave t inttialize ioitHouze Sousce. pointe i000 H) DPTR deshioation pointere CHO H R nialze counHer=10 CioDO OM qet Souace ata CoP Souoce data O dlensth'n aho increment Sousce denshinahon poiote by decrement couoter b 1 NO COunte = O2 YES End
  • 35. 2. COuite assembly4 levelmquaqe pDaaam t 1aosek LO bi dota aNalable exkmal RAM mm ooo)H Stouhing iotmal RAM. m(40) H CSEG AT Oado H MOV DPTR,E100OH iaitialize 90ur painiet hspuree dota in exemal RAM_1000H MOV K,E 40H inithtaize deshnohon Pointe n Soum data io iotema RAM c uOH MOV Ra, 10 1oihalze counter 10 MoVX A,DPTR Get data.Jro extexnalL RAM paotedDuSougCo pointer MONCOR, A Stooe data in tenal RAn1 Doioteo by desinotion Pointek INC DPTR R oeaement_ Souree pOinteu NC inCveament deshhoanon nte DINZ Re, d checK Counte =o else ump wai HERE STMP HERE EN D |esalt Memay OX OXIoooLaddress1 8 6 2 31 6 o5 X O X00lO00 O 23 Memc 2 D 0x4o addess D0740 1O 23 31 4 58 6 12 81 O5 Memcr 05 visioN
  • 36. Date PageNo. 3. CONite Assembu level lanquaqepDgaam do oan.ser Staadiog m en- 9 bik data alailab le. C10002H 0 co.de 2emoy iotema RAMoDm CAo H CSEG AT O000 H MOV DPTR,# 1oooHinhalize Souar paioteg MOV Ri HoH inialize destioahion poioteg MoN R3, 600 initialize CowoHer 10 Li CLR A cea A bepre etarhoa oew MovC. A,@A+DPIR Get dato om Saurce poio-esc n CCCuoulat MOV (O Ri A Get doda mm accuoularhr to deshiocdhan 1NC DPTR INC R1 10co emen SouC Doioler_ 1oCeoeot deshoohon poi0ter DTNZ R3,L1 ehek Couoea 0 else ump hb_ LL HERE 6JMP HERE ND Kesut Meooy 1 7 C: Oxlbo0 Loddvess Cox1000 03 22 33 4t 5566 17 88 99a olp Memosy-2 D 0x4o address] D:ox4o 03 22 33 44 55 6614 8 99 A Quality Product by unges Your Lucky Brand Teacher'sSignature
  • 37. Date PageNo. CWuite aggembly leveL anguage poDganm Bo5L poncessox leveL acnske 3-hi data Qvhilablo- inte2rpal RA atatinqoDm 0 H11 39H n S ame loCatino but in i0Veaseaeyerse code AT 0000H MOV R0, E 30H fnitialize 90utce poio1e MOV RL#39H inihio ize desto oahoopoioer MOV R3 inihai z COuote =5 L MOV A,RO latching data m.m Souere p0iner dn alcumulator KCH A,R4 inerehongiog doto cSauaca uith desho ahon locohon ayailablo data MOv ( RO , H oching desito hion locethon3 doa laila ble in acuoulato Souc locahioo INC RO ce0 ent SoubO locoion DEC R1 DJNZ R3,Li check COunHea decne ment dehioahionOcotho0 = 0 e se ump do abLe L HERE STMP HERE Oait END KesuH2 D:OK30 O4 22 33 u s5 66 99 olp :0K 30 79 6G 5S G 33 22 AQultyProductby Gnges Your Lucky Brand Teacher's Signature
  • 38. Date PageNo. Weile a9senb anquaqe pmoan 3051 200Ce9Saa t so ner 8-bit Tam data auailablo in io-fema RAM staahoq- Om 30 H to i0-emal RAMStrahoq Dm35 H_Ovealapp.ing9- exishog Data CSEGAL OoO0H MOV RO 89Hinitialize 30uepniotear aih 0cohon o data sek MOV RL, 3EH Sinihalizo. desthootion pnioker ithlucatio.n zanse MOV R3, 0 inihlalu2o ounte Li MOV A RO got data Dm Souacapainterdn alcumalatmy Mov (o RL,A 20tch dota nm_ocCuroulatosh deshnahon DEC KRO decoenment Souc poine DEC R de ce roentdeshoohon 0oiatex DTNZ R3, 21 eheck Couoler = elseump to Lable Li. HERE STM HERE waik END Kesult DOx30 05 11 22 33 D0X35 55 66 o o3A D O 3 F Oo D:O 30 O5 22 33 D:Ox35 65 22 33 DOx3A 55 GC 74 88 AQUalily Productby GUnger DOK3F 0o Teacher's Signature Your LuckY E5rand
  • 39. Q ITH a A3 H de. • CSEG AT 0C)c)O K • MO) a o ".I.." l, e f<il 'llQL[z.e_. WM Cot.to~'lr =- o #- o C) • rnrh·alrze. w coun+-e?t :: o 0 cl- oo+ct, t1Dm Sou'lr"U Li • chec.K. 'tf e.nol d.o+a.. lf:fl r lvisk,NI
  • 40. i Ce-1 do-lo. {7-o.,, :n-1,~ ---. fbin-k...dv bcJ ~ulnP ~•o-k~ - . 'h <Da.fo. z: = "'- FFH 2 "'- ~ Ves louipuJ; 7 -~ --4,e_su.J/;- r~ tvO - ¼/M C'ou()~ 'a' ...... , ::: ++ :L L ' ~ Coun..e~ '- ,. ::: -+-+ i i rJo 1 V--- --- j 1 :L ]
  • 41. I 1 0 - C:rNt A.. # OA3 11 , L2. .. c.h ecJ< tp'lf" WM.. c.oc:l e. ., ,)c... R-~ • : () C.."ae.M er, b WM ~vn+ey ' _ C,:J~? L3 " c..hec.K &"!( (~t do¼ , L2. : ; ch€..LJ<. 'hn<" TV eoa,a_ L3 : INC.. ~~ . , ?n c.'"If e n;,er? l::- E3o u-n.t.- po lo ,k ¥ ; d?sp')Otl WM Cou()l:- on A,-.t -o MOJ 4<., RL< WAlT ~ -------tt--------------------------------' -------tt--------------------------------' -----;::===::-tr-----------------------------_.;-' lviiio•I
  • 42. I f<ea .. L 0 • 0 f/o • e. I I .,. rn:~ x. 3o : Ag DO ~b 9C Do A3 OC) 00 "O CfC. eo 83 ~ A3 I"); OX4t> . C)Q A3 93 oo (!)O . oc 9C oo P.3 B3 12.a 00 Oo JW n ): 0 X.EO : A3 co ~ a ~6 (33 60 PS oo 06 0 (J /3'-3 00 ~3 00 • 0/o ~ I I ~ p"'~'= - (' 1- .. ' 13 1--.;. 0 pc; : 0 '> 0~ a ✓- . "' ~ P,ns ! (fi ')(' (l' '6 ~ " 0 a ✓ d ' • ,,.;:p ?c:rr;:: - 1 '::- .. o--S - , (:) P-1 0 0 e) X: ('J {; ... . . ✓✓ ~ P,<)4. 0 ~ 1<: b 6 I ✓✓ . . . .. " . • tvislor,J
  • 43. e POAIN ! ,, 0 CLR A :ff 20H Sou'2re0- vowel ouoH~ ,:: 0 pc,i O.eJ... bcf S'OU'b"U-- p 0 o,+e t' • C.i ecJ<. 7f encl C L9- • c~e ~ " a 11 -------H-----..:..J..c.t...1--l-l----1.1--.----;~=--'--____.:.;:;.x;.._-e=;.;;._-.:;;,;.__ _ _ _ _ _ _ _ _ _ _~ 5JMP $-K o-a. tvislONI
  • 44. in:+:alize Sou~ po;o~~ -to coole. ""f't'OCfG':/ == ".DPT'R l ' ) L' , .. ,n,TJQ 12€; Vo weL cou()./e 'a" : 0 ']et do-b.. guf'( {!_()de. ro~"°oti'j ~10-ecl qj s~u~ poin-le'iY tJo (
  • 45. : . ee'. L'.3 • /9 • C1NE A. ff .., c'oe.c...K ~ ., e,, .. . ~'.TMP 6-<.H> • 'k> +o ne,cl-:- do-fa I y ' J 11 I II 13 ., CJN£. A "':f t1,", 'llt ., Dheel<- ~ e o' , ' -t I ,_, ' ~:11"'1 p 6¥-'? .. to Ob<.t" c::ilo-h::t 1 ao I u I I• !; i:f t:c' _ LS • Ch~<. 19 • C:IN E A ., ~~ r O, C , - P-.TM P c::v,P , afl -to (1p')(.f- Jo+-a ' ,.J .... us ·. CJtJF A_ #- E."-4>_ 1 r: 0 chee1, i:.oz( f -LI' " - -~Kr ~ Mal A.. 9<S A"D'D A.~ • ~n c.:6 eN?eot vowe.l Ctlun t ~ <f)A A • kclM)~L oA :I..LG ': ' .._; MOJ ~5, A I~ " t tJr TI?TR 0 to A - ---✓- 0 f)¼-: 0 , gou?a• ru,,.,n.lP'lt I - 61~? ACRlrJ 11?~M()AT~ : MO/ PO • tf<5 • d ,a.("'o.u Co tAf')C:- ~...:b - 0 , , {')(") I '1 WA1': ~TMO l.)AIT E l'1 :Q_ lvlsloif) I"""'"
  • 46. /1 i ~KPAtdl : • • • ' :1 i rilo : ~ ~ I I , II pf"'211: -- {' t Bi+.9 . , 0 ! ()(') ~ 0 / [Cf ✓✓ 1; ✓ 0 • - Q P;nQ : ,,., " r er " . ~ ✓/ ~ 0 ✓ - ~ lvlsloNI
  • 47. • e f) ruac~eo. 4 +he~ 50 ---'--------1~----------------------------------i CSE AT OBOo H MDJ 'ff 30 H SET 0 , -I MOJ RO d oe.--h"na-H' eve"' r() e('l) be,s'l MO ✓ R #SOH Q :, c,d_.,,l (()e"'1b~-rs • 0 cese,ec..t ,R1N (j) ., " get da+c.t, booJ{ - I to ?Ji h
  • 48. /n(·-ha/!'2e., Soub po/"k~ =- Ro (b:>nK,o) i"; h'a l·ze_ c,'00 f?P), ()O,ofe'i[ ~ R, (fxH•K --4) t'n,-h'o l/u.,, Gv;;:,v '14', pu,'n fe'lr' -=- Ro ( bon.l', JI.) r 7)aUlc.t., O 'D() d()-1-a., ro 9}y~CQ.. -12.veo clq½_ to Ioeo.f,"o<) p1ro-l{<)QJ.., ~ e-1&> po,·ok 7r" Joc.o+i~o n poin-k,L ~ oiop poit>W tocieroe<>c e>'DD po1·o+~ !'n c.:lferoe n I: gou1CL- po,n-/-P'lf de ocemet? t' C()t.ln -le)' I'
  • 49. ! f<lC. A ; }(.D+t.J~ bi+S ,.A' --Hvrovqh CP~ fo ~bf:- MO! (o) RD ., A ; S-m~ do-k1- ..fo £VGrv oles-n'na-fio0 po,nJecr INC' Rri'l ~ fn~u~t £V£(J ol~+i0-'"-, nn?n"N!''r ' ~JM9 ,~K P O'DD: R1r A ) )-W-to4e. bH·s t>l_ ~ p.:, ~"!5) V.'f h_ Co~ fo 14..+ ~ Mt}J (o) R ~ F • s-ta-re. ~a~ .ft- fl 'f)'i) de.~-H oa-h·n n lfll'li°f'l~'11' ' I ,. 1NC... R G fnC~('()ent'. 01)) ~.ffto-ht)r"") , O"infea- '") , ' ~<9 • 0 rt R R8r) ; AeP.o)p(""I.:- .9(/lQ,Q~~ banJ< - f I.J • tr.Jr R0 ~ :nfl 'T("P r-oP f')b a.,1, J 'M'°C,.... no in~Y 1):1Nz ie.~ ~ AOAIN WAY, : .~:-TM'.) WA, j;Nl) II! - (J{e~,d~ II> • 0 fID : l<ft'I~ / r)')( ~ 0 06 I l 2..Q 33 44 55 66 <as ~ 11" gq rJJ()' I , 1): O;(~o 0 ~e 22 '-14 6b 8-& I , 1): 0 -X5() 0 I 1 3.3 5S '=!::, C, '} D lvisloM .....
  • 50. • 0 1r = 10 • 0 , ? ,,, I ,,wfi Q LI 2 e_, 5ET6 4) bant<-, ArN ~ • x.a,+a-fe. b,+s +er.
  • 51. &taijt :n,-Ha llze.. SouPJCJ!- poin-/t'?r - t ~ Ro ( conl<-0) 1 ~i'+iollu tve.- nvro. pao.fe-;,- - fJ. ~ R. (b,Mt<-,) ,°n; 'a lt.z.e -Ve. nurn . Oin-le i,- - 3 ~ Ro (ban><-' ) //n?+fo /;u.., Coun-k'ff: 10 / J, no !5-ttRre- -Ne. ~d:oa ?n lo~+ioo ~clQ_J ~ "N~ po,o+e'b'" - 2 S1't>1re. --ve, -Head.i'n'd fn )oea--H·an ~v?d.a..of.. ~ ~ 0,0~'5" -3 [ ,•nc?Serneot: 9oucfC.fl- po?o-le-r J L dee creme.ob c.a un -/ey t Co
  • 52. NEGATIVE : RRr A ; )-(o-ro.fe._ bi'.-<; {' , A fhrroua h. , ' +n ..adC1hr MtJJ (o) Q - A ~ ,'?I do+a +o -Je.. ~u de A~_, p un .,_ • ffl l ~ -~ 1"1-( 1 ,1 l'l.: ,£" - - 1 ~r Q , ~ (" (!'Xt'f'(),0()~ -ve.. de.s+?oa-4,'>nn t"V fy,,+e'l( 91 - ' _q<P : r'l..9. Ran • de.a,e.ec.,; J'llJ__Q ~Sie'2J' bani-< - J ., V 1rJr f<l1) . (,) -i " n~~el"()e()~ SOU'ir/'b r>l'l .,n-k!f)(' I • r:r,rJz. f<3 , FG AIN WfT Pi,M'() 'W{)1" ~N~ 'KP~I ~ ,Cl e ... ~ ) (") : - " -,Lt -5 -~8 - l1 } ,, t) r:>:+ 25 33 F2 5b f7R jJC) 1): t)')( qD 0 f~ ~, /9 (if) If) ! I I / T): C);(~O 0 0-=f Q5 33 se 41 1q t) 'T'i ~ (') X - ~O ~ F5 r2 f'8 fJD ., - - -14 -5 -4 g lvisloNl
  • 53. 1JacAi Date: Page No.: Of Q "- o- ( AS - J. ) CJoe. ti f CSECt A1 C) e)O H i EX 2. AS e.. l 0 0 #"OAH Li. L • /._2_ A #O~H L -:f3QH cs~c Ai. 000 H MA a, MO) gp #SCH • • MOl A "J 30 H NL A #" or H AC.-ALL HE~ 2. Ase..,t f "oe t'-1 ()) 4oH A • ' Mov A H L----~~---- AN L A , ~ Oto H ! . - - - - - - 1 - - - - - - - SWA~ ~ A '----- Teacher's Signature_ _ _ _ _ _ _ _--!
  • 54. -~ c~l ti e,,c our(d:>el( 1 / Sepeir~ 1£9We¥ dt8,'l::- ~ -- 1 l [ HE-x 2 ~Sc.1J e.u.b-.,,u+rn_e.. ___ r::-~ AS~ - U') I ~ r - ,.-q-el::--H-~r-o~~ -___]/ ~e,'l)Q-te.. ~:9he'?r" d(8i°l _ --- ,----______l¥----~---, (Ht X 2 ASC.j Nd -1 Q Iadol. 3o 1-l ~ ~ --YES ]
  • 55. Date : I I Page No.: Aa.c.u HE?<2AP,f ~ c.al Su.b"'><"l"lu-h°n,.,, MCl L..t1 H - A ! ,:,J.-.....,., A!=!.C.1 h~o h .o ,r -t •o~.- / CJ 0 .lA'T 0 S"JM? WArT 0 .::ND r-- .. 1-<e.a.w.'c ,. '" d D :. l , 'I) ~ CJ X2,o 0 9F • 0 ID : I I m: C)')(:.lto " i{6 -'?-b .---:,, Ase..u va'lc,.e < L '1s ' Lt ASa..t.1 Vq'kt 01-, ll F IJ ~ I A .,,.,.,,ryl~ ~ ' Y our Lucky Btend Teacher's Signature
  • 56. Date: I Page No.: 'l-1frn ! WJ.ti'-1e. (j_ U ,J I 0 <"ll-1m r.e~ o/nila bl e.. YJ 1f'l4e?rnn RA-IVL l"l,- ?.I' 1-1 ~f 0~ o- /.i(') H • ~r-----1---- - - -- - - -- - - - - -- --------1 CSEQ AT 0000 H. MD1 A. 30 H 0 " get A'lr11 J(l1 ,12. / V r .'TN E. A.,-=:flH .. Li. • ('r, fY1 n,-, '°" ,/u._ ro D ,O.. oo).. (2,., 01 ' "" Q(),,..J u V l- L1- 0 'j C. L2. .. a.. }.-aQ r~ qpl- " "I C!.aJrJ,<-4 u <J .l <I 5VB6 A.., *01 H • . ~~ O"l ,, , ~I I I L2. ~ C..LR.. C.. 0 Ru h-h(acl:- '' 30 '' MOf PO .. A IJ 8:tM? WAYT A UUBJlty Product ~- Your Lucky Brand Teacher's Signature-__________
  • 57. [ I LS+aci'tj r ~et- ASCI. v o Lue. 1 Sub--hroc~ o'=t H 9 ~ Su.b-cfa c~ 'cc:> H l t t 5 -foaC... f-( f;_)( Volt., e dtsp?ay Rec. vo1u.e.- 0-0 Po'61- -o 1 ~ 7
  • 58. • -. Cl 0 X 40 . ! C • I 1) 0 01 0 Lt 0 0 • :D . (!) y_:Lt ' ~ • Wki'-k fY). • 9-b{; 1.t2 H Co~~ • • MOl 6 AB J L-10 H Date: Page No.: Qfu 05 Me~ uiJcdeot Rf~ ol: '-10 H CBen 2 (Be_'D :!. ODeS 30i ' 1 ·1-LhJ II Teacher's Signature__________
  • 59. 8to?S t r dt v~ de... a Ccc,roulo-fu¥ w:th 10 / 9to7ft, .s;em,n de Y ?fe..511 f- ,>n lf.Q H-. 1oeo -¼)-on
  • 60. Date: I I Page No.: fYf)) A~ ~ • Cle!:- 9-l(l' ...... J.r, --'t>'A' d)_ , O"'iiev:',..,, •S dvr~.~t1C :,...-+n ~ V ..., a.er ·- ,' -.l-..- . MOV B.i='10 f)j AB o , d3 1 , , ,"' s,an Ml"'l'l '-t2. H, 6 0 ., 8en:)'be. "ones " r-.AO.t~,,~ A~.. l . I V M oJ L< I I-{ .. A • " 5--'01r€., e~ 'TE tJS ,, ()r ~t-+fo () a.:~n: , I J 11. IA·"'' • 0 ~ 5:SMP wAT I=N1) 0 Q1-'.Q.1 l.- • ,, f /p:. I ., 'D ~ 07<,'.?.f"'l 0 f=F Q o lo :.. I I / D~ o ttio 0 02 05 Olt I> ~ ,, 11 ,, :1 Ao.iAy,:;r (!;' Teacher's Signature ~ Yourf..ud<y&ond
  • 61. -,, Date: I I Page No.: 'f). ~ ~im • (J)X I,-le., (i(l 11 t)('.) o.v1 h111 tone111n,.. 0. n·xr-1 O~n t'Y' ,f'h,.., I- • d (.} J , 0- n,,,...:lr.J-..1o . ·- ca- - h, 1- 9; ?e. P,f"T) nvrr,hPi'r' ,,,.... r J ?n+hrnat RA-Ni ol.,.. ~f) H_ Cecro 3) "" 3J K (13 CD a) - / ?JQ )-- lf?if1) i l ;'n--1-1 1?_.f- (?a,,'.,i,, /p,,., I- H£.X 0,(1-' q--h--x-i:i<l /,, val11P p {(tJ.... ; -., I QANl, al:- !., () 1-1 • KEX RJ) CcXDF e - A II ;- - I C'9EG A1 CCOOH MOJ A., 3e H e Sf12.-: ' 1 HON'' Bt-<D d,"a?~ I V 'CJ M01 B~ W'We) , . '"> MJL A6 ~ {'{)uJ.+fn 1u A ' a MO) 'R j_ 9 > ~ Jie.su.lt /() 4€,l'Y) 0. rz5eg/s,k2r . V MOJ A~ 'o 1-l ~ qe..b ti -kos IJ Be.CD deqJt ' D '-' - Mfrl 6 .,. :tt: I·(') · ::-. A~ # ('() LU1"Jolu MJL -' V ATJDC A"l R1 " o.dci(-Hoo dJ. N'lIll.{'ol.u .91tsJ.lt vei°th ~ ~'l/ t/)•~ .t,LSc.ff V V 1 A1>nc, A~ 32H /J ' a.cc,,kto0 ~11 "ones 11 8C..'!) digir- c.01-t+-t Sum o'. p~v;.,.,.,., V " V '-tt> H" A ,, MD J ' 61m-e. H I::?< VoU-4 e,.. c1l;- 40 H. r11AT ~ 6~M9 r<lA1 E)'i) A (:,~ Teacher's Signature Yoorl.JJcky8tan<I ...
  • 62. 'I HUN,, BCJD di~~ Sto'Ce. Jle.sut+- Jn ,femp , rcreats~}r t(j_ addM-foD d/5 ~s c.t.JJ- w'+-4 Vo.~ 1; +e,r,1 o. ~(S1o¥ J, 11 OflJEB ''
  • 63. , l Date: I I Page No.: - ft{P Cll l+.- • " f / D • .. I I .,. 'T)~ ri -x: ~ (') ~ 02.. C3 09 #' .I"' J() 16 • I f ✓ ff) : 0 -xlt 0 • ~r 0 ,- 5~5 Pnrn • ~JJJ{ (ff., 098ernbL, lano1,rro p n?rtJa 'Xnrv"I. to o .... 'I.. • Q.(1, n • l d (J ✓ I 0 -, l} :l-r.1 ln ,<n"' rn,11..L.."h,,..J..p rit?f'}<Y1n L adJ,-h'o1' D a <.J g956<l=7:J9 +- q 05 5 r, =t c, S ;: CC)DE • • e rPii=c A, (')000 -1 MOJ R: .. it= e:>~ · •• "-h' ,. coun-4-e'lr -=- -4 - .. 1n, Q I z._e_ ~ = Mtl'il Ro .. :¼½:- SaH - fn:-4,"Qlize... fVI io+etJ" l-,..,.,,. ('l(.H'tL~""' - ,r ' 50ulS<e. . ~ MOJ R1. ~ -:f: 40 H ; i'"74-i'o1:-.... "-Ou_,, a 1-.- nc.,fY)i.....,...,. - ':! I - ~E,R R:3D : 5e,:;,,,_I- no:>a ?,,.La," ~a.nK 1 u MD'l RO f) :f50 H •. fn(-h"q V,o d ~-1-i'n" -h'o n Ml lf'l+e~ ~ O(').::t,.,.,,,..,.. 7 I ~ C...LR ~SC) • d.e-5e.lec't- <oea(~r,y ~"'~ - 1 .. u L1.: t'I(")] A.. (o) Rf" ; 11..o+rh. 2.. dio f+'3 of}... '1uN">be~ - l. '-' " ...., F1)'0C., A .. (a:) <:. • c_cl_-U.... - .2. d.(~ ?+~ oi.. ()u.rnh•,.. - f) ~ (;! I.J """ DA A • ,.l.,., ?,-..,..,.. '. ,.,_f?,~o4- Cl'l... "" O()<l u-ioy -,I ... I AQUIJ/ity,~ ~- Teacher's Signature Yourl.,JckyBmnd
  • 64. ~ /h/Hql"ze.. ..Sou~ po;n-leb"" ~ oumbe-r :L = Ro (booK-o) ir, 1+-lQ L•2e,,, sou~ poio4t'~ e>11 f>vm btZ) - .2, ::: R1- lbal) K- 0 ) ,, 00 II ,,,,,f-H'al/z_e.. Co 1 .m-,..er f?3 = Lt CbonK - o) - ·i- I J_L l In I nq •z_e. des,ttna+i"o<) po/ o-k"r' Q ~ do.-+o... ~('( (O..e'lroct.. ~~' )oio4ecl 0d Sol.lerc.a... poin-te.'lr Q.cd,~O< t~;+(.. ~ J ci ON'umv.lo-foy w,-tt... 2,"cl nv<Y>be~ ,o o+n-oo.L QfM- '5--ft, 'lJe.- answe~ 1() des-hoo-hon pui""~" foe. l 1 ioctJl"~enb- des-b't1crlicm ()Q''lt,y Jc [:nc.oe"'?eot" _Sou&a- Po,,.,+eir i ~ gp - 2. J✓ I itlC0"l."rOe11b- covn-k'll" b¥ 1.. ~ i /(), A}(J :,~ II () 1 II 1 , f/ Jps.fina1'1011 po,11t-,,;y d,.~+t~f"c:l~'on po,'~'r" ) ') 4: r
  • 65. • Date : I Page No. : Roo • 6e1ec.k is~~ book' - 1 ~ Ro A • 3-tv-ire.... an Ro ; "Cbl"Menl;- d<?s+ioo..f.,· dese.l e bank'- 5ETB RS See.d: • • 5G 55 90 D ~ o x so ~ i 3 65 IQ._ §-0 o .1.. A Teacher's Signature__________
  • 66. Date dachicaL -6 Page No. : 6.1 Aim Wxite assemhly lanquag.e pongam fo incneme a COuoHe Sutrh aod s poesseol deCoeMeot a Couoe i Soitch 32 3 poessCol CukpukEthe Coun tex Value a POE1 CODE CSEG AT O000H MOV R3,HOoH Mov P2,# OFF H Coaquze ioitiade Couptea povt2Os p REP J3 P2.2, LL ump SL s 0ot _pvessedd NC R3 PLR3 display 0n 0nt Mov LLJB P2.1,L2 np S2 is ot paessed DEC R3 Mov P1, R3 dspo 00po L2 STMP REP END AQualiltyProductby Ginger Your Lucky Brand Teacher's Signature
  • 67. Stort inithaG2e COune = Cookguoe P2 = 1 pr S2 P2.2 r SL 0s p Pios YES incoearoent Coun ter PTesse d NO YES Decse ment 82 1s COun ter Presse NO isplay the Count on Pot-
  • 68. Date PageNo. Kesut p Pont2 P2 OXFB VVVVV V V bifs RosioxFB agt 3 yules i/p bi Poat V _ V PL OA03 PiosOK03 bits O Poat2 P2 0xFO V RosOxFO , bits O Pan PL0K02 V Pns Ko2 AQuelily Productby Ginges Teacher's Signature. Your Lucky Brand
  • 69. Date Page No. : 6.2 Alm COxte an assemblylangtiag.e 0DQAam & display95 H_i Switc h S1 s pesseo display displayOAA H EShowlo be clisploel On Paxt-1 SOite h S2 S 00esseol CODE CSEG AT 0000 H MOV P2,FOFFH Conhauxe paut90s inpu REP JB P2.1 LL ump S1 snot Poesse Moy P 55H displa 55 55H in olp Pot-1 Li JB P2.2 Aump i 2 hs not pressed MOV PL, OAAH lo disploy oAA H a_auhout Poat- L9 sTMP REP END A Quality Product by Gnger Your Lucky Brand Teacher's Signature
  • 70. Stoat Co0gube. P2.1 os SI Onod toA P2.2 hvr S2 os ilP Piog yES disploy 55H S1 is at Poot1 Pres3 ed NO displayAAH ex Pout-1/ S2 is YES Poessed
  • 71. Date Page No. Kesutt 2tp Poat-2 ,bits bits. 0 P2: oxFD VVVVVV V RosoKFD V/ / S . elp Poxt- 11 bts PL 0K35 ,. . Pios 55 Poat- 9 bits P2 Ox FB PosoxFB V Poo 1L bit S PLOx AA V. v, Hos O AOAA VV, Vv AQUalityProductby Gngers Teacher's Signature Your Lucky Brand
  • 72. Date PageNo. oac-hicaL - 1Aim Wmte assemblypoDgaanm that genexaies gae pulge 0 KHZ aequeocuLh50 L Duty o4cle oo Pi.o pio o 3051uSing hmer o mado.1 Hssume osellatox se . 0592 MHz, eCoDE SQW EQU PL.0 CSEG AT O000 H CLR SW S0w = O MOV TMOD,#OI 3 Cookjguxe himeo-o io mode -L MON TLO,33 lood inihial_cauc MOV THO EEH Shghes bts o nitial cost SETB TRO Stoat timer tOAITTBC TFO,NEXT cheak o imer oveou TMP WALIT NEXT MOV TLO,t33HSReloadioial Count MOV THo,#E OFEH CPL SQW (onplero ent p1.o bik STMP cOAIT END 'hesut (uasor-1 25.45192 Sec Cussoo 2 25. 4S 293 Secel lioe peiee 1 oee Cinge 1KH2 uene Teacher'sSignature
  • 73. (Stost Cleav Poot-1 bit o ConBgu ime - 0 in modle L oihal Coun o TLO THO / Stas hme O No TFO 1 YES Kelo ao oithaL C0unb+0 TOdTHo tog9 le bit Plo
  • 75. Date Page No. T.2 A Wefe_gssembly a09aam fhat qenera-tee gake pulse6 0 KHz equeo.cu oth50 Duty Cyale oo PL0pio B051 uSing limer 0 mado- 2 Asume 0ellator e l05 12 MKz CODE SQW EQU Pi.0 CSEG AT O000 H CLR MOV MOD 02 3 Coogqupe dimea o io mode-2 Mov TLO# LAH l0ad 8-bit 10HaL couot MOV THO, LAH MOV R3,#O0 User couoter SE T3TRO Stast oe& COAIT TBC TFO, NEXT check or mea oveou STMP WAIT NEXT 2 INC R3 í9Cvemeob C0uoter Uses CINE R3,#02 WAIT CheuK os hwp fones Oveou MOy K3, E O0H Heset Ounteg CPL SQD SIMpALT 10ggle the pulse END Quality Productby Ginger Your Lucky EBrand Teacher's Signature
  • 76. (Staat Clea Poat bit-o Coo 9ube timer O io mode -2 nih'hze ovelow co unter = o Looo hha L Count h TIO d THol tos himer O / NO TFO =iy yES incoement oveow Cuntex COunlea = 2 yES Reset Couokr to o go99 99 le he Pot bib PL.o
  • 77. Date PageNo. Kesult 2 LuasoxL 13.13363 Sec Cunsor 2 13.13463 Sec Clime pemoc LCuoLe O. O| Sec LmSe c 1KHz eguen.Cu AQualityProductby gen Your LuckyBrand Teacher's Signature.
  • 79. Date Page No. 13 Aim Wole asSembly2o09aam tha updaies and displat tme Secono Oo Pot0 8051 Usino Himed O20 m0de L Assuma 0SCillatx e .012 MHZ CoDE TOLSB EQD OFDH TOMSB EQO BH CSFG AT OOO0H_ R3, oH Counes=00 MOV R o0H MOV Sec O0 MOV P0, Ry MOV TMOD E0LH 3 Coobue 3dispo3 0n Post-o imeo 0ode - MOV TLD, FTOLSB load tial COuo MOV THO, TOMS3 SETB TRO Stax iroer OAIT TBC TFO , NEXTcheok ro Oveo ST MP C0AIT NET MOV TLO,#TO19B Reloao Lbtial Cos MOv THo ToSB INC R3 ocaemeot bsey couoten CTNE R3, H20,wAIT chec r 1ee MOV R3 #00H 2 Aese COuoer to oo Mov A, Ku AQualyProductby Ginger Your Lucky Brand Teacher'sSignature
  • 80. onepe Stoot User COunte k3 0 9etond. ountear Ru = O ioihalize initial/2ee CooBgue imer o in mode-l ood inihal couo TLO THO ChecK fur fimoe oveolow taatimer -O NO YES TFO== 1 TFO O 7eload himer oun kr n cotm ent counwr Rs NO R3 20 YES make counter o d odd 1 to gnd NO > dsploy Second second = bo 00 Post- o YES rmolke Second coun ter Ru = 0
  • 81. Date Page No. : ADD A, #o1 H upda te Sec idecimol DA A decimaladjus CTNE A # 60H, SKIP cheuk or 60 Sec MOV A, OoH Reset sec Ount SKIP MOV Ru, A_ MOy Po, R4_ displou Sec BTMP 0 AT END Kestl Poat 0 4 bits - Po Ox59 Kos0KOo Post-O bis PO OKIOD aller 5 Sec's Caorn Set nd lock_ 9taafe m Seconol AQuality Productb inger Your Lucky Brand Teacher's Signature
  • 82. SEVEN SEGMENT DISPLAY NAME : Gajjar Parth Sunilkumar Enrollment : 180420109009 Submitted To : 1. Dr. Nilesh Shah 2. Prof. Dimple Bhanabhagwanwala Date Of Submission : 30th April, 2021
  • 83. MPMC 180420109009 PRACTICAL – 8.1 AIM : Draw an Interfacing scheme to interface four common cathode seven-segment LEDs with 8051 and using this interfacing scheme write an embedded 'C' program to display passing year. CODE : #include<reg51.h> #define t0lsb 0x00 #define t0msb 0xEE bit bdata displayflg = 0; sbit SEL0 = P2^5; sbit SEL1 = P2^6; sbit SEL2 = P2^7; sbit LE = P3^7; unsigned char dispdata[4] = {2,0,2,1}; unsigned char code seven_seg[10] = {0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f}; void t0isr (void); void display (void); unsigned char disppos=0; void main(void) { P0 = 0; SEL0 = 0; SEL1 = 0; SEL2 = 0; LE=1; TMOD = 0x01; TL0 = t0lsb; TH0 = t0msb; ET0 = 1; TR0 = 1; EA = 1; while(1) { if (displayflg==1) { displayflg = 0; display(); }
  • 84. MPMC 180420109009 } } void t0isr (void) interrupt 1 { TL0 = t0lsb; TH0 = t0msb; displayflg = 1; return; } void display (void) { switch(disppos) { case 0: SEL0 = 0; SEL1 = 0; break; case 1: SEL0 = 1; SEL1 = 0; break; case 2: SEL0 = 0; SEL1 = 1; break; case 3: SEL0 = 1; SEL1 = 1; break; } P0 = seven_seg[dispdata[disppos]]; disppos++; if (disppos==4) disppos=0; } OUTPUT :
  • 85. MPMC 180420109009 PRACTICAL – 8.2 AIM : Write an embedded 'C' program that updates and displays real-time second and minute on 4-digit common cathode seven segment display CODE : #include<reg51.h> #define t0lsb 0x00 #define t0msb 0xEE bit bdata displayflg = 0; sbit SEL0 = P2^5; sbit SEL1 = P2^6; sbit SEL2 = P2^7; sbit LE = P3^7; unsigned char dispdata[4] = {2,0,2,1}; unsigned char code seven_seg[10] = {0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f}; void t0isr (void); void display (void); void rtc (void); unsigned char disppos=0, cnt = 0; unsigned char sec = 0, min = 0; void main(void) { P0 = 0; SEL0 = 0; SEL1 = 0; SEL2 = 0; LE = 0; TMOD = 0x01; TL0 = t0lsb; TH0 = t0msb; ET0 = 1; TR0 = 1; EA = 1; while(1) { if (displayflg==1) { displayflg = 0;
  • 86. MPMC 180420109009 display(); } } } void t0isr (void) interrupt 1 { TL0 = t0lsb; TH0 = t0msb; displayflg = 1; return; } void display (void) { switch(disppos) { case 0: SEL0 = 0; SEL1 = 0; break; case 1: SEL0 = 1; SEL1 = 0; break; case 2: SEL0 = 0; SEL1 = 1; break; case 3: SEL0 = 1; SEL1 = 1; break; } P0 = seven_seg[dispdata[disppos]]; disppos++; if (disppos==4) disppos=0; } void rtc (void) { sec++;
  • 87. MPMC 180420109009 if(sec == 60) { sec = 0; min++; if (min == 60) { min = 0; } dispdata[0] = min/10; dispdata[1] = min%10; } dispdata[2] = sec/10; dispdata[3] = sec%10; return; } OUTPUT :
  • 88. INTERFACING 20*2 LCD DISPLAY NAME : Gajjar Parth Sunilkumar Enrollment : 180420109009 Submitted To : 1. Dr. Nilesh Shah 2. Prof. Dimple Bhanabhagwanwala Date Of Submission : 30th April, 2021
  • 89. MPMC 180420109009 PRACTICAL – 9.1 AIM : Draw an Interfacing scheme to interface 20x2 LCD display with 8051. Write an embedded 'c' program that displays "--Welcome To--" in line-1 and "--SCET, SURAT-- " in line-2 of LCD display. CODE : #include<reg51.h> sbit RS = P2^7; sbit RWB = P2^6; sbit EN = P2^5; sbit BUSY = P0^7; unsigned char msg1[14] = {"--Welcome To--"}; unsigned char msg2[15] = {"--SCET, SURAT--"}; void lcd_cmd (unsigned char); void lcd_data (unsigned char); void ready(void); void lcd_initialize(void); unsigned char i, j, value; void main (void) { P2 = 0; EN = 0; P0 = 0; lcd_initialize(); lcd_cmd(0x80); // set DDRAM address for line-1 for (i=0; i<=13; i++) { lcd_data(msg1[i]); } lcd_cmd(0xc0); // set DDRAM address for line-2 for(i=0; i<=14; i++) { lcd_data(msg2[i]); } while(1); }
  • 90. MPMC 180420109009 void lcd_cmd(unsigned char value) { ready(); RS = 0; // select command register RWB = 0; // write command to lcd P0 = value; EN = 1; // latch command EN = 0; return; } void lcd_data(unsigned char value) { ready(); RS = 1; // select command register RWB = 0; // write command to lcd P0 = value; EN = 1; // latch command EN = 0; return; } void ready (void) { BUSY = 1; // Configure P0.7 as i/p point RS = 0; // select command register RWB = 1; // read command from lcd EN = 1; // latch command EN = 0; while(BUSY ==1) { EN = 0; EN = 1; } EN = 0; } void lcd_initialize(void) { lcd_cmd(0x3c); // 8bit/char, 2-line, 5*10 lcd_cmd(0x06); // right entry mode lcd_cmd(0x0E); // display on, cursor on, non blinking cursor lcd_cmd(0x01); // clear lcd, home cursor return; }
  • 91. MPMC 180420109009 OUTPUT : --Welcome To-- --SCET, SURAT-- PRACTICAL – 9.2 AIM : Write an embedded ‘c’ program that updates and displays Real-Time Clock data on LCD. CODE : #include<reg51.h> #define lsb 0xb0 #define msb 0x3c sbit RS = P2^7; sbit RWB = P2^6; sbit EN = P2^5; sbit BUSY = P0^7; unsigned char msg1[16] = {"--DigitalClock--"}; unsigned char disp_data[8] = 0; void lcd_cmd (unsigned char); void lcd_data (unsigned char); void ready(void); void lcd_initialize(void); void display_clock(void); void rtc(void); void t0isr(void); bit bdata secfig = 0; unsigned char i, j, cnt = 0, sec = 0, min = 0, hr = 0; void main (void) { EN = 0; TMOD = 0x01; // configure timer-0 in timer mode-1 TL0 = lsb; // load count for 50 ms overflow time TH0 = msb;
  • 92. MPMC 180420109009 ET0 = 1; // enable timer-0 overflow inturrept lcd_initialize(); lcd_cmd(0x80); // set DDRAM address for line-1 for(i=0; i<16, i++) { lcd_data(msg1[i]); } lcd_cmd(0xc0); // set DDRAM address for line-2 for(i=0; i<16; i++) { if(i == 2 | i == 5) lcd_data(':'); else lcd_data(disp_data[i]+'0'); } TR0 = 1; // start timer-0 EA = 1; // enable 8051 inturrept system while(1) { if(secflg == 1) { secflg = 0; rtc(); } } // end of while } // end of main void t0isr(void) interrupt 1 { TL0 = lsb; // reload timer count TH0 = msb; cnt++; if(cnt == 20) // check for 1 sec { cnt = 0; secfig = 1; } return; } void diplay_clock(void) { lcd_cmd (0xc0); for(i=0; i<8; i++) { if( i == 2 | i == 5)
  • 93. MPMC 180420109009 lcd_data(':'); else lcd_data(disp_data[i]+'0'); } return; } void rtc(void) { sec++; if (sec==60) { min = 0; min++; if(min == 60) { min = 0; hr++; if(hr == 24) hr = 0; disp_data[0] = hr/10; disp_data[1] = hr%10; } disp_data[3] = min/10; disp_data[4] = min%10; } disp_data[6] = sec/10; disp_data[7] = sec%10; display_clock(); } void lcd_cmd(unsigned char j) { ready(); RS = 0; // select command register RWB = 0; // write command to lcd P0 = j; EN = 1; // latch command EN = 0; return; } void lcd_data(unsigned char value) { ready(); RS = 1; // select command register RWB = 0; // write command to lcd P0 = j; EN = 1; // latch command EN = 0;
  • 94. MPMC 180420109009 return; } void ready (void) { BUSY = 1; // Configure P0.7 as i/p point RS = 0; // select command register RWB = 1; // read command from lcd EN = 1; // latch command EN = 0; while(BUSY ==1) { EN = 0; EN = 1; } EN = 0; } void lcd_initialize(void) { lcd_cmd(0x3c); // 8bit/char, 2-line, 5*10 lcd_cmd(0x06); // right entry mode lcd_cmd(0x0E); // display on, cursor on, non blinking cursor lcd_cmd(0x01); // clear lcd, home cursor return; }
  • 95. SERIAL COMMUNICATION NAME : Gajjar Parth Sunilkumar Enrollment : 180420109009 Submitted To : 1. Dr. Nilesh Shah 2. Prof. Dimple Bhanabhagwanwala Date Of Submission : 30th April, 2021
  • 96. MPMC 180420109009 PRACTICAL – 10.1 AIM : Write an embedded C program code to Transmit ‘A’ Serially continuously CODE : #include<reg51.h> // fclk = 11.0592 MHz and 12 clocks per cycle #define baud_9600 253 /* fclk = 11.0592 MHz and 6 clocks per cycle #define baud_9600 250 fclk = 18.432 MHz and 12 clocks per cycle #define baud_9600 251 fclk = 18.432 MHz and 62 clocks per cycle #define baud_9600 250 */ void main(void) { unsigned char i SCON = 0x40; // serial mode 1 - 8bit variable baudrate TMOD = 0x20; // timer 1 in mode 2 TH1 = baud_9600; TL1 = baud_9600; TR1 = 1; for(i=0; i<10; i++) { SBUF = 'A'; while(TI == 0); // wait till transmission is completed TI = 0; } }
  • 97. MPMC 180420109009 PRACTICAL – 10.2 AIM : Write an embedded C program code to Receive Serially continuously. CODE : #include<reg51.h> // fclk = 11.0592 MHz and 12 clocks per cycle #define baud_9600 253 /* fclk = 11.0592 MHz and 6 clocks per cycle #define baud_9600 250 fclk = 18.432 MHz and 12 clocks per cycle #define baud_9600 251 fclk = 18.432 MHz and 62 clocks per cycle #define baud_9600 250 */ void main(void) { SCON = 0x40; // serial mode 1 - 8bit variable baudrate TMOD = 0x20; // timer 1 in mode 2 TH1 = baud_9600; TL1 = baud_9600; TR1 = 1; REN = 1; // enable recieve while(1) { while(RI == 0); // wait till transmission is completed RI = 0; P1 = SBUF; } }
  • 98. MPMC 180420109009 PRACITCAL – 10.3 AIM : Write an embedded C program code to Transmit and Receive Serially continuously. CODE : #include<reg51.h> // fclk = 11.0592 MHz and 12 clocks per cycle #define baud_9600 253 /* fclk = 11.0592 MHz and 6 clocks per cycle #define baud_9600 250 fclk = 18.432 MHz and 12 clocks per cycle #define baud_9600 251 fclk = 18.432 MHz and 62 clocks per cycle #define baud_9600 250 */ unsigned char i = 0; unsigned char msg[100]; unsigned char count = 0; void main(void) { SCON = 0x40; // serial mode 1 - 8bit variable baudrate TMOD = 0x20; // timer 1 in mode 2 TH1 = baud_9600; TL1 = baud_9600; TR1 = 1; REN = 1; // enable recieve ES = 1; EA = 1; while(1); } void serial_isr(void) interrupt 4 { if(T1 == 1) { T1 = 0; SBUF = msg[1]-0x20; i++; if(i>count) TR1 = 0; }
  • 99. MPMC 180420109009 if(RI = 1) { RI = 0; if(SBUF != '$') { msg[i] = SBUF; i++; count++; } else { i = 0; SBUF = msg[i]-0x20; i++; } } }