SlideShare a Scribd company logo
1 of 44
Download to read offline
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

Signals & Systems PPT
Signals & Systems PPTSignals & Systems PPT
Signals & Systems PPTJay Baria
 
Common Emitter Configuration | Electronical Engineering
Common Emitter Configuration | Electronical EngineeringCommon Emitter Configuration | Electronical Engineering
Common Emitter Configuration | Electronical EngineeringTransweb Global Inc
 
Digital switching system ppt
Digital switching system pptDigital switching system ppt
Digital switching system pptGopalakrishnaM4
 
Lec1 - Analog and Digital systems
Lec1 - Analog and Digital systemsLec1 - Analog and Digital systems
Lec1 - Analog and Digital systemsMuhammad Salman
 
Analog and Digital VLSI Design Notes - Akshansh
Analog and Digital VLSI Design Notes - AkshanshAnalog and Digital VLSI Design Notes - Akshansh
Analog and Digital VLSI Design Notes - AkshanshAkshansh Chaudhary
 
Trends in Embedded system Design
Trends in Embedded system DesignTrends in Embedded system Design
Trends in Embedded system DesignRaman Deep
 
Difference between bjt and fet
Difference between bjt and fetDifference between bjt and fet
Difference between bjt and fetBangulkhanbaloch
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontrollerVandna Sambyal
 
Introduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfIntroduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfEngineering Funda
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfSrikrishna Thota
 
Analog Electronics Notes - Akshansh
Analog Electronics Notes - AkshanshAnalog Electronics Notes - Akshansh
Analog Electronics Notes - AkshanshAkshansh Chaudhary
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontrollerDiwaker Pant
 
Small signal analysis of bjt amplifiers
Small signal analysis of bjt amplifiersSmall signal analysis of bjt amplifiers
Small signal analysis of bjt amplifiersPRAVEENA N G
 

What's hot (20)

Signals & Systems PPT
Signals & Systems PPTSignals & Systems PPT
Signals & Systems PPT
 
OMAP
OMAPOMAP
OMAP
 
Common Emitter Configuration | Electronical Engineering
Common Emitter Configuration | Electronical EngineeringCommon Emitter Configuration | Electronical Engineering
Common Emitter Configuration | Electronical Engineering
 
Digital switching system ppt
Digital switching system pptDigital switching system ppt
Digital switching system ppt
 
Lec1 - Analog and Digital systems
Lec1 - Analog and Digital systemsLec1 - Analog and Digital systems
Lec1 - Analog and Digital systems
 
Analog and Digital VLSI Design Notes - Akshansh
Analog and Digital VLSI Design Notes - AkshanshAnalog and Digital VLSI Design Notes - Akshansh
Analog and Digital VLSI Design Notes - Akshansh
 
Verilog
VerilogVerilog
Verilog
 
Trends in Embedded system Design
Trends in Embedded system DesignTrends in Embedded system Design
Trends in Embedded system Design
 
Difference between bjt and fet
Difference between bjt and fetDifference between bjt and fet
Difference between bjt and fet
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontroller
 
Cpld fpga
Cpld fpgaCpld fpga
Cpld fpga
 
Timers and counters of microcontroller 8051
Timers and counters of microcontroller 8051Timers and counters of microcontroller 8051
Timers and counters of microcontroller 8051
 
Introduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfIntroduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdf
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdf
 
PLDs
PLDsPLDs
PLDs
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
 
Analog Electronics Notes - Akshansh
Analog Electronics Notes - AkshanshAnalog Electronics Notes - Akshansh
Analog Electronics Notes - Akshansh
 
Led display
Led displayLed display
Led display
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontroller
 
Small signal analysis of bjt amplifiers
Small signal analysis of bjt amplifiersSmall signal analysis of bjt amplifiers
Small signal analysis of bjt amplifiers
 

Similar to 8051interfacing 190425062221

Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers finalSARITHA 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.pptxshivraj3252
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjmangala 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).pdfsatyamsinha37
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERChirag Lakhani
 
project - Copy
project - Copyproject - Copy
project - Copypiedaholic
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAmitabh Shukla
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerSaylee 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 finalDrVikasMahor
 
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 DasB.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 workshopKedarv
 
Distance Protection
Distance ProtectionDistance Protection
Distance Protectionncct
 
ADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfADC and DAC interfacing.pdf
ADC and DAC interfacing.pdfVikasMahor3
 
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
 
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

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 

Recently uploaded (20)

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 

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