Interfacing microprocessor 8085

Views:
 
Category: Education
     
 

Presentation Description

Interfacing of DAC with microprocessor 8085

Comments

Presentation Transcript

MICROCONTROLLER:

MICROCONTROLLER Interfacing Of A to D Converter With 8085 Microprocessor 1 DEPARTMENT OF ELECTRONICS & COMMUNICATION $UNIL NARE$H KA$HYAP Interfacing Of A to D Converter With 8085 Microprocessor

Slide 2:

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. 2 Interfacing Of A to D Converter With 8085 Microprocessor

Slide 3:

LEARNING OBJECTIVE 3 Interfacing Of A to D Converter With 8085 Microprocessor 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 DAC with microprocessor 8085:

Interfacing of DAC with microprocessor 8085 Que :-Interface or connect 8bit DAC with microprocessor 8085 and write a program to generate saw tooth waveform at the output. Soln:- Hardware : DAC is output device so for connecting DAC with microprocessor. We need output port. For output port, IC 8255 PPI can be used. 4 Interfacing Of A to D Converter With 8085 Microprocessor

Slide 5:

Interfacing Diagram 5 Interfacing Of A to D Converter With 8085 Microprocessor Interfacing of DAC with microprocessor 8085 Cont.

ADDRESS DECODING TABLE:- :

ADDRESS DECODING TABLE:- FOR IC 8255:- PORT HEXA ADD BINARY ADD PORT A 20H 0010 00 00 PORT B 21H 0010 00 01 PORT C 22H 0010 00 10 CWR 23H 0010 00 11 6 Interfacing Of A to D Converter With 8085 Microprocessor Interfacing of DAC with microprocessor 8085 Cont.

When 8 bit digital number is applied 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. :

When 8 bit digital number is applied 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. 7 Interfacing Of A to D Converter With 8085 Microprocessor Interfacing of DAC with microprocessor 8085 Cont.

Slide 8:

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 output in mode 0=10000000 =80H 8 Interfacing Of A to D Converter With 8085 Microprocessor Interfacing of DAC with microprocessor 8085 Cont.

Write a program to generate square wave.:

Write a program to generate square wave. MVI A,80H OUT 23H MVI A,00H L1: OUT 21H INR A JMP L1 9 Interfacing Of A to D Converter With 8085 Microprocessor Interfacing of DAC with microprocessor 8085 Cont.

Prob.03) INTERFACE DAC WITH 8085 USING 8255:

Prob.03) INTERFACE DAC WITH 8085 USING 8255 MVI A,80H 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 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.

3-A) GENERATION OF SQUARE WAVEFORM:

3-A) GENERATION OF SQUARE WAVEFORM MVI A,80H OUT CWR START : 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 1 0 0 0 0 0 0 0 = 80H

3-B) GENERATION OF RAMP WAVEFORM:

3-B) GENERATION OF RAMP WAVEFORM MVI A,80H OUT CWR L2: MVI A,00H L1: OUT PA INR A CPI FFH JNZ L1 JMP L2 1 0 0 0 0 0 0 0 = 80H

3-C) GENERATION OF TRIANGULAR WAVEFORM:

3-C) GENERATION OF TRIANGULAR WAVEFORM BEGIN: MVI A,00H L1: INR A OUT PA CPI FFH JNZ L1 L2: DCR A OUT PA JNZ L2 JMP L1

3-D) GENERATION OF SINE WAVEFORM:

3-D) GENERATION OF SINE WAVEFORM MVI A,80H OUT CWR L2: LXI H,2050H MVI C,00H L1: MOV A,M OUT PA INX H DCR C JNZ L1 JMP L2

Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085.:

Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085. SOLN: 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. 15 Interfacing Of A to D Converter With 8085 Microprocessor

Slide 16:

Interfacing Diagram 16 Interfacing Of A to D Converter With 8085 Microprocessor Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont.

ADDRESS DECODING TABLE FOR 8255:- :

ADDRESS DECODING TABLE FOR 8255:- PORT HEX ADDR BINARY ADDR PORT A 00H 000000 00 PORT B 01H 000000 01 PORT C 02H 000000 10 CWR 03H 000000 11 17 Interfacing Of A to D Converter With 8085 Microprocessor Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont.

Description::

Description : 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. 18 Interfacing Of A to D Converter With 8085 Microprocessor Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont.

3)Logic 1 pulse 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.:

3)Logic 1 pulse 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 . 19 Interfacing Of A to D Converter With 8085 Microprocessor Interface ADC or 8 bit ADC or ADC 0808 /0809 with microprocessor 8085 Cont.

Slide 20:

START INITIALIZE PA & PC UPPER AS I/P & PC LOWER AS O/P SELECT 3 BY SENDING ‘CBA’=011 MAKE ALE & SOC HIGH KEEPING ‘CBA’=011 READ SOC MAKING ALE &SOC LOW KEEPING ‘CBA’=011 ROTATE “A” IN LEFT READ PA STORE ‘A” TO 20FFH EOC=1 STOP Prob.01 :- Interfacing w ith ADC 0808/0809 with 8255 IC with 8085 IC. Points: 1) ADC IC 0808/0809 is used. 2) 8255 is used as interfacing IC. PA & PC upper =I/P mode & PC Lower =O/P mode. EOC pin of ADC is Connected to PC 7 bit. 5) ALE & SOC both are connected to PC3 Bit. PC 0 to PC 2 used for channel selection.

Slide 21:

PROGRAM MVI A,98H: OUT CWR MVI A,03H: OUT P C MVI A,0BH OUT P C MVI A,03H OUT P C IN P C RAL JNC BACK IN PA STA 20FFH HLT select Channel 03 Make ALE & SOC High Maintaining CH3 To Configure for PA & PC U as i /p & PC L as o/p Make ALE & SOC High Maintaining CH3 check EOC =1 Read PC for EOC 1 0 0 1 1 0 0 0 = 98H (CWR)

Slide 22:

Prob.02) Interface ADC with 8085 using 8255 in Interrupts. 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 IC 0808/0809 CONSIST OF 8CHANNELS FOR GIVING ANALOG INPUTS.HERE ANALOG I/P IS GIVEN TO CH-3 DIGITAL O/P OF ADC IS GIVEN TO PA. ALE & SOC SIGNAL ARE GIVEN TO PC3 OF 8255. PC 0 -PC 2 ARE CONNECTED TO THE CHANNEL SELECT LINES “CBA” OF ADC. EOC OF ADC IS CONNECTED TO INTERRUPT IN RST7.5 OF 8085. ECLOCK OUT OF 8085 IS GIVEN TO CLOCK I/P OF ADC THROUGH COUNTER 7490 SO THAT CLK PULSES IN THE RANGE OF 200 TO 200KHz ARE GENERATES. g) PA IS USED AS I/P & PC LOWER IS USED AS OUTPUT.

MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER :

MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER In multi loop or closed loop temp. controller using micro processor we have to convert ADC, relays etc. with microprocessor. For connecting this devices we need IO ports and for ports IC 8255 PPI is used. 23 Interfacing Of A to D Converter With 8085 Microprocessor

Slide 24:

Interfacing Diagram 24 Interfacing Of A to D Converter With 8085 Microprocessor MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont.

ADDRESS DECODING TABLE FOR 8255 PPI :

ADDRESS DECODING TABLE FOR 8255 PPI PORT HEXA ADD BINARY ADDR PORT A 7C 011111 00 PORT B 7D 011111 01 PORT C 7E 011111 10 CWR 7F 011111 11 25 Interfacing Of A to D Converter With 8085 Microprocessor 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.:

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. 26 Interfacing Of A to D Converter With 8085 Microprocessor MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont.

Slide 27:

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 obtained on D 7 ------D 0 pins. 27 Interfacing Of A to D Converter With 8085 Microprocessor MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont.

Slide 28:

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. 28 Interfacing Of A to D Converter With 8085 Microprocessor MULTI LOOP OR CLOSED LOOP TEMP. CONTROLLER Cont.

Slide 29:

PROGRAM: MVI A, 98H OUT CWR L1: MVI A,03H OUT PC MVI A,0BH OUT PC L2: IN PC RAL JNC L1 IN PA CPI 80H JC L3 MVI A,80H OUT PB JMP L1 L3: MVI A,00H OUT PB JMP L1 1 0 0 1 1 0 0 0 = 98H(CWR)

Interface stepper motor with microprocessor 8085. :

Interface stepper motor with microprocessor 8085. Soln :- In practical stepper motor coil A & b are centre tapped to + 12V and between other end of each winding power transistor is connected. The base of power transistor is controlled by switching transistor and the base of switching transistor is controlled by microprocessor to the output port pin. 30 Interfacing Of A to D Converter With 8085 Microprocessor

Slide 31:

Interfacing Diagram 31 Interfacing Of A to D Converter With 8085 Microprocessor Interface stepper motor with microprocessor 8085 Cont.

ADDRESS DECODING TABLE FOR IC 8255 PPI:

ADDRESS DECODING TABLE FOR IC 8255 PPI PORT HEXA ADD BINARY ADD PORT A 20H 001000 00 PORT B 21H 001000 01 PORT C 22H 001000 10 CWR 23H 001000 11 32 Interfacing Of A to D Converter With 8085 Microprocessor Interface stepper motor with microprocessor 8085 Cont.

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. :

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. 33 Interfacing Of A to D Converter With 8085 Microprocessor Interface stepper motor with microprocessor 8085 Cont.

4)Direction Control:-The resultant flux of winding 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.:

4)Direction Control :-The resultant flux of winding 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. 34 Interfacing Of A to D Converter With 8085 Microprocessor Interface stepper motor with microprocessor 8085 Cont.

Slide 35:

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

Slide 36:

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 LXI H,2053H 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

Slide 37:

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

Slide 38:

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 = 80H CWR 1 0 0 0 0 0 0 0

Slide 39:

MVI A,80H OUT CWR MVI B,19H L2: LXI H,2050H MVI C,04H L1: MOV A,M OUT PA CALL DELAY INX H DCR C JNZ L1 DCR B JNZ L2 HLT 5-E) WRITE A PROGRAM TO ROTATE STEPPER MOTOR BY 180 0 IN CLOCKWISE DIRECTION.[ FULL STEP MOTOR ] ANGLE OF ROTATION FOR 1STEP=1.8 0 NO. OF ROTATION FOR 180=180/1.8=(100) d FOR FOUR SEQUENCE = 100/4=(25) d =(19) H NO. OF ROTATION 1 0 0 0 0 0 0 0 = 80H CWR

Slide 40:

MVI A,80H OUT CWR MVI B,19H L2: LXI H,2050H MVI C,08H L1: MOV A,M OUT PA CALL DELAY INX H DCR C JNZ L1 DCR B JNZ L2 HLT 5-F) WRITE A PROGRAM TO ROTATE STEPPER MOTOR 8 STEPS SEQUENCE OR HALF ANGLE STEPPER MOTOR IN CLOCKWISE DIRECTION BY 180 0 ANGLE OF ROTATION FOR 1STEP=0.9 0 NO. OF ROTATION FOR 180=180/0.9=(200) d FOR FOUR SEQUENCE = 200/8=(25) d =(19) H NO. OF ROTATION 1 0 0 0 0 0 0 0 = 80H CWR

SUMMERY:

SUMMERY 41 Interfacing Of A to D Converter With 8085 Microprocessor 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 IC’s, Decoder, Latches.

REFERENCES:

REFERENCES 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 42 Interfacing Of A to D Converter With 8085 Microprocessor

authorStream Live Help