Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Display Interfacing

Display Interfacing

LED Displays:
LED displays are available in two formats:
1) 7 segment displays
2) 5 by 7 dot-matrix displays

Seven segment display

Seven segment displays are generally used as numerical indicators and consists of a
number of LEDs arranged in seven segments as shown.

a
Any number between 0 to 9 can be
f b indicated by lighting the appropriate
segments.
g
e c

d
The seven segments are labeled as a to g. By forward biasing different LED segment, the
digits 0 through 9 are displayed.

Ex: To display 1, we need to light up b and c. To display 4 we need to light up b, c, f


and g
a a a a a

f b f b f b f b f b
g g g g g
e c e c e c e c e c

d d d d d

a a a a a

f b f b f b f b f b

g g g g g
e c e c e c e c e c

d d d d d
The seven segment displays are of two types:

• Common Anode type


• Common Cathode type

In common anode, all anodes of LEDs are connected together to +Vcc. And in
common cathode, all cathodes are connected together to GROUND.

a b c d e f g
+Vcc

GND
a b c d e f g
5 by 7 dot matrix display

This display can be used to display number as well as alphabets.

C4 C3 C2 C1 C0

R6

R5

R4

R3

R2

R1

R0
Interfacing LED Displays
Static Display:
+Vcc +Vcc

a
b
A
7 c
B 4 d
C 4 e
7
D f
g
Multiplexed Display:

+Vcc

a a
b b
A 7 c c
B 4 d d
Output
Port A C 4
e
D 7 e
f f
g g

Output +Vcc
Port B
Keyboard
Interfacing
Objectives

• Keyboard Interfacing
• Debounce techniques
• Simple keyboard interface
• Matrix keyboard Interface
Keyboard Interfacing
For interfacing keyboard to the microprocessor based systems, usually push buttons are
used.

These push button keys when pressed, bounces a few times, closing and opening the
contacts before providing a steady reading.

Logic 1 Logic 1
+5V

R
Outpu
t Logic 0

Key Key
Pressed Pressed

Reading taken during bouncing period may be faulty. Therefore MP must wait until the key
reach to a steady state; this is known as key debounce.
KEY DEBOUNCE USING
Start
SOFTWARE Read status of keys

Are No
All keys
Open ?
Yes
Wait for key debounce (10ms)

Read status of keys

No
Is key pressed?
Yes
Wait for key debounce (10ms)

Read any code

End
Simple keyboard interface
+5V

K1

K2

K3

K4
8-bit
Input port K5
data
K6

K7

K8
key Key code Hex
D7 D6 D5 D4 D3 D2 D1 D0 code
K1 1 1 1 1 1 1 1 0 FEH
K2 1 1 1 1 1 1 0 1 FDH
K3 1 1 1 1 1 0 1 1 FBH

K4 1 1 1 1 0 1 1 1 F7H

K5 1 1 1 0 1 1 1 1 EFH
DFH
K6 1 1 0 1 1 1 1 1
BFH
K7 1 0 1 1 1 1 1 1
7FH
K8 0 1 1 1 1 1 1 1
Matrix
keyboard
In simple keyboard interface one input line is required to interface one key and this number
Interface
will increase with number of keys.

Therefore, such technique is not suitable when it is necessary to interface large number of
keys.

To reduce the number of connections keys are arranged in the matrix and to interface
with such an arrangement different technique is used.
+5V
Column 3 Column 2 Column 1 Column 0

Row 3

Row 2
Data bus

Input port A Row 1

Row 0

Output port B

Data bus
When all keys are open, row and column do not have any connection.

When any key is pressed it shorts it shorts corresponding row and column.
If output line of this column is low, it makes the corresponding row line low;
otherwise the status of row line is high. The key is identified by the data sent
on the output port and input code received from the input port.
Check 1: whether any key is pressed or not.

1. Make all column lines zero by sending low on all column lines. This activates
all keys in the keyboard matrix.
2. Read the status of return lines. If the status of all lines is logic high, no key is
pressed; otherwise key is pressed.

Check 2: Identify the key pressed.

1. Activate keys from any one column by making any one column line zero.
2. Read the status of return lines. The zero on any return line indicates that key is
pressed from the corresponding row and selected column.

You might also like