Unit 3
Unit 3
D7 D6 D5 D4 D3 D2 D1 D0
Group A Group B
Port C Upper
1=Input Port C Lower
Mode set
0=Output 1=Input
1: i/o MODE
0: BSR mode Port A 0=Output
1=Input Port B
0=Output 1=Input
Mode selection 0=Output
00=mode 0 Mode selection
01=mode 1 0=mode 0
1x=mode 2 1=mode 1
operation modes: i) I/O modes (M0,M1,&M2)
ii) BSR (Bit set/Reset) mode
When i/p device has data to send it checks if IBF (input buffer full)
signal is 0.
If 0, it sends data on PA/PB7-0 and activates STB* (Strobe) signal.
(STB* is active low. )
When STB* goes high, the data enters the port and IBF gets
activated.
If the Port interrupt is enabled, INT is activated. This interrupts the
processor.
Processor reads the port during the ISS. Then IBF and INT get 11
deactivated.
82C55: Mode 1 Strobed Input
X X X BIT SET/RESET
1=SET
Don’t care 0=RESET
4 5 6 7 0 1 2 3
(LP) (HP)
AUTOMATIC ROTATION MODE:
• In this mode, a device after being serviced, receives
the lowest priority.
• Assuming that the IR2 has just been serviced, it will
receive the 7th priority
• Non Specific EOI: When this command send to the 8259 PIC,
it resets the highest priority ISR bit.
• Specific EOI: This command specifies which ISR bit to reset
p
8253/8254 Programmable counter / timer
• When the counter is read, the data within the counter will
not be disturbed.
A1 A0 Operation
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
1 1 Control word register
Counter operation
To operate a counter, a desired 16-bit count is loaded in its
register and, on command, it begins to decrement the count until
it reaches 0. At the end of the count, it generates a pulse that can
be used to interrupt the CPU.
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
A set of eight
A set of four output lines for
scan lines interfacing
and eight display.
return lines Scan line are
The keyboard for used to drive
display interfacing multiplexed 7
controller keyboard segment display
chip 8279
provides IIE - SAP
WHY 8279???
8255 can be used in interfacing keyboards and displays.
The disadvantages of this method of interfacing keyboard
and display is that the processor has to refresh the display
and check the status of the keyboard periodically using
polling technique.
BLOCK SCAN
MPU
DIA i) Encoded
INTERFACE
8279 ii) Decoded
When a key is pressed, a debounce logic comes into operation. After the
debounce 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 SHIFT
and CONTROL key status.
2 key lock out: If two keys are pressed simultaneously within a debounce
cycle, no key is recognized and no key code is stored in FIFO RAM till one of
them remains closed and the other is released.
N – key roll over
Any number of keys can be pressed simultaneously and recognized in the
order, the keyboard scan recorded them. All the codes of such keys are
entered into FIFO.
IIE - SAP
In this mode, the first pressed key need not be released before the second is
• CNTL/STB i/p mode:, control lines that enters data in FIFO
RAM . Shift: The status of shift is stored along with key code in
FIFO RAM .
• In Scanned Sensor Matrix mode, a sensor array can be
interfaced with 8279 using either encoded or decoded scans
to scan the key matrix and refresh the display.
IIE - SAP
Output (Display) Modes : 8279 provides two
output modes for selecting the display options.
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 dividing
the external clock input signal by a programmable
constant called pre scaler.
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.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 0 AI X A A A
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. IIE - SAP
d) Read Display RAM :
This command enables a programmer to read the display RAM data.
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.
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 AI A A A A
CD: CLEAR DISPLAY ; CF: CLEAR FIFO RAM STATUS; CA: CLEAR ALL (both CD&CF)
IIE - SAP
h) End Interrupt / Error mode Set :
D7 D6 D5 D4 D3 D2 D1 D0
1 1 1 E X X X 1
E- Error mode
X- don’t care
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
IIE - SAP
I/O Interface
IIE - SAP
IIE - SAP
ADC 0809
ADC 0809
• The ADC0809 is an 8-bit successive approximation type
ADC with inbuilt 8-channel multiplexer.
• 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 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.
• 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).
R-2R Ladder
pin configuration of DAC0800
DAC interfacing with 8085 thro 8255
DAC interfacing with 8051
Shaft of stepper motor
INTRODUCTION
• Clock signal is
Transmit data
systems.
System 1 System 2
• Each block of data clk
has synch characters.
The size of block Signal common
data can be 100 or
more bytes.
ASYNCHRONOUS
COMMUNICATION
Transmit data
• Eliminates the need
for a clock signal
Receive data
between two
microprocessor based
systems. System 1 Signal common System 2
• Data to be
transmitted is sent
out one character at
a time.
BLOCK DIAGRAM
BLOCK DIAGRAM
Sections of 8251 USART:
• Read/Write control logic
• Transmitter
• Receiver
• Data bus system
• Modem control
TRANSMITTER
TRANSMITTER
• Transmitter section receives parallel data
from the microprocessor over the data bus.
The character is then automatically framed
with the start bit, parity bit, correct number
of stop bits, and put into the transmit data
buffer register.
• Finally, it is shifted out of this register to
produce a bit serial output on the TxD line.
TRANSMITTER