SlideShare a Scribd company logo
8051 Interfacing & Applications
Subject : Processor Architecture & Interfacing
Class : SEIT
Prepared By
Ms. K. D. Patil, AP
Department of IT, Sanjivani COE, Kopargaon.
Prepared By: Ms. K. D. Patil 1
8255 PPI Pin
Diagram
Prepared By: Ms. K. D. Patil 2
8255 Block Diagram
Prepared By: Ms. K. D. Patil 3
8051 Interfacing LCD (Liquid Crystal
Display)
Prepared By: Ms. K. D. Patil 4
Prepared By: Ms. K. D. Patil 5
Pin Connection
8051
P0
P7 LCD
VCC
VEE
VSS
RS R/W E
D0
D7
P3.3
P3.2
10K
POT
+5V
Prepared By: Ms. K. D. Patil 6
LCD Program
• org 0000h
• mov a,#38h ; INITIALIZE 2 line 5x7
• acall comm ;CALL COMMAND SUBROUTINE
• acall delay ;GIVE LCD SOME TIME
• mov a,#0eh ;DISPLAY ON,CURSOR ON
• acall comm ;CALL COMMAND SUBROUTINE
• acall delay
• mov a,#01h ;clear LCD
• acall comm
• acall delay
• mov a,#06h ;shift cursor right
• acall comm
• acall delay
• mov a,#80h ;FORCE CURSOR TO BEGINNING OF FIRST LINE
• acall comm
• acall delay
Prepared By: Ms. K. D. Patil 7
LCD Program
• mov a,#„S'
• acall data1 ;CALL DISPLAY ROUTINE
• acall delay
• mov a,#'R'
• acall data1
• acall delay
• mov a,#„E'
• acall data1
• acall delay
• mov a,#'S'
• acall data1
• acall delay
Prepared By: Ms. K. D. Patil 8
LCD Program
• comm: ;SEND COMMAND TO LCD
• mov p0,a ;COPY REG A TO PORT0
• clr p2.2 ;RS=0 FOR COMMAND
• clr p2.1 ;R/W=0 FOR WRITE
• setb p2.0 ;E=1
• clr p2.0 ;E=0
ret
• data1: ;WRITE DATA TO LCD
• mov p0,a ;COPY REG A TO PORT0
• setb p2.2 ;RS=1 FOR DATA
• clr p2.1 ;R/W=0 FOR WRITE
• setb p2.0 ;E=1
• clr p2.0 ;E=0
ret
• delay: mov r1,#255
• here2: mov r2,#255
• here: djnz r2,here
• djnz r1,here2
• Ret
• end
Prepared By: Ms. K. D. Patil 9
8051 Interfacing LED
• LED (Light Emitting Diode) is a P N
junction diode which emits light when
activated.
• It is activated when the PN junction
sustains a forward voltage (forward bias), a
current from P to N, called forward current.
• When this current is applied, electrons
recombine with electron holes within the
device thereby releasing energy in form of
light.
• LED finds application in traffic signals,
lighting, camera flashes etc.
• The way to distinguish between the
positive and negative terminal is, the
positive is longer than the negative in
length.
Prepared By: Ms. K. D. Patil 10
8051 Interfacing LED
• While LEDs are interfaced
with 8051, Quartz crystals or
ceramic resonator that
determines the operating
frequency of 8051
microcontroller is needed.
• The XTAL1 and XTAL2 can
be configured in two ways;
• external clock drive configuration
• internal clock drive configuration.
• Two capacitors C1 and C2
are connected to the quartz
crystal. It can be a quartz
crystal or ceramic resonator.
• The crystal oscillator frequency is
from 1.2MHz to 12MHz. The crystal
oscillator is used to generate clock
pulses that provide the means for
timing calculation.
• Crystal pins are connected to the
ground through capacitors of 33pf.
Prepared By: Ms. K. D. Patil 11
8051 Interfacing LED
• In the following Diagram, LEDs are connected to the
port P0.
• LEDs need approximately voltage drop of 1.7V and
10mA current to flow through them in order to glow at
maximum intensity.
Prepared By: Ms. K. D. Patil 12
8051 Interfacing LED
Prepared By: Ms. K. D. Patil 13
8051 Interfacing 7 Segment Display
• 7 segment display is a 10 pin electronic component
with eight led’s embedded inside it to displays number
from 0 to 9 even we can display few characters like A,
B, C, H, E, e, F, etc. .
• It is available in two configurations:
• common cathode
• common anode
• In Common Anode to light up any given segment the
corresponding Cathode pin should be connected to
ground or reference ,which completes the circuit and
LED will be in forward bias.
• In Common Cathode to corresponding LED Anode pin
the circuit will be completed and the particular LED will
be light up since it will be in forward bias.
Prepared By: Ms. K. D. Patil 14
8051 Interfacing 7 Segment Display
• A seven segment display consists
of seven LEDs arranged in the
form of a “squarish eight”
slightly inclined to the right and a
single LED as the dot character.
Different characters can be
displayed by selectively glowing
the required LED segments.
Prepared By: Ms. K. D. Patil 15
8051 Interfacing 7 Segment Display
Prepared By: Ms. K. D. Patil 16
8051 Interfacing ADC
• Digital computers use binary
values but in physical world
everything is Analog
(continuous) eg. Temperature,
Pressure
• A physical quantity is converted
into electrical (voltage, current)
signals using a device called as
Transducer (also referred as
Sensors).
• We need Analog-to-Digital
converter (ADC) to translate
Analog signals to Digital number
so that Microcontroller can read
and process them.
• ADC0808 allows us to monitor
upto 8 different analog input
channels using single chip
Prepared By: Ms. K. D. Patil 17
ADC0808
Prepared By: Ms. K. D. Patil 18
Address Lines (A,B,C)
Selected ADC
channel
C B A
IN0 0 0 0
IN1 0 0 1
IN2 0 1 0
IN3 0 1 1
IN4 1 0 0
IN5 1 0 1
IN6 1 1 0
IN7 1 1 1
• ADC0808 has 8-bit
data output
• 8 analog input
channels are
multiplexed and
selected using three
address pins A, B & C.
Prepared By: Ms. K. D. Patil 19
Signals for A/D Conversion
• Address Latch Enable (ALE): A LOW-TO-HIGH signal at this
pin will latch the above-selected address and selected the
respective channel for ADC conversion.
• START Conversion (SC): The A/D converter‟s successive
approximation register (SAR) is reset on the positive edge of the
start conversion (SC) pulse. Thus we need to generate a LOW-
HIGH pulse for starting the ADC conversion.
• End of Conversion (EOC): Once the conversion is over, this
pin is pulled HIGH by ADC0808. This pin needs to be monitored
for the conversion to complete and then read the data.
• Output Enable(OE): ADC0808 does the A/D conversion and
holds the data in the internal registers. A HIGH signal on this pin
will bring the data on the output lines.
• D0-D7 are the digital Data output lines.
Prepared By: Ms. K. D. Patil 20
8051 Interfacing ADC
Prepared By: Ms. K. D. Patil 21
8051 Interfacing ADC
Prepared By: Ms. K. D. Patil 22
8051 Interfacing Temperature Sensor
(LM34/LM35)
• Temperature is converted to electrical signals using a
transducer called as Thermistor.
• Simple and widely used Temperature sensors include
LM34 & LM35 from Semiconductor Corp
• LM34 does not require external calibration since it is
internally calibrated.
• LM35 are precision integrated circuit temperature sensors
whose output voltage is linearly proportional to Celsius
temp. It does not require external calibration since it is
internally calibrated. It outputs 10mV for each degree of
centigrade temperature.
Prepared By: Ms. K. D. Patil 23
Signal Conditioning
• Sensors produce the
output in the form of
voltage, current, charge,
resistance & capacitance.
• But, we need to convert
these signals to voltage in
order to send input to ADC.
• This conversion is called as
Signal conditioning.
• Signal conditioning can be
current to voltage
conversion or signal
amplification.
Analog World
(temperature, pressure)
Transducer (Sensor)
Signal Conditioning
ADC
Microcontroller
Prepared By: Ms. K. D. Patil 24
Connecting LM35 to ADC
Temp (C) Vin (mV) Vout
(D7-D0)
0 0 0000 0000
1 10 0000 0001
2 20 0000 0010
3 30 0000 0011
10 100 0000 1010
30 300 0001 1110
• Since ADC has 8 bit
resolution with a max
of 256 steps and LM35
produces 10mV for
every degree of
temperature change,
we can condition Vin of
the ADC to produce a
Vout of 2.56V for full
scale output. So
Vref= 2.56
Temperature Vs Vout for ADC
Prepared By: Ms. K. D. Patil 25
Interfacing Diagram
Prepared By: Ms. K. D. Patil 26
8051 Interfacing DAC
• Microcontroller are used in wide variety of applications like for
measuring and control of physical quantity like temperature,
pressure, speed, distance, etc.
• In these systems microcontroller generates output which is in
digital form but the controlling system requires analog signal as
they don't accept digital data thus making it necessary to use
DAC which converts digital data into equivalent analog voltage
• Digital to Analog Converter is a device used to convert digital
pulses to analog signals.
• In the figure shown, we use 8-bit DAC 0808. This IC converts
digital data into equivalent analog Current. Hence we require an
I to V converter to convert this current into equivalent voltage.
• DAC0808 provides 256 discrete voltage (or current) levels of
output.
Prepared By: Ms. K. D. Patil 27
DAC0808
• In the MC1408 (DAC0808), the digital inputs are converted
to current (Iout), and by connecting a resistor to the Iout pin,
we convert the result to voltage.
• The total current provided by the Iout pin is a function of the
binary numbers at the D0 – D7 inputs of the DAC0808 and
the reference current (Iref), and is as follows:
• where D0 is the LSB, D7 is the MSB for the inputs, and Iref
is the input current that must be applied to pin 14. The Iref
current is generally set to 2.0 mA.
Prepared By: Ms. K. D. Patil 28
Prepared By: Ms. K. D. Patil 29
Interfacing Diagram
Prepared By: Ms. K. D. Patil 30
8051 Interfacing Stepper Motor
 Stepper motor is a widely
used device that
translates electrical pulses
into mechanical
movement
 Stepper motor is used in
applications for position
control such as
 disk drives
 dot matrix printer
 robotics etc.
 Stepper motors commonly
have a permanent magnet
rotor (shaft) surrounded
by a stator
Prepared By: Ms. K. D. Patil 31
• Commonly used stepper
motors have four stator
windings that are paired
with a center – tapped
common. Such motors are
called as four-phase or
unipolar stepper motor.
• It has a permanent magnet
rotor (shaft) which is
surrounded by a stator.
• A practical PM stepper
motor will have 1.8 degrees
step angle and 50 tooth on
its rotor.
• There are 8 main poles on
the stator, each having 5
tooth in the pole face
Prepared By: Ms. K. D. Patil 32
Prepared By: Ms. K. D. Patil 33
Prepared By: Ms. K. D. Patil 34
Prepared By: Ms. K. D. Patil 35
Prepared By: Ms. K. D. Patil 36
4 step Sequence
Step Windi
ng A
Windi
ng B
Windi
ng C
Windi
ng D
1 1 0 0 1
2 1 1 0 0
3 0 1 1 0
4 0 0 1 1
Prepared By: Ms. K. D. Patil 37
Step Angle
• Step angle is defined as the minimum degree of rotation
associated with a single step.
• Total number of steps needed to rotate 360 degrees is
Steps per Revolution.
No of steps per revolution = 360° / step angle
• Steps per second = (rpm x steps per revolution) / 60
• Example: step angle = 2°
No of steps per revolution = 180
Prepared By: Ms. K. D. Patil 38
Interfacing Diagram
Prepared By: Ms. K. D. Patil 39
8051 Interfacing Keyboard
• Keyboards are organized in a matrix of rows and columns.
• The CPU processes both rows and columns through ports
• So, with two 8-bit ports, an 8X8 matrix of keys can be
connected to the controller.
• When a key is pressed, a row and a column make a
contact. Otherwise there is no connection
• In microcontroller, programs stored in EPROM scan the
keys continuously.
• In the following figure, 4 X 4 matrix connected to two ports.
rows are connected to output ports and columns are
connected to an input port.
Prepared By: Ms. K. D. Patil 40
Matrix Keyboard connection to Ports
Prepared By: Ms. K. D. Patil 41
Scanning & Identifying Key
• It is a function of microcontroller to scan the keyboard
continuously to detect and identify key pressed
• To detect Pressed key microcontroller grounds all rows by
providing 0 to output latch, then it reads the columns
• If the data read from columns is D3-D0 = 1111 , no key is pressed
and the process continues till key press is detected.
• If one of the column bits has a zero, means key press has
occurred.
• If D3-D0 = 1101 this means that key in the column D1 has been
pressed.
• After detecting a key press, microcontroller will go through the process
of identifying key.
Prepared By: Ms. K. D. Patil 42
Scanning & Identifying Key
• Starting with the top Row, the microcontroller grounds it by
providing a low to Row D0 only
• If reads a column if data read is all 1s, no key in that row is
activated and the process is moved to the next row.
• It grounds the next row, reads the columns, and checks for
any zero
• This process continues until row is identified
• After identification of the Row in which Key has been
pressed, find out column the key press belongs to
Prepared By: Ms. K. D. Patil 43
References:
• M. A. Mazidi, J. C. Mazidi, R. D. McKinlay, “The 8051
Microcontroller & Embedded Systems using Assembly and
C”, 2nd Edition, Pearson publication
Prepared By: Ms. K. D. Patil 44

More Related Content

What's hot

Schmitt trigger basics
Schmitt trigger  basicsSchmitt trigger  basics
Schmitt trigger basicsSAQUIB AHMAD
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller featuresTech_MX
 
Optimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN ChannelOptimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN Channel
AWANISHKUMAR84
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontrollerDiwaker Pant
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
KanchanPatil34
 
41 projects using ic 741 op amp
41 projects using ic 741 op amp41 projects using ic 741 op amp
41 projects using ic 741 op amp
Pablo Sanabria
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
anishgoel
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
Shazid Reaj
 
Types of time base generators
Types of time base generatorsTypes of time base generators
Types of time base generators
Ketki Jakatdar
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
Ankur Mahajan
 
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
RMK ENGINEERING COLLEGE, CHENNAI
 
7 Segment Display
7 Segment Display7 Segment Display
7 Segment Display
DEPARTMENT OF PHYSICS
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
Syed Umair
 
Bio amplifiers - basics
Bio amplifiers - basicsBio amplifiers - basics
Bio amplifiers - basics
AtheenaPandian Enterprises
 
Kelvin bridge and kelvin double bridge
Kelvin bridge and kelvin double bridge Kelvin bridge and kelvin double bridge
Kelvin bridge and kelvin double bridge
karoline Enoch
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051
ssuser3a47cb
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adcPRADEEP
 
Ppt on sawtooth wave form generator
Ppt on sawtooth wave form generatorPpt on sawtooth wave form generator
Ppt on sawtooth wave form generator
Amit kumar
 
Physiological transducers
Physiological transducersPhysiological transducers
Op amp-electronics
Op amp-electronicsOp amp-electronics
Op amp-electronics
humakhan1357
 

What's hot (20)

Schmitt trigger basics
Schmitt trigger  basicsSchmitt trigger  basics
Schmitt trigger basics
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
 
Optimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN ChannelOptimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN Channel
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontroller
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
41 projects using ic 741 op amp
41 projects using ic 741 op amp41 projects using ic 741 op amp
41 projects using ic 741 op amp
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 
Types of time base generators
Types of time base generatorsTypes of time base generators
Types of time base generators
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
EC8353 ELECTRONIC DEVICES AND CIRCUITS Unit 1
 
7 Segment Display
7 Segment Display7 Segment Display
7 Segment Display
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
 
Bio amplifiers - basics
Bio amplifiers - basicsBio amplifiers - basics
Bio amplifiers - basics
 
Kelvin bridge and kelvin double bridge
Kelvin bridge and kelvin double bridge Kelvin bridge and kelvin double bridge
Kelvin bridge and kelvin double bridge
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
Ppt on sawtooth wave form generator
Ppt on sawtooth wave form generatorPpt on sawtooth wave form generator
Ppt on sawtooth wave form generator
 
Physiological transducers
Physiological transducersPhysiological transducers
Physiological transducers
 
Op amp-electronics
Op amp-electronicsOp amp-electronics
Op amp-electronics
 

Similar to 8051interfacing 190425062221

Adc and dac
Adc and dacAdc and dac
Adc and dac
nitugatkal
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers final
SARITHA REDDY
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptx
shivraj3252
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
mangala jolad
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
NimeshSingh27
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
satyamsinha37
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
Chirag Lakhani
 
project - Copy
project - Copyproject - Copy
project - Copypiedaholic
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
Amitabh Shukla
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontroller
Saylee joshi
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac final
DrVikasMahor
 
Construction of digital voltmeter by Bapi Kumar Das
Construction of digital voltmeter by Bapi Kumar DasConstruction of digital voltmeter by Bapi Kumar Das
Construction of digital voltmeter by Bapi Kumar Das
B.k. Das
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
Daman Singh
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshop
Kedarv
 
Distance Protection
Distance ProtectionDistance Protection
Distance Protection
ncct
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdf
VikasMahor3
 
Temperature Based Fan Controller
Temperature Based Fan Controller Temperature Based Fan Controller
Temperature Based Fan Controller
richa1910n
 
MPC of TWT based Transmitter
MPC of TWT based TransmitterMPC of TWT based Transmitter
MPC of TWT based TransmitterAbhishek Sutrave
 
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
International Journal of Power Electronics and Drive Systems
 
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...moiz89
 

Similar to 8051interfacing 190425062221 (20)

Adc and dac
Adc and dacAdc and dac
Adc and dac
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers final
 
adcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptxadcanddac hai kya bhayy me know if-01.pptx
adcanddac hai kya bhayy me know if-01.pptx
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
project - Copy
project - Copyproject - Copy
project - Copy
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontroller
 
analog to digital converter and dac final
analog to digital converter and dac finalanalog to digital converter and dac final
analog to digital converter and dac final
 
Construction of digital voltmeter by Bapi Kumar Das
Construction of digital voltmeter by Bapi Kumar DasConstruction of digital voltmeter by Bapi Kumar Das
Construction of digital voltmeter by Bapi Kumar Das
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshop
 
Distance Protection
Distance ProtectionDistance Protection
Distance Protection
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdf
 
Temperature Based Fan Controller
Temperature Based Fan Controller Temperature Based Fan Controller
Temperature Based Fan Controller
 
MPC of TWT based Transmitter
MPC of TWT based TransmitterMPC of TWT based Transmitter
MPC of TWT based Transmitter
 
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
A Commercial Low Cost, Highly Efficient UC3842 based High Brightness LED (HBL...
 
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
 

Recently uploaded

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

8051interfacing 190425062221

  • 1. 8051 Interfacing & Applications Subject : Processor Architecture & Interfacing Class : SEIT Prepared By Ms. K. D. Patil, AP Department of IT, Sanjivani COE, Kopargaon. Prepared By: Ms. K. D. Patil 1
  • 2. 8255 PPI Pin Diagram Prepared By: Ms. K. D. Patil 2
  • 3. 8255 Block Diagram Prepared By: Ms. K. D. Patil 3
  • 4. 8051 Interfacing LCD (Liquid Crystal Display) Prepared By: Ms. K. D. Patil 4
  • 5. Prepared By: Ms. K. D. Patil 5
  • 6. Pin Connection 8051 P0 P7 LCD VCC VEE VSS RS R/W E D0 D7 P3.3 P3.2 10K POT +5V Prepared By: Ms. K. D. Patil 6
  • 7. LCD Program • org 0000h • mov a,#38h ; INITIALIZE 2 line 5x7 • acall comm ;CALL COMMAND SUBROUTINE • acall delay ;GIVE LCD SOME TIME • mov a,#0eh ;DISPLAY ON,CURSOR ON • acall comm ;CALL COMMAND SUBROUTINE • acall delay • mov a,#01h ;clear LCD • acall comm • acall delay • mov a,#06h ;shift cursor right • acall comm • acall delay • mov a,#80h ;FORCE CURSOR TO BEGINNING OF FIRST LINE • acall comm • acall delay Prepared By: Ms. K. D. Patil 7
  • 8. LCD Program • mov a,#„S' • acall data1 ;CALL DISPLAY ROUTINE • acall delay • mov a,#'R' • acall data1 • acall delay • mov a,#„E' • acall data1 • acall delay • mov a,#'S' • acall data1 • acall delay Prepared By: Ms. K. D. Patil 8
  • 9. LCD Program • comm: ;SEND COMMAND TO LCD • mov p0,a ;COPY REG A TO PORT0 • clr p2.2 ;RS=0 FOR COMMAND • clr p2.1 ;R/W=0 FOR WRITE • setb p2.0 ;E=1 • clr p2.0 ;E=0 ret • data1: ;WRITE DATA TO LCD • mov p0,a ;COPY REG A TO PORT0 • setb p2.2 ;RS=1 FOR DATA • clr p2.1 ;R/W=0 FOR WRITE • setb p2.0 ;E=1 • clr p2.0 ;E=0 ret • delay: mov r1,#255 • here2: mov r2,#255 • here: djnz r2,here • djnz r1,here2 • Ret • end Prepared By: Ms. K. D. Patil 9
  • 10. 8051 Interfacing LED • LED (Light Emitting Diode) is a P N junction diode which emits light when activated. • It is activated when the PN junction sustains a forward voltage (forward bias), a current from P to N, called forward current. • When this current is applied, electrons recombine with electron holes within the device thereby releasing energy in form of light. • LED finds application in traffic signals, lighting, camera flashes etc. • The way to distinguish between the positive and negative terminal is, the positive is longer than the negative in length. Prepared By: Ms. K. D. Patil 10
  • 11. 8051 Interfacing LED • While LEDs are interfaced with 8051, Quartz crystals or ceramic resonator that determines the operating frequency of 8051 microcontroller is needed. • The XTAL1 and XTAL2 can be configured in two ways; • external clock drive configuration • internal clock drive configuration. • Two capacitors C1 and C2 are connected to the quartz crystal. It can be a quartz crystal or ceramic resonator. • The crystal oscillator frequency is from 1.2MHz to 12MHz. The crystal oscillator is used to generate clock pulses that provide the means for timing calculation. • Crystal pins are connected to the ground through capacitors of 33pf. Prepared By: Ms. K. D. Patil 11
  • 12. 8051 Interfacing LED • In the following Diagram, LEDs are connected to the port P0. • LEDs need approximately voltage drop of 1.7V and 10mA current to flow through them in order to glow at maximum intensity. Prepared By: Ms. K. D. Patil 12
  • 13. 8051 Interfacing LED Prepared By: Ms. K. D. Patil 13
  • 14. 8051 Interfacing 7 Segment Display • 7 segment display is a 10 pin electronic component with eight led’s embedded inside it to displays number from 0 to 9 even we can display few characters like A, B, C, H, E, e, F, etc. . • It is available in two configurations: • common cathode • common anode • In Common Anode to light up any given segment the corresponding Cathode pin should be connected to ground or reference ,which completes the circuit and LED will be in forward bias. • In Common Cathode to corresponding LED Anode pin the circuit will be completed and the particular LED will be light up since it will be in forward bias. Prepared By: Ms. K. D. Patil 14
  • 15. 8051 Interfacing 7 Segment Display • A seven segment display consists of seven LEDs arranged in the form of a “squarish eight” slightly inclined to the right and a single LED as the dot character. Different characters can be displayed by selectively glowing the required LED segments. Prepared By: Ms. K. D. Patil 15
  • 16. 8051 Interfacing 7 Segment Display Prepared By: Ms. K. D. Patil 16
  • 17. 8051 Interfacing ADC • Digital computers use binary values but in physical world everything is Analog (continuous) eg. Temperature, Pressure • A physical quantity is converted into electrical (voltage, current) signals using a device called as Transducer (also referred as Sensors). • We need Analog-to-Digital converter (ADC) to translate Analog signals to Digital number so that Microcontroller can read and process them. • ADC0808 allows us to monitor upto 8 different analog input channels using single chip Prepared By: Ms. K. D. Patil 17
  • 18. ADC0808 Prepared By: Ms. K. D. Patil 18
  • 19. Address Lines (A,B,C) Selected ADC channel C B A IN0 0 0 0 IN1 0 0 1 IN2 0 1 0 IN3 0 1 1 IN4 1 0 0 IN5 1 0 1 IN6 1 1 0 IN7 1 1 1 • ADC0808 has 8-bit data output • 8 analog input channels are multiplexed and selected using three address pins A, B & C. Prepared By: Ms. K. D. Patil 19
  • 20. Signals for A/D Conversion • Address Latch Enable (ALE): A LOW-TO-HIGH signal at this pin will latch the above-selected address and selected the respective channel for ADC conversion. • START Conversion (SC): The A/D converter‟s successive approximation register (SAR) is reset on the positive edge of the start conversion (SC) pulse. Thus we need to generate a LOW- HIGH pulse for starting the ADC conversion. • End of Conversion (EOC): Once the conversion is over, this pin is pulled HIGH by ADC0808. This pin needs to be monitored for the conversion to complete and then read the data. • Output Enable(OE): ADC0808 does the A/D conversion and holds the data in the internal registers. A HIGH signal on this pin will bring the data on the output lines. • D0-D7 are the digital Data output lines. Prepared By: Ms. K. D. Patil 20
  • 21. 8051 Interfacing ADC Prepared By: Ms. K. D. Patil 21
  • 22. 8051 Interfacing ADC Prepared By: Ms. K. D. Patil 22
  • 23. 8051 Interfacing Temperature Sensor (LM34/LM35) • Temperature is converted to electrical signals using a transducer called as Thermistor. • Simple and widely used Temperature sensors include LM34 & LM35 from Semiconductor Corp • LM34 does not require external calibration since it is internally calibrated. • LM35 are precision integrated circuit temperature sensors whose output voltage is linearly proportional to Celsius temp. It does not require external calibration since it is internally calibrated. It outputs 10mV for each degree of centigrade temperature. Prepared By: Ms. K. D. Patil 23
  • 24. Signal Conditioning • Sensors produce the output in the form of voltage, current, charge, resistance & capacitance. • But, we need to convert these signals to voltage in order to send input to ADC. • This conversion is called as Signal conditioning. • Signal conditioning can be current to voltage conversion or signal amplification. Analog World (temperature, pressure) Transducer (Sensor) Signal Conditioning ADC Microcontroller Prepared By: Ms. K. D. Patil 24
  • 25. Connecting LM35 to ADC Temp (C) Vin (mV) Vout (D7-D0) 0 0 0000 0000 1 10 0000 0001 2 20 0000 0010 3 30 0000 0011 10 100 0000 1010 30 300 0001 1110 • Since ADC has 8 bit resolution with a max of 256 steps and LM35 produces 10mV for every degree of temperature change, we can condition Vin of the ADC to produce a Vout of 2.56V for full scale output. So Vref= 2.56 Temperature Vs Vout for ADC Prepared By: Ms. K. D. Patil 25
  • 26. Interfacing Diagram Prepared By: Ms. K. D. Patil 26
  • 27. 8051 Interfacing DAC • Microcontroller are used in wide variety of applications like for measuring and control of physical quantity like temperature, pressure, speed, distance, etc. • In these systems microcontroller generates output which is in digital form but the controlling system requires analog signal as they don't accept digital data thus making it necessary to use DAC which converts digital data into equivalent analog voltage • Digital to Analog Converter is a device used to convert digital pulses to analog signals. • In the figure shown, we use 8-bit DAC 0808. This IC converts digital data into equivalent analog Current. Hence we require an I to V converter to convert this current into equivalent voltage. • DAC0808 provides 256 discrete voltage (or current) levels of output. Prepared By: Ms. K. D. Patil 27
  • 28. DAC0808 • In the MC1408 (DAC0808), the digital inputs are converted to current (Iout), and by connecting a resistor to the Iout pin, we convert the result to voltage. • The total current provided by the Iout pin is a function of the binary numbers at the D0 – D7 inputs of the DAC0808 and the reference current (Iref), and is as follows: • where D0 is the LSB, D7 is the MSB for the inputs, and Iref is the input current that must be applied to pin 14. The Iref current is generally set to 2.0 mA. Prepared By: Ms. K. D. Patil 28
  • 29. Prepared By: Ms. K. D. Patil 29
  • 30. Interfacing Diagram Prepared By: Ms. K. D. Patil 30
  • 31. 8051 Interfacing Stepper Motor  Stepper motor is a widely used device that translates electrical pulses into mechanical movement  Stepper motor is used in applications for position control such as  disk drives  dot matrix printer  robotics etc.  Stepper motors commonly have a permanent magnet rotor (shaft) surrounded by a stator Prepared By: Ms. K. D. Patil 31
  • 32. • Commonly used stepper motors have four stator windings that are paired with a center – tapped common. Such motors are called as four-phase or unipolar stepper motor. • It has a permanent magnet rotor (shaft) which is surrounded by a stator. • A practical PM stepper motor will have 1.8 degrees step angle and 50 tooth on its rotor. • There are 8 main poles on the stator, each having 5 tooth in the pole face Prepared By: Ms. K. D. Patil 32
  • 33. Prepared By: Ms. K. D. Patil 33
  • 34. Prepared By: Ms. K. D. Patil 34
  • 35. Prepared By: Ms. K. D. Patil 35
  • 36. Prepared By: Ms. K. D. Patil 36
  • 37. 4 step Sequence Step Windi ng A Windi ng B Windi ng C Windi ng D 1 1 0 0 1 2 1 1 0 0 3 0 1 1 0 4 0 0 1 1 Prepared By: Ms. K. D. Patil 37
  • 38. Step Angle • Step angle is defined as the minimum degree of rotation associated with a single step. • Total number of steps needed to rotate 360 degrees is Steps per Revolution. No of steps per revolution = 360° / step angle • Steps per second = (rpm x steps per revolution) / 60 • Example: step angle = 2° No of steps per revolution = 180 Prepared By: Ms. K. D. Patil 38
  • 39. Interfacing Diagram Prepared By: Ms. K. D. Patil 39
  • 40. 8051 Interfacing Keyboard • Keyboards are organized in a matrix of rows and columns. • The CPU processes both rows and columns through ports • So, with two 8-bit ports, an 8X8 matrix of keys can be connected to the controller. • When a key is pressed, a row and a column make a contact. Otherwise there is no connection • In microcontroller, programs stored in EPROM scan the keys continuously. • In the following figure, 4 X 4 matrix connected to two ports. rows are connected to output ports and columns are connected to an input port. Prepared By: Ms. K. D. Patil 40
  • 41. Matrix Keyboard connection to Ports Prepared By: Ms. K. D. Patil 41
  • 42. Scanning & Identifying Key • It is a function of microcontroller to scan the keyboard continuously to detect and identify key pressed • To detect Pressed key microcontroller grounds all rows by providing 0 to output latch, then it reads the columns • If the data read from columns is D3-D0 = 1111 , no key is pressed and the process continues till key press is detected. • If one of the column bits has a zero, means key press has occurred. • If D3-D0 = 1101 this means that key in the column D1 has been pressed. • After detecting a key press, microcontroller will go through the process of identifying key. Prepared By: Ms. K. D. Patil 42
  • 43. Scanning & Identifying Key • Starting with the top Row, the microcontroller grounds it by providing a low to Row D0 only • If reads a column if data read is all 1s, no key in that row is activated and the process is moved to the next row. • It grounds the next row, reads the columns, and checks for any zero • This process continues until row is identified • After identification of the Row in which Key has been pressed, find out column the key press belongs to Prepared By: Ms. K. D. Patil 43
  • 44. References: • M. A. Mazidi, J. C. Mazidi, R. D. McKinlay, “The 8051 Microcontroller & Embedded Systems using Assembly and C”, 2nd Edition, Pearson publication Prepared By: Ms. K. D. Patil 44