Académique Documents
Professionnel Documents
Culture Documents
SYLLABUS
Interfacing of A to D Converter with 8085 Microprocessor 1) Using Handshaking 2) Using interrupts Interfacing of D to A Converter with 8085 Microprocessor and pgm for different waveform generation using 8255. Practical Applications using 8085 Microprocessor. - For Stepper Motor Control operation - For Temperature Control operation.
Interfacing Of A to D
22
LEARNING OBJECTIVE
The objective of chapter is to interface the 8085 microprocessor interfaced and programmable peripheral interface IC 8255 with DAC, ADC, Stepper motor and temperature controller with the help of latches and decoder.
Interfacing Of A to D
33
44
Interfacing Diagram
Interfacing Of A to D
55
PORT C
22H
0010 00 10
CWR
23H
0010 00 11
Interfacing Of A to D
66
When of DAC with microprocessor applied Interfacing 8 bit digital number is 8085 Cont. at the input of DAC. Then DAC will convert this digital binary no. into proportional analog current IA. Using current to voltage converter. Analog current IA is converted into proportional analog voltage VA.
Interfacing Of A to D
77
If digital input=00H then lVAl =0V. If digital number applied at the input of DAC increased then lVAl also increased. Finally when digital=FFH, then lVAl= maximum. So, for obtaining sawtooth waveform of figure 2 we have to transfer 8 bit digital number from 00H to FFH in increasing order. Bit control word to define port B as 88 Interfacing Of A to D output in mode 0=10000000
PA IS USED AS O/P. DIGITAL O/P OF MICROPROCESSOR IS GIVEN TO DAC THROUGH PA. b) O/P OF DAC IS AVAILABLE IN THE FORM OF CURRENT IT IS CONVERTED INTO VOLTAGE BY USING Op-Amp IN I-V MODE.
a)
OUT CWR MVI A,00H OUT PA CALL DELAY MVI A,FFH OUT PA CALL DELAY JMP START DELAY: 2040 LXI D,FFFFH REPEAT: DCX D MOV A,E ORA E JNZ REPEAT RET
= 80H
= 80H
Interface ADC or 8 bit ADC or ADC 0808 /0809 with SOLN: microprocessor 8085.
Hardware:ADC is a input device so for connecting this input device with microprcessor,we have to use input port. For port IC 8255 PPI can be used.
Interfacing Of A to D
1515
Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont. Interfacing Diagram
Interfacing Of A to D
1616
Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont.
Interfacing Of A to D
1717
Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont. Description:
1)
8 different analog voltages V0-V7 are applied to the 8 channels of ADC . Vref + = + 5v and Vref - = - 5v 3Mhz up clock signal is converted into 1 Mhz using divide by 3 counter and it is applied to the clock input of ADC
2) For selecting 1 corresponding channel 3 bit address is transferred on ADDA,ADDB,ADDC pins and ALE is made 1. so the corresponding voltage of selected channel is applied to the ADC input through inbuilt MUX.
Interfacing Of A to D 1818
Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 1 pulse 3)LogicCont. is applied on SOC pin.
So ADC starts the conversion and it gives EOC = 0 4) EOC = 1 then OE = 1. So 8 bit digital output is obtain on D7-D0 pins. This is 8 bit digital output is read through input port and it is stored in one memory location.
Interfacing Of A to D 1919
Prob.01 :-Interfacing
with ADC 0808/0809 with 8255 IC with 8085 IC. Points:
1) ADC IC 0808/0809 is used. 2) 8255 is used as interfacing IC. 3) PA & PC upper =I/P mode & PCLower =O/P mode. 4) EOC pin of ADC is Connected to PC7 bit. 5) ALE & SOC both are connected to PC3 Bit.
6)
START INITIALIZE PA & PC UPPER AS I/P & PCLOWER AS O/P SELECT 3 BY SENDING CBA=011 MAKE ALE & SOC HIGH KEEPING CBA=011 MAKING ALE &SOC LOW KEEPING CBA=011
PROGRAM
MVI A,98H: OUT CWR MVI A,03H: OUT PC MVI A,0BH OUT PC MVI A,03H OUT PC IN PC RAL JNC BACK IN PA STA 20FFH HLT
To Configure for PA & PCU as i/p & PCL as o/p
select Channel 03
Make ALE & SOC High Maintaining CH3 Make ALE & SOC High Maintaining CH3 Read PC for EOC check EOC =1
1 0 0 1 1 0 0 0
= 98H (CWR)
MVI A,90H OUT CWR MVI A,03H OUT PC MVI A,0BH OUT PC MVI A,0BH SIM EA HERE/JMP HERE 003C: IN PA STA 2200H RET
Interfacing Of A to D
2323
Interfacing Diagram
Interfacing Of A to D
2424
Interfacing Of A to D
2525
MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont. Operation:1) Initially the temp. of heater is within the max. limit then to make heater on , logic 0 is applied on plotting 8255 so switching transistor T1 is on Vb~5V so power transistor (T2) is on hence current flows through coil of relay to the electromagnetic flux a is magnetized which attracts iron piece t so contacts ab are closed and heater becomes on. 2) Transducer:- Using temperature transducer like thermocouple or thermister temperature input at heater is converted into proportional electrical signal.
Interfacing Of A to D
2626
3) Signal conditioner and amplifier: Using I to V converter or amplifier or voltage follower the electrical signal is converted into the input voltage range of ADC (0to5V). 4) ADC: If logic 1 pulse is applied on SOC pin then conversion starts, during conversion EOC becomes 0. When conversion is over then EOC=1. Hence OE=1 and 8-bit digital output is 2727 Interfacing Of A pins. obtained on D7------D0 to D
MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont. 5)Using software this digital out put is read by microcontroller and from this digital no. microprocessor coil get the information about the temp. of room. When the temp. of the room increases above max limit then for making relay of logic 1. is transferred on PC 0 pins of 8255. 6)When PC0 is 1 then T1 is off so VB IS DISCONNECTED to 5v. Hence p1 is off and i=0 relay is demagnetised. So contacts ab are open and heater becomes off.
Interfacing Of A to D 2828
PROGRAM:
L1: MVI A, 98H OUT CWR MVI A,03H OUT PC MVI A,0BH OUT PC IN PC RAL JNC L1 IN PA CPI 80H JC L3 MVI A,80H OUT PB JMP L1 MVI A,00H OUT PB JMP L1
1 0 0 1 1 0 0 0
= 98H(CWR)
L2:
L3:
Interfacing Diagram
Interfacing Of A to D
3131
Interfacing Of A to D
3232
Description 1)There are 4 units of driver circuit T1 and T2 connected to port c pin of stepper motor. 2)If pc 3 =1 then T1 is off there is no voltage so T2 is off. There is no flux of winding A1. 3)If PC3 =0 T1 is on so Vb ~ 5V hence T2 is on so point 1 is connected to ground and I1 will produce flux.
Interfacing Of A to D
3333
Interface stepper motor with microprocessor 4)Direction Control:-The resultant flux of winding 8085 Cont. rotates in clockwise or anticlockwise direction then
rotor also rotates in clockwise and anticlockwise direction. 5)Speed Control: The time delay between two steps is less than speed of stepper motor. The angle by which stepper motor rotates in 1 step called an step angle.Stepper having 1.8 step angle is available.
Interfacing Of A to D
3434
5-A) TO ROTATE FULL STEP OR 4 SEQUENCE STEPPER MOTOR IN CLOCKWISE DIRECTION CONTINUOUSLY LXI SP,20FFH MVI A,80H OUT CWR BEGIN : MVI C,04H LXI H,2050H L1: MOV M,A OUT PA INX H DCR C JNZ L1 JMP BEGIN
1 0 0 0 0 0 0 0
= 80H CWR
5-B) TO ROTATE FULL STEP OR 4 SEQUENCE STEPPER MOTOR IN ANTI CLOCKWISE DIRECTION CONTINUOUSLY LXI SP,20FFH MVI A,80H OUT CWR BEGIN : MVI C,04H 1 0 0 0 0 0 0 0 = 80H CWR LXI H,2053H L1: MOV M,A OUT PA CALL DELAY DCX H DCR C JNZ L1 JMP BEGIN
5-C) TO ROTATE HALF STEP OR 8 SEQUENCE STEPPER MOTOR IN CLOCKWISE DIRECTION CONTINUOUSLY MVI A,80H OUT CWR BEGIN : MVI C,08H LXI H,2050H L1: MOV A,M OUT PA CALL DELAY INX H DCR C JNZ L1 JMP BEGIN
1 0 0 0 0 0 0 0
= 80H CWR
5-D) TO ROTATE HALF STEP OR 8 SEQUENCE STEPPER MOTOR IN ANTI CLOCKWISE DIRECTION CONTINUOUSLY MVI A,80H OUT CWR BEGIN : MVI C,04H LXI H,2057H L1: MOV M,A OUT PA CALL DELAY DCX H DCR C JNZ L1 JMP BEGIN
1 0 0 0 0 0 0 0
= 80H CWR
5-E) WRITE A PROGRAM TO ROTATE STEPPER MOTOR BY 1800 IN CLOCKWISE DIRECTION.[ FULL STEP MOTOR ]
MVI A,80H ANGLE OF ROTATION FOR OUT CWR 1STEP=1.80 MVI B,19H NO. OF ROTATION FOR L2: LXI H,2050H 180=180/1.8=(100)d MVI C,04H FOR FOUR SEQUENCE = L1: MOV A,M 100/4=(25)d OUT PA =(19)H NO. OF CALL DELAY ROTATION INX H DCR C JNZ L1 1 0 0 0 0 0 0 0 DCR B JNZ L2 = 80H CWR HLT
5-F) WRITE A PROGRAM TO ROTATE STEPPER MOTOR 8 STEPS SEQUENCE OR HALF ANGLE STEPPER MOTOR IN CLOCKWISE DIRECTION BY 1800 MVI A,80H
OUT CWR ANGLE OF ROTATION FOR MVI B,19H 1STEP=0.90 L2: LXI H,2050H NO. OF ROTATION FOR MVI C,08H 180=180/0.9=(200)d FOR FOUR SEQUENCE = L1: MOV A,M 200/8=(25)d OUT PA =(19)H CALL DELAY NO. OF INX H ROTATION DCR C JNZ L1 1 0 0 0 0 0 0 0 DCR B JNZ L2 = 80H CWR HLT
SUMMERY
In this chapter we studied the interface of 8085 microprocessor and IC 8255 with ADC, DAC, Stepper motor, Temperature control and studied the various ADC and DAC ICs, Decoder, Latches.
Interfacing Of A to D
4141
REFERENCES
1)
2)
3)
4)
Microcontroller: Theory and application by Deshmukh Programming and Customizing 8051 microcontroller By Predko. 8051 Microcontroller hardware,Software & Application by V.Udayashankar & M.S.Mallikarjunaswamy. 8051 Microcontroller by Mohammad Mazidi
Interfacing Of A to D
4242