Download presentation
Presentation is loading. Please wait.
1
Parallel Port Interfacing
Unit 3 Parallel Port Interfacing
2
Interfacing of 8051 with DAC 0808
3
Interfacing
4
Program To Generate Triangular Wave
ORG 0000H MOV A, #00H RISE: MOV P1, A INC A CJNE A, #0FFH, RISE FALL: MOV P1, A DEC A CJNE A, #00H, FALL SJMP RISE END
5
Sine Wave Generation Angle in Degrees (Ɵ) Sin(Ɵ) Count= 2.5+(2.5×sinƟ)
2.5 128 30 0.500 3.75 192 60 0.866 4.66 239 90 0.999 4.99 256 120 0.865 150 0.499 3.74 180 0.001 2.49 210 0.501 1.24 64 240 0.33 17 270 0.002 300 -0.864 0.337 330 0.497 1.255 360 0.0025 2.506
6
Program To Generate Sine wave
ORG 0000H MOV R0, #30H ;Starting Address ; Store the Calculated Values on address from H #128 INC R0 #192 #239 #256
7
MOV @R0, #239 INC R0 MOV @R0, #192 MOV @R0, #128 MOV @R0, #64
8
MOV R0, #30H HERE: MOV P1,@R0 INC RO CJNE R0, #3CH, HERE MOV R0,#30H SJMP HERE END
10
Interfacing of Stepper Motor with 8051
11
Stepper Motor Structure
12
Full-Step Stepper Motor
Coil1 Coil2 Coil3 Coil4 1 I 0CH 2 06H 3 03H 4 09H
13
Half-Step Stepper Motor
14
Half-Step Stepper Motor
Coil1 Coil2 Coil3 Coil4 Hex 1 I 08H 2 0CH 3 04H 4 06H 5 02H 6 03H 7 01H 8 09H
15
Interfacing
16
ULN 2003 Driver IC
18
Write a Program to rotate a motor 117o in clockwise direction
Write a Program to rotate a motor 117o in clockwise direction. The motor has step angle of 1.80 1 step = 1.80 Steps= 1170 X= 𝟏𝟏𝟕 𝟏.𝟖 =65 65 steps are to be given to stepper motor.
19
ORG 0000H MOV R0, #30H ;Starting Address ; Store the Calculated Values on address from 30H #0CH INC R0 #06H #03H #09H
20
MOV R0, #30H MOV R1,#65 HERE: MOV INC RO DJNZ R1, NXT SJMP LAST NXT: CJNE R0, #33H, HERE MOV R0,#30H SJMP HERE LAST: END
21
Interfacing of Motion Detectors with 8051
Motion Detector Sensors: Passive Infrared (PIR) MircoWave (MW) Area Reflective Type(IR) Ultrasonic Vibration
22
Passive InfraRed Sensor(PIR)
23
Working Principle
26
InfraRed Sensor
28
Ultrasonic Sensor
29
Working Principle
30
Interfacing of PIR sensor with 8051
31
PIR EQU P2.4 LED EQU P2.3 ORG 0000H L1: JNB PIR, L1 SETB LED L2: JB PIR, L2 CLR LED SJMP L1 END
32
Interfacing of LM35 with 8051
33
Interfacing of LCD and LM35 with 8051 via ADC 0808
34
SEL_A EQU P3. 1 _ SEL_B EQU P3. 2 \ SEL_C EQU P3. 3 | ALE EQU P3
SEL_A EQU P3.1 _ SEL_B EQU P3.2 \ SEL_C EQU P3.3 | ALE EQU P3.4 > ADC START EQU P3.5 | EOC EQU P3.6 | OE EQU P3.7 / ADC_DATA EQU P1 _ RS EQU P2.0 | RW EQU P2.1 > LCD EN EQU P2.2 _|
35
ORG 0000H MOV A, #02H ACALL CMD MOV A, #38H MOV A,#0EH
36
MOV ADC_DATA, #0FFH ;DATA PORT TO INPUT SETB EOC ;EOC AS INPUT CLR ALE CLR OE CLR START ;REST OF OUTPUT SIGNALS MAIN: MOV A,#80H ACALL CMD SETB SEL_A CLR SEL_B CLR SEL_C ;SELECT ANALOG CHANNEL 1 SETB ALE ;LATCH CHANNEL SELECT SETB START ;START CONVERSION
37
CLR ALE CLR START HERE: JB EOC, HERE ;WAIT FOR END OF CONVERSION HERE1:JNB EOC, HERE1 SETB OE ;ASSERT READ SIGNAL MOV A, ADC_DATA ; READ DATA ;ADC DATA IS NOW IN ACCUMULATOR CLR OE ;START OVER FOR NEXT CONVERSION
38
MOV B,#256 DIV A,B MOV B,#50 MUL AB MOV B,#10
39
MOV R1,A ANL A,#11110000 SWAP A MOV B,#30H ADD A,B ACALL DISP MOV A,R1 ANL A,#00001111
40
MOV A,#83H ACALL CMD MOV A,#"C" ACALL DISP SJMP MAIN
41
CMD: ACALL INIT MOV P0,A CLR RS CLR RW SETB EN CALL DELAY CLR EN RET
DISP: ACALL INIT MOV P0,A SETB RS CLR RW SETB EN ACALL DELAY CLR EN RET
42
;POLLING FUNCTION INIT: CLR EN CLR RS MOV P1, #0FFH SETB RW L1: SETB EN JB P1.7, L1
DELAY: MOV R3, #10 L1: MOV R4, #250 L2: DJNZ R4, L2 DJNZ R3, L1 RET END
43
Frequency Counter using 8051
44
Frequency Counter using 8051
45
Data Acquisition System
46
Sensors Sensor Phenomenon Thermocouple, RTD, Thermistor Temperature
Photo Sensor Light Microphone Sound Strain Gage, Piezoelectric Transducer Force and Pressure Potentiometer, LVDT, Optical Encoder Position and Displacement Accelerometer Acceleration pH Electrode pH
47
Signal Conditioning Amplification Excitation Linearization
Cold-Junction Compensation Filtering Isolation High Impedance RMS Signal Conditioning
48
Example of DAS
49
Optocoupler
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.