Download presentation
Presentation is loading. Please wait.
Published byPradeep Chauhan Modified over 5 years ago
1
Review 8255: 8255 PPI Various Modes Of Operation Interfacing To 8086.
Interfacing Techniques: D/A And A/D Converter Interfacing. Stepper Motor
2
8255Programmable Peripheral Interface(PPI)
For most of the applications 8086 needs parallel input ,output data to/from the peripherals. 8255 is a device used to interface different real time peripherals to the microprocessors which can be initialized for different modes operations like simple I/O, Strobed I/O and handshaking I/O. It has three 8-bit parallel ports :port A, port B, port C
3
Fig pin diagram
4
8255 has three operation modes: mode 0, mode 1, and mode 2
Fig 4.3 Control Word Register Bit Format of 8255 for I/O mode and BSR mode
5
Fig 4.4 Input and Output control signals of 8255 in mode1
Programming 8255 Mode 0: Ports A, B, and C can be individually programmed as input or output ports Port C is divided into two 4-bit ports which are independent from each other Mode 1: Ports A and B are programmed as input or output ports Port C is used for handshaking PA[7:0] STBA IBFA INTRA PC3 PC5 PC4 PB[7:0] STBB IBFB INTRB PC0 PC1 PC2 PC6, 7 8255 OBFA ACKA PC6 PC7 OBFB ACKB PC4, 5 Fig 4.4 Input and Output control signals of 8255 in mode1
7
Fig 4.5 Input and Output control signals of 8255 in mode1
8
Fig 4.6 Input and Output control signals of 8255 in mode2
Programming 8255 Mode 2: Port A is programmed to be bi-directional Port C is for handshaking Port B can be either input or output in mode 0 or mode 1 PA[7:0] OBFA ACKA INTRA PC4 PC6 PC7 STBA IBFA PC0 PC3 PC5 8255 PB[7:0] In Out Mode 0 STBB OBFB IBFB ACKB INTRB INTRB Mode 1 Fig 4.6 Input and Output control signals of 8255 in mode2
9
Fig 4.7 Input and Output control signals of 8255 in mode2
10
Fig 4.8 Interfacing of 8255 to Keyboard for input in mode1
Example: Mode 1 Input BIT5 EQU 20H PORTC EQU 22H PORTA EQU 20H READ PROC NEAR Read: IN AL, PORTC ; read portc TEST AL, BIT5 ;test IBF JZ Read ;if IBF=0 IN AL, PORTA ;Read Data READ ENDP keyboard 8255 PA0 PA7 STB PC4 DAV Fig 4.8 Interfacing of 8255 to Keyboard for input in mode1
11
Fig 4.9 Interfacing of 8255 to Printer for output in mode1
Example: Mode 1 output Printer 8255 PB0 PB7 ACK PC2 ACK PC4 DS Fig 4.9 Interfacing of 8255 to Printer for output in mode1
12
ADC/DAC Interfacing 8086 MP DAC – IC 0800 ADC – IC 0808
14
ADC Interfacing The time taken by the ADC from the active edge of SOC pulse till the active edge of EOC signal is called as the conversion delay of the ADC. General algorithm for ADC interfacing contains the following steps Ensure the stability of analog input, applied to the ADC Issue start of conversion SOC pulse to ADC Read end of conversion EOC signal to mark the end of conversion process Read digital data output of the ADC as equivalent digital output.
15
ADC 0808/0809 The analog to digital converter chips 0808 and are 8-bit CMOS, successive approximation converters. It is fastest technique. The conversion delay is 100 µs at a clock frequency of 640 kHz, which is quite low as compared to other converters. Block Diagram of ADC 0808/0809 This converter internally has a 3:8 analog multiplexer, so that at a time 8 different analog inputs can be connected to the chips. Out of these 8 inputs only one can be selected for conversion by using 3 address lines A,B,C.
16
Fig 4.15 Pin diagram of ADC 0808/0809
17
Block Diagram of ADC 0808 / 0809 Successive Approximation
Analog Comparator DAC
18
Pin Diagram of ADC 0808 / 0809 Add A, B, C Digital Data
19
Pin Diagram of ADC 0808 / 0809
20
Pin No Signal Name Description 11 Vcc Supply pins +5V 13 GND 12 Vref+ Reference voltage positive (+5 Volts maximum) 16 Vref - Reference voltage negative (0 Volts minimum) 26 – 28 1 - 5 I/P0 –I/P7 Analog inputs 25, 24, 23 ADD A,B,C Address lines for selecting analog inputs.
21
Pin Description : ADC 0808 / 0809 Pin No Signal Name Description
8, 14, 15, O7 – O0 Digital 8-bit output with O7 MSB and O0 LSB 6 SOC Start of conversion signal pin 7 EOC End of conversion signal pin 9 OE Output latch enable pin, if high enables output 10 CLK Clock input for ADC 22 ALE Address Load Enable. Once loaded the multiplexer sends the appropriate channel to the converter on the chip.
22
Analog input selection
These are unipolar Analog to Digital (A to D) converters, they are able to convert only positive analog input This chips do not contain any internal sample & hold circuit.
23
Interfacing 0808 with 8086
24
Interfacing between ADC to Microprocessor
Problem:- Interface ADC 0808 with 8086 using 8255 ports. Use Port A of 8255 for transferring digital data output of ADC to the CPU & Port C for control signals. Assume that an analog input is present at I/P2 of the ADC and a clock input of suitable frequency is available for ADC. Draw the schematic & timing diagram of different signals of ADC0808.
25
Solution:- The analog input I/P2 is used & therefore address pins A,B,C should be 0,1,0 respectively to select I/P2. The OE (Out put latch Enable) & ALE pins are already kept at +5v to select the ADC and enable the outputs. Port C upper acts as the input port to receive the EOC signal while Port C lower acts as the output port to send SOC to ADC. Port A acts as a 8-bit input data port to receive the digital data output from the ADC.
26
8255 Control Word: D7 D6 D5 D4 D3 D2 D1 D0 1 0 0 1 1 0 0 0 = 98H
Program: MOV AL,98H ; Initialize 8255, send AL to control word (CWR) OUT CWR, AL MOV AL, 02H ;Select I/P2 as analog I/P OUT Port B, AL ;Port B as output MOV AL, 00H ; Give start of conversion pulse to the ADC OUT Port C, AL MOV AL, 01H MOV AL, 00H OUT Port C, AL WAIT: IN AL, Port C ; check for EOC by reading Port C upper & rotating RCL ; through carry. JNC WAIT IN AL, Port A ; if EOC, read digital equivalent in AC HLT ; stop.
27
Fig 4.16 Interfacing of ADC 0808 to 8086 through 8255
28
Interfacing D/A Converters
The Digital to Analog Converters (DAC) convert binary numbers into their analog equivalent voltages. The DAC find applications in areas like Digitally controlled gains Motor speed controls Programmable gain amplifiers etc. AD Bit Multiplying DAC:-- Intersil’s AD 7523 is a 16 pin DIP, multiplying digital to analog converter, containing R-2R ladder (R=10K) for digital to analog conversion.
29
Power supply +5v to +15v Vref -> -10v to +10v The maximum analog output voltage will be +10v A Zener is connected between OUT1 & OUT2 to save the DAC from negative transients. An operational amplifier is used as a current – to – voltage converter at the output of AD 7523. An external feedback resister acts to control the gain.
30
Interfacing of AD 7523 with 8086 Problem:--
Interface DAC AD7523 with the 8086 running at 8MHz & write ALP to generate a saw tooth waveform of period 1ms with Vmax 5v. Solution:-- Code segment Assume cs:code Start: MOV AL, 80H OUT CWR, AL AGAIN: MOV AL, 00H BACK: OUT Port A, AL INC AL CMP AL, 0F2H JB BACK JMP AGAIN Code ends End Start
31
Fig 4.17 Pin diagram of AD7523
32
Fig 4.18 Interfacing of AD7523 to 8086 through 8255
33
END
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.