0% found this document useful (0 votes)
16 views9 pages

Keyboard Interface

Uploaded by

Vijayaraghavan L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views9 pages

Keyboard Interface

Uploaded by

Vijayaraghavan L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Keyboard Interfacing

I/O Mode (Input/Output Mode)


1. Understanding the 4x4 Matrix
Keypad
• A 4x4 matrix keypad has 16 keys
arranged in a grid of 4 rows and 4
columns.
• The keys are connected to a grid
where each key press connects a row
to a column.
• Read the state of the keys- scanning
the rows and columns.
I/O Mode (Input/Output Mode)
2. Connecting the Keypad to 8255
• The rows of the keypad (R1, R2, R3,
R4) are connected to Port A of the
8255 as input lines.
• The columns of the keypad (C1, C2,
C3, C4) are connected to Port C
(lower part, PC0 to PC3) as output
lines.
• Handshaking signals (like STB, ACK,
INTR) will be used for synchronizing
data transfer in Mode 1.
I/O Mode (Input/Output Mode)
3. Configuring the 8255 in Mode 1
(Input with Handshaking)
1. Port A is configured as an input port
to read the row signals from the
keypad.
2. Port C is used to provide
handshaking signals and column
scanning (output).
3. The Control Word Register (CWR) is
set to configure Port A in Mode 1 for
input.
I/O Mode (Input/Output Mode)

How It Works:
1. Port A is configured as an input port to read the rows of
the keypad.
2. Port B is configured as an output port to scan the
columns of the keypad.
3. A key press connects one row and one column, which is
detected by scanning the columns and reading the rows.
4. The microprocessor sequentially scans the columns by
sending signals through Port B and reads the
corresponding row values via Port A.
Application: Keypads are used in calculators, ATMs, and security
systems to input data.
Interfacing with an LCD Display
Interfacing with an LCD Display
Scenario: You want to send data from the
microprocessor to an LCD display connected to
Port B.

How It Works:
In Mode 0 (simple output mode), you can
configure Port B as an output port to send data to
the LCD. The 8255 PPI will transmit the data from
the processor to the LCD, which then displays the
information.

Application:
Display Systems: Many embedded systems, such
as industrial control systems or consumer
electronics, use LCD displays to show data or
status information.
ADC (Analog-to-Digital Converter) Interfacing
ADC (Analog-to-Digital Converter) Interfacing
Scenario: You are connecting an ADC to measure analog signals from a
temperature sensor. The ADC is connected to Port A for data input.
• How It Works: In Mode 1 (input with handshaking), you can
configure Port A as an input port with handshaking signals to control
data flow from the ADC. The ADC converts the analog signal to digital
data, and the handshaking ensures accurate data transfer when the
ADC is ready.
Application:
• Data Acquisition Systems: ADCs are commonly used in measurement
systems, such as temperature monitoring or pressure sensing, to
convert real-world analog signals into digital form for processing.

You might also like