PROGRAMMABLE PERIPHERAL INTERFACE (PPI) -8255 • 8255 is a general purpose programmable device used for data transfer between processor and I/O devices. • It has 3 programmable I/O ports (PA,PB &PC) and port operation (IN/OUT Port) is defined by control word in the control word register. • Ports are operated in two modes: • i) I/O modes: Mode 0, Mode 1,& Mode 2 • Ii) BSR (Bit set/Reset) mode
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PROGRAMMABLE PERIPHERAL
INTERFACE (PPI) -8255
• 8255 is a general purpose programmable device usedfor data transfer between processor and I/O devices.
• It has 3 programmable I/O ports (PA,PB &PC) andport operation (IN/OUT Port) is defined by controlword in the control word register.
• Ports are operated in two modes:
• i) I/O modes: Mode 0, Mode 1,& Mode 2
• Ii) BSR (Bit set/Reset) mode
About 8255
• PPI has 40 pins and it has three distinct modes ofoperation.
• Port A (PA7-PA0) :8 pins
• Port B (PB7-PB0) :8 pins
• Port C (Pc: Upper: PC7-PC4) : 4 pins
• Port C (Pc: Lower: PC3-PC)) : 4 pins
• Data Bus (D7-D0) : 8 pins
• Control signals : 6 pins
• VCC and Gnd : 2 pins
Pin Diagram
Pin names and functionPin name No.of
pinsI/O functions
PA0-PA7 8 i/o Tristate
Port can be configured either input or output by
software
Port has output latch buffer and input buffer
PA can be programmed by mode 0 , mode 1,
mode 2 .
PB can be programmed by mode 0 and mode 1.
PC can be programmed by bit set/reset
operation.
Port C can be divided into two 4 bit ports namely
PC7-PC4 & PC3-PCO and used for control
signals to PA and PB
PB0-PB7 8 i/o Tristate
PC0-PC7 8 i/o Tristate
D0-D7 8 i/o Tristate
Used for data transfer with MPU
Transfer of control words to PPI
Read status information from PPI
8255 Block Diagram
Group A and Group B control:
Group A and B get the Control Signal from CPU and send the command to the
individual control blocks.
Group A send the control signal to port A and Port C (Upper) PC7-PC4.
Group B send the control signal to port B and Port C (Lower) PC3-PC0.
• FOR I/O MODE:
The control word mode format for I/O as shown in figure
In this mode, the device acts as a divide-by-n counter, which is commonly
used to generate a real-time clock interrupt.
Like other modes, counting process will start the next clock cycle after COUNT
is sent. OUT will then remain high until the counter reaches 1, and will go low
for one clock pulse. OUT will then go high again, and the whole process
repeats itself.
8237DMA CONTROLLER
IIE - SAP
The keyboard display controller chip 8279 provides
A set of four scan lines and eight return lines for interfacing keyboard
A set of eight output lines for interfacing display.
Scan line are used to drive multiplexed 7 segment display
IIE - SAP
WHY 8279???
8255 can be used in interfacing keyboards and displays.The disadvantages of this method of interfacing keyboardand display is that the processor has to refresh the displayand check the status of the keyboard periodically usingpolling technique.
Thus a considerable amount of CPU time is wasted,reducing the system operating speed.
Intel’s 8279 is a general purpose keyboard displaycontroller that simultaneously drives the display of a systemand interfaces a keyboard with the CPU, leaving it free for itsroutine task.
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
IIE - SAP
8279
Keyboard segment
i)Scans the keyboard
ii) detects key if any key is pressed
iii) Key code is stored in 8x8 FIFO RAM
iv) data in FIFO RAM sends Interrupt signal to CPU
vi) CPU reads the key code stored in FIFO RAM
Display segment
vii) Then CPU writes the key code in 16x8 display RAM
viii)Display devices display the data in the display RAM
IIE - SAP
BLOCK
DIA
8279
KEYBOARD
i) Scanned Keyboard ( 2 Key lock out /N key roll over)
ii)strobed input mode
iii)scanned sensor matrix mode
SCAN
i) Encoded
ii) Decoded
MUX. DISPLAY (8 digit or 16 digit)
i)Left Entry
ii) Right Entry
MPU INTERFACE
IIE - SAP
IIE - SAP
2 Key lock out/N key roll overKEY DEBOUNCEWhen a key is pressed, a debounce logic comes into operation. ReturnBuffers and Keyboard De-bounce and Control section scans for a key closurerow wise. If a key closer is detected, the keyboard debounce unit debouncesthe key entry (i.e. wait for 10 ms).
When a key is pressed, a debounce logic comes into operation. After thedebounce period (i.e. wait for 10 ms). , if the key continues to be detected,The code of key is directly transferred to the sensor RAM along with SHIFTand CONTROL key status.2 key lock out: If two keys are pressed simultaneously within a debouncecycle, no key is recognized and no key code is stored in FIFO RAM till one ofthem remains closed and the other is released.N – key roll overAny number of keys can be pressed simultaneously and recognized in theorder, the keyboard scan recorded them. All the codes of such keys areentered into FIFO.In this mode, the first pressed key need not be released before the second ispressed.
• CNTL/STB i/p mode:, control lines that enters data in FIFORAM . Shift: The status of shift is stored along with key code inFIFO RAM .
• In Scanned Sensor Matrix mode, a sensor array can beinterfaced with 8279 using either encoded or decoded scansto scan the key matrix and refresh the display.
IIE - SAP
Output (Display) Modes : 8279 provides two output modes for selecting the display options.
Display Scan :
• In this mode 8279 provides 8 or 16 character multiplexed displays those can be organized as dual 4- bit or single 8-bit display units.
Display Entry
( right entry or left entry mode )
• 8279 allows options for data entryon the displays.
• The display data is entered fordisplay either from the right side orfrom the left side.
IIE - SAP
Control and Timing Register and Timing Control • These registers store the keyboard and display modes and
other operating conditions programmed by CPU.
IIE - SAP
The registers are written with A0=1 and WR=0.The Timing and control unit controls the basic timings forthe operation of the circuit.
All the command words or status words are written orread with A0 = 1 and CS = 0 to or from 8279.
a) Keyboard Display Mode Set : The format of the command word to select different modes of operation of 8279 is given below with its bit definitions.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 D D K K K
IIE - SAP
SENSOR MATRIX
SENSOR MATRIX
IIE - SAP
B) Programmable clock : The clock for operation of 8279 is obtained by dividingthe external clock input signal by a programmableconstant called pre scaler.
PPPPP is a 5-bit binary constant.
The input frequency is divided by a decimal constantranging from 2 to 31, decided by the bits of an internalprescaler, PPPPP.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 P P P P P
IIE - SAP
c) Read FIFO / Sensor RAM : The format of this command is given below.
AI – Auto Increment FlagAAA – Address pointer to 8 bit FIFO RAM
X- Don’t care
This word is written to set up 8279 for reading FIFO/ sensor RAM. In scanned keyboard mode, AI and AAA bits are of no use. The 8279 will automatically drive data bus for each subsequent read, in the same sequence, in which the data was entered.In sensor matrix mode, the bits AAA select one of the 8 rows of RAM. If AI flag is set, each successive read will be from the subsequent RAM location.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 0 AI X A A A
IIE - SAP
d) Read Display RAM : This command enables a programmer to read the display RAM data.
The CPU writes this command word to 8279 to prepare it for display RAM read operation. AI is auto increment flag and AAAA, the 4-bit address points to the 16-byte display RAM that is to be read.If AI=1, the address will be automatically, incremented after each read or write to the Display RAM. The same address counter is used for reading and writing.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 1 AI A A A A
IIE - SAP
d) Write Display RAM : This command enables a programmer to write the display RAM data.
AI – Auto increment Flag.AAAA – 4 bit address for 16-bit display RAM to be
written.e) Display Write Inhibit/Blanking :
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 AI A A A A
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 X IW IW BL BL
IW - inhibit write flag (Masking) BL - blank display bit flags (Blanking)
For the sensor matrix mode, this command lowers the IRQ line and enables further writing into the RAM. Otherwise, if a change in sensor value is detected, IRQ goes high that inhibits writing in the sensor RAM. For N-Key roll over mode, if the E bit is programmed to be ‘1’, the 8279 operates in special Error mode
D7 D6 D5 D4 D3 D2 D1 D0
1 1 1 E X X X 1
IIE - SAP
I/O Interface
FIFO status register
•Code given in text for reading keyboard.
•Data returned from 8279 contains raw data that need to be translated to ASCII:
IIE - SAP
IIE - SAP
ADC 0809
ADC 0809• The ADC0809 is an 8-bit successive approximation type
ADC with inbuilt 8-channel multiplexer.
• The ADC0809 is suitable for interface with 8086
microprocessor.
• The ADC0809 is available as a 28 pin IC in DIP (Dual Inline
Package).
• The ADC0809 has a total unadjusted error of ±1 LSD (Least
Significant Digit).
PIN DESCRIPTION OF
ADC0809
SAR
Interfacing ADC with 8085 thro 8255
ADC interfacing with 8051
DAC• To convert the digital signal to analog signal a Digital-to-Analog Converter
(DAC) has to be employed. ( binary weighted and R/2R ladder. )
• The DAC will accept a digital (binary) input and convert to analog voltage
or current.
• Every DAC will have "n" input lines and an analog output.
• The DAC require a reference analog voltage (Vref) or current (Iref)
source.
• The smallest possible analog value that can be represented by the n-bit
binary code is called resolution.
• The resolution of DAC with n-bit binary input is 1/2nof reference analog
value.
DAC 0800
•
The DAC0800 is an 8-bit, high speed, current output DAC with a typical
settling time (conversion time) of 100 ns.
• It produces complementary current output, which can be converted to
voltage by using simple resistor load.
• The DAC0800 require a positive and a negative supply voltage in the range
of ± 5V to ±18V.
• It can be directly interfaced with TTL, CMOS, PMOS and other logic
families.
• For TTL input, the threshold pin should be tied to ground (VLC = 0V).