Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing a very big matrix keyboard

Status
Not open for further replies.

Alloy

Advanced Member level 4
Joined
Apr 3, 2016
Messages
116
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,003
Hey
I want to use old keyboard.
I have figured out the wiring connection.
I am going to use PIC18*.
My question is how do I deal with pull ups and how to convert those connections data to the "matrix"?

This is what I have so far:
Code:
Q = 1 to 2
W = 1 to 3
E = 1 to 4
R = 1 to 5
T = 6 to 5
Y = 6 to 7
U = 1 to 7
I = 1 to 8
O = 1 to 9
P = 1 to 10

A = 2 to 11
S = 3 to 11
D = 4 to 11
F = 5 to 11
J = 5 to 14
H = 7 to 14
G = 7 to 11
K = 8 to 11
L = 9 to 11

Z = 2 to 12
X = 3 to 12
C = 4 to 12
V = 5 to 12
B = 5 to 13
N = 7 to 13
M = 12 to 13

Do I need pullup resistors and how to organize it with PIC?

- - - Updated - - -

EDIT - its M = 12 to 7, i made a mistake while noting down pin numbers
 

Hi, which of the interface is your keyboard using? serial data and serial clock output?
 

I have not done this specific project, but I think the idea is to set 8 'row' pins high on your PIC, and set 8 'column' pins low. Scan all pins rapidly. You are looking for current leaving a 'row' pin, and entering a 'column' pin. (In itself this is risky, and you need to ensure what are safe connections regarding amount of current, what resistor values are needed, etc.)

Each unique combination goes with a particular keypress. You have a chart already made.

Create a 2-dimensional array for a string variable A$. Set the variables:
A$(1,2)="Q"
A$(1,3)="W"
Etc.

Suppose you detect a keypress at row 1 and column 2. Your program tells you which character via the command:

character$ = A$(row,column)
or
character$ = A$(1,2)
 

I have made a rows with 10k pull ups to vcc and they are inputs,
I have made columns which are outputs,
it works ok.

But what If I connect two outputs, one with 5V and second with 0V state, will it fry the PIC ???
 

You are having 26 keys. Using 7 rows and 4 columns, then pull up the rows (input to the mcu port). Total of 28 keys can be scan.

- - - Updated - - -

How is your keyboard wired? If it is matrix configuration the only a single low is allowed on the column. I have make 4x5 matrix before. 4.7k pull up are use due to the lenght and types wire used. The pattern goes like this:
All rows pull up to 5v and column output high, then columns line out low for each while row1 test for lows.
 

In matrix keyboard concept, you are not bridging the supply grid with the ground so nothing to fry! You have limited the current flow with 10k resistor. So you are safe! Good luck.
 

Hi,

So you are safe! Good luck.
I'm afraid..but you are not safe.

The problem is the user. He may press two keys at the same time ...shorting two columns.

Therefore: either place current limiting resistors (330 ohms) in each column line.
Or use only "output LOW" at the columns.
No "output HIGH". Use "HIGH Z" = input, or "pullup" instead.

Klaus
 

Just try to use PS/2 interface. It is a simple SPI. Keyboard codes available in google. Even MicroC support PS/2 as I remember.
Doesn't matter which mcu you are using.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top