Institute Vision: To Shape Electronics & Telecommunication Engineers To Be Professionally and Socially Competent
Institute Vision: To Shape Electronics & Telecommunication Engineers To Be Professionally and Socially Competent
To be an organization with potential for excellence in engineering and management for the
advancement of society and humankind.
INSTITUTE MISSION
VISION OF DEPARTMENT
MISSION OF DEPARTMENT
K. C. COLLEGE OF ENGINEERING
has performed and successfully completed all the practical’s in the subject
of for the
academic year 20 to 20 as prescribed by University of Mumbai.
DATE :-
------------------------
Internal Examiner Practical Incharge
COLLEGE SEAL
3
Program Outcomes
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated Conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological change.
Department of Electronics and Telecommunication
Subject: Microcontrollers & Class: S.E/Sem IV
Applications Laboratory
ECL401.4 Interface & write programs for Input and Output devices
RUBRICS OF PRACTICAL
Rubrics Max
Understand Understand
Understanding
experiment and experiment but Improper No
(R2)
5 drawn correct CONCLUSION CONCLUSION CONCLUSION
CONCLUSION less accurate (3-2) (2-0)
(5-4) (4-3)
three weeks or
discipline 5 within a week a week two weeks
more
(R3) (5-4) (3-2) (3-2)
(2-0)
TABLE OF CONTENTS
Sr. Name of Experiment Date of Date of Pg Grade Sign
No Performance Submission No.
1
1 Mini project based on any application related
to 8051 or ARM7 can be implemented.
1 Presentation of Mini-Project and video of
2 mini-Project
Total Grade / Marks :-
(A+B)
_______________________________ ____________________
AIM: - A] Write and 8051 program to add two 8-bit numbers stored at two memory
locations and observe the result at specified location.
B] Write and 8051 program to sub two 8-bit numbers stored at two memory locations
and observe the result at specified location.
Lab Outcome: -
Write programs for 8051 microcontrollers.
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 2A
AIM:- A] Write an 8051 program to add two 8-bit numbers stored at two memory locations and observe
the result at specified location.
THEORY: -
In this program, we perform the addition of two 8-bit numbers which is an arithmetic
operation. Thus we use A and B registers which are directly connected to ALU. In this
program the two 8- bit numbers are stored in these registers. Then using ADD instruction
weadd the data of register A and data of register B and check the result.
ORG 00H is the starting address of the program.
Giving the values as #0FFH and #00H initializes the ports as input and output ports
respectively.
R1 register is initialized to 0 so as to store any carry produced during the sum.
MOV B, P0 moves the value present in P0 to the B register.
MOV A, P1 moves the value present in P1 to Accumulator.
ADD AB adds the values present in Accumulator and B register and stores the result in
Accumulator.
PROGRAM:
MOV A, #22H
MOV B, #26H
ADD A,B
SJMP 3005
STEPS TO BE FOLLOWED:
4. Press. [CODE]
5. To set break point, press ‘T’. (i.e., to end address) [Enter two times]
RESULT:-
CONCLUSION:- With the help of 8051 Microcontroller LCD Kit we have performed the 8-bit
addition and observed the result in Accumulator and Register B .
EXPERIMENT NO. 2B
AIM: - B] Write an 8051 program to subtract two 8 bitnumbers stored at two memory locations and
observe the result at specified location.
THEORY: -
In this program, we perform the addition of two 8-bit numbers which is an arithmetic operation.
Thus, we use A and B registers which are directly connected to ALU. In this program the two 8-
bitnumbers are stored in these registers. Then using SUBB instruction, we subtract the data of
PROGRAM:
MOV A, #22H
SUBB A, R0
SJMP 3005
STEPS TO BE FOLLOWED:
4. Press. [CODE]
5. To set break point, press ‘T’. (i.e., to end address) [Enter two times]
RESULT:-
CONCLUSION: With the help of 8051 Microcontroller LCD Kit we have performed the 8-bit
addition and observed the result in Accumulator and Register B .
EXPERIMENT NO. 3(A) & (B)
AIM:- AIM: - A] Write and 8051 program to multiply two 8-bit numbers stored at
two memory locations and observe the result at specified location.
B] Write and 8051 program to divide two 8-bit numbers stored at two memory
locations and observe the result at specified location.
Lab Outcome: -
Write programs for 8051 microcontrollers.
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 3A
AIM:- Write an 8051 program to multiply two 8-bit nos. stored at two different memory locations&observe the
result at specified locations.
THEORY:-
PROGRAM:
MOV A, #12H
MOV B, #3H
MUL A, B
SJMP 3005
STEPS TO BE FOLLOWED:
4. Press. [CODE]
5. To set break point, press ‘T’. (i.e., to end address) [Enter two times]
RESULT:-
CONCLUSION:- With the help of 8051 Microcontroller LCD Kit we have performed the 8-bit
multiplication and observed the result in Accumulator and Register B
EXPERIMENT NO. 3B
AIM: -Write an 8051 program to divide two 8-bit nos. stored at two different
memory location & observe the result in accumulator and remainder in B register..
THEORY: -
In this program, we perform the division of two 8-bit numbers which is an arithmetic
operation. Thus, we use A and B registers which are directly connected to ALU. In
this program two 8-bit numbers are stored in 9301H and 9302H memory address
which are pointed by data pointer and further moved into A and B registers. Then
using DIV instruction we divide data of register A by register B and check the result
(quotient stored in accumulator and remainder if any will be stored in B register).
PROGRAM:
MOV A, #24H
MOV B, #06H
DIV A, B
SJMP 3005
STEPS TO BE FOLLOWED:
4. Press. [CODE]
5. To set break point, press ‘T’. (i.e., to end address) [Enter two times]
RESULT :-
CONCLUSION :- With the help of 8051 Microcontroller LCD Kit we have performed the 8-bit
addition and observed the result in Accumulator and Register B .
EXPERIMENT NO. 4
Lab Outcome: -
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 4
AIM:- WAP to perform logical operations of numbers stored on memory location or by Immediate and
Direct addressing mode.
THEORY:-
ANL:
The AND instructions compare the bits in the source and the destination operand and then store the result in
the accumulator after performing the AND operation.
Performs the AND operation on the data stored in the accumulator and the register Rn. The result is then
stored in the accumulator(e.g., A, Rn)
Uses the data stored in the register as an address and performs the AND operation on the data stored at that
address and the accumulator. The result is then stored in the accumulator(e.g., A, @Rn)
ORL:
The OR instructions compare the bits in the source and the destination operand and then store the result in
the accumulator after performing the OR operation.
Performs the OR operation on the data given by the programmer and the accumulator. The result is then
stored in the accumulator(e.g., A, #data)
Performs the OR operation on the data stored at the given address and the accumulator. The result is then
stored at the given address(e.g., Address, A)
XRL:
These instructions compare the bits in the source and the destination operand and then store the result in the
accumulator after performing the XOR operation.
Performs the XOR operation on the data stored at the given address and the data given by the programmer.
The result is then stored at the given address(e.g., Address, #data)
Performs the XOR operation on the data stored at the given address and the accumulator. The result is then
stored at the given address(e.g., Address, A)
RESULT:-
CONCLUSION:- Logical operations of numbers stored on memory location or by Immediate and Direct
addressing mode using EdSim.
EXPERIMENT NO. 5
AIM:- Write an 8051program to transfer block of data from internal
memory 50h to 60h. Assume block size.
Lab Outcome: -
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 5
AIM:- Write an 8051program to transfer block of data from internal memory 50h to
[Link] blocksize.
APPARATUS: EdSim.
THEORY: -
Initialize SP with an immediate data #90H. Initialize the pointer i.e DPTR
#9320H. Block of numbers are stored at location 9320H. Initialize the register
R0=0AH as the counter. Clear the internal memory address 29H & take first number
in accumulator. Compare the number with the lowest number. Start comparison with
every number. If number is greater than number in accumulator, carry will be
generated. Take that number in accumulator. If they are equal check for zero flag. It
will be zero, if it is less same number will remain in accumulator. Check for every
number. It continues till count tends to 0. Once count is 0, program stops, and
largest number is available.
PROGRAM:
MOV R0, #60H
MOV @R1, A
INC R0
INC R1
END
RESULT :-
AIM:- Write an 8051program to generate square wave and observe the result at
specified location.
Lab Outcome: -
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 6
AIM:- Write an 8051program to generate square wave and observe the result at specified location.
THEORY :-
Program:-
ORG 0000H
MOV TMOD,#20H
MOV TH1,#1AH
MAIN:CPL P1.3
ACALL DELAY
SJMP MAIN
DELAY:SETB TR1
AGAIN:JNB TF1,AGAIN
CLR TR1
CLR TF1
RET
END
RESULT:-
OUTPUT OF SQAURE WAVE:
CONCLUSION:- Generation of square wave is performed using EdSim and the output is seen on DAC
Scope.
EXPERIMENT NO. 7
Lab Outcome: -
Write programs for 8051 microcontrollers.
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 7
AIM:- Write an 8051program to generate triangular wave and observe the result at specified location.
THEORY:-
A timer can be generalized as a multi-bit counter which increments/decrements itself on receiving a
clock signal and produces an interrupt signal up on roll over. When the counter is running on the processor’s
clock , it is called a “Timer”, which counts a predefined number of processor clock pulses and generates a
programmable delay. When the counter is running on an external clock source (may be a periodic or
aperiodic external signal) it is called a “Counter” itself and it can be used for counting external events.
While designing delay programs in 8051, calculating the initial value that has to be loaded in to TH and TL
registers forms a very important thing. Let us see how it is done.
• Assume the processor is clocked by a 12MHz crystal.
• That means, the timer clock input will be 12MHz/12 = 1MHz.
• That means, the time taken for the timer to make one increment = 1/1MHz = 1uS.
• For a time delay of “X” uS the timer has to make “X” increments.
• 2^16 = 65536 is the maximum number of counts possible for a r.16 bit timer.
• Let TH be the value value that has to be loaded to TH register and TL be the value that has to be
loaded to TL register.
PROGRAM:-
CLR P0.7
MOV A, #00H
UP:INC A
MOV P1,A
CJNE A,0FFH,UP
DOWN: DEC A
MOV P1,A
CJNE A,#00H,DOWN
SJMP UP
END
RESULT:-
CONCLUSION:- Generation of triangular wave is performed using EdSim and the output is seen on DAC
Scope.
EXPERIMENT NO. 8
Lab Outcome: -
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 8
THEORY (Program):-
A Stepper Motor or a step motor is a brushless, synchronous motor which divides a full rotation into a
number of steps. Unlike a brushless DC motor which rotates continuously when a fixed DC voltage is
applied to it, a step motor rotates in discrete step angles. The Stepper Motors therefore are manufactured
with steps per revolution of 12, 24, 72, 144, 180, and 200, resulting in stepping angles of 30, 15, 5, 2.5, 2,
and 1.8 degrees per step. The stepper motor can be controlled with or without feedback. Stepper motors
work on the principle of electromagnetism. There is a soft iron or magnetic rotor shaft surrounded by the
electromagnetic stators. The rotor and stator have poles which may be teethed or not depending upon the
type of stepper. When the stators are energized the rotor moves to align itself along with the stator (in case
of a permanent magnet type stepper) or moves to have a minimum gap with the stator (in case of a variable
reluctance stepper). This way the stators are energized in a sequence to rotate the stepper motor.
PROGRAM:-
MOV TMOD, #50H ; put timer 1 in event counting mode
SETB TR1 ; start timer 1
MOV DPL, #LOW(LEDcodes) ; | put the low byte of the start address of the
; | 7-segment code table into DPL
CLR P3.4 ;|
CLR P3.3 ; | enable Display 0
again:
CALL setDirection ; set the motor's direction
MOV A, TL1 ; move timer 1 low byte to A
CJNE A, #10, skip ; if the number of revolutions is not 10 skip next instruction
CALL clearTimer ; if the number of revolutions is 10, reset timer 1
skip:
MOVC A, @A+DPTR ; | get 7-segment code from code table - the index into
the table is
; | decided by the value in A
; | (example: the data pointer points to the start of the
; | table - if there are two revolutions, then A will contain two,
; | therefore the second code in the table will be copied to A)
MOV P1, A ; | move (7-seg code for) number of revolutions and motor direction
; | indicator to Display 0
JMP again ; do it all again
setDirection:
PUSH ACC ; save value of A on stack
PUSH 20H ; save value of location 20H (first bit-addressable
; location in RAM) on stack
CLR A ; clear A
MOV 20H, #0 ; clear location 20H
MOV C, P2.0 ; put SW0 value in carry
MOV ACC.0, C ; then move to ACC.0
MOV C, F0 ; move current motor direction in carry
MOV 0, C ; and move to LSB of location 20H (which has bit address 0)
JMP finish ; if they are the same, motor's direction does not need to be changed
changeDir:
CLR P3.0 ;|
CLR P3.1 ; | stop motor
CALL clearTimer ; reset timer 1 (revolution count restarts when motor direction
changes)
MOV C, P2.0 ; move SW0 value to carry
MOV F0, C ; and then to F0 - this is the new motor direction
MOV P3.0, C ; move SW0 value (in carry) to motor control bit 1
CPL C ; invert the carry
MOV P3.1, C ; | and move it to motor control bit 0 (it will therefore have the opposite
; | value to control bit 1 and the motor will start
; | again in the new direction)
finish:
POP 20H ; get original value for location 20H from the stack
POP ACC ; get original value for A from the stack
RET ; return from subroutine
clearTimer:
CLR A ; reset revolution count in A to zero
CLR TR1 ; stop timer 1
MOV TL1, #0 ; reset timer 1 low byte to zero
SETB TR1 ; start timer 1
RET ; return from subroutine
LEDcodes: ; | this label points to the start address of the 7-segment code table which is
; | stored in program memory using the DB command below
DB 11000000B, 11111001B, 10100100B, 10110000B, 10011001B, 10010010B, 10000010B,
11111000B, 10000000B, 10010000B
RESULT:-
Lab Outcome: -
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 10
Lab Outcome: -
Design an application using microcontroller.
Date of Performance: -
Date of Submission: -
_________________________________________________
Practical Incharge
EXPERIMENT NO. 10
AIM:- Innovative experiments: Interface PIR sensor with Arduino on Tinkercad
THEORY:-
All objects, including the human body, at temperatures above absolute zero (0 Kelvin / -273.15 °C) emit
heat energy in the form of infrared radiation. The hotter an object is, the more radiation it emits. This
radiation is not visible to the human eye because it is emitted at infrared wavelengths. The PIR sensor is
specifically designed to detect such levels of infrared radiation.
1. A pyroelectric sensor, which you can see in the image below as a round metal with a rectangular
crystal in the centre.
2. A special lens called a Fresnel lens which Focuses the infrared signals on the pyroelectric sensor.
RESULT:-
CONCLUSION:- With the help of ThinkerCad interfacing of PIR sensor with Ardunio is done and we see
that as the switch is turned on the led glows.