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.

[SOLVED] pic 16f877a and keyboard

Status
Not open for further replies.

gnoble29

Member level 1
Member level 1
Joined
Jun 30, 2010
Messages
38
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
india
Activity points
1,528
I try to interface a keyboard to pic 16f877a.But when i press a single key,the pic will consider as, i am pressing 3 times the same key.{when i press 2,pic will read it as 222} How can i avoid this??
 

You must consider on keyboard treatment routine, not only the press action, but also the release.
Just accept the value after a key be released after pressed.

+++
 

Find out why first.
If the key actually is closing and opening three times you need to 'debounce' it. Most keypads suffer from contact bounce, it's caused by the mechanical switch contacts rebounding when they hit each other, the classic solution is to wait a short time after detecting the switch closure before checking it again. this process is called 'debouncing'.
The other possibility is that your software is simply reading the switch being closed repeatedly before it has time to open again. The solution to this is to read the keyboard again until it says no keys are pressed before continuing.

Brian.
 

...Most keypads suffer from contact bounce, it's caused by the mechanical switch contacts rebounding when they hit each other, the classic solution is to wait a short time after detecting the switch closure before checking it again. this process is called 'debouncing'...

Other possibility is to perform this 'debouncing' task by hardware, but is not usual anymore.

+++
 

Find out why first.
If the key actually is closing and opening three times you need to 'debounce' it. Most keypads suffer from contact bounce, it's caused by the mechanical switch contacts rebounding when they hit each other, the classic solution is to wait a short time after detecting the switch closure before checking it again. this process is called 'debouncing'.
The other possibility is that your software is simply reading the switch being closed repeatedly before it has time to open again. The solution to this is to read the keyboard again until it says no keys are pressed before continuing.



i think my software is simply reading the switch being closed repeatedly before it has time to open again. how i overcome this??
 

I think the guidelines was already providen here so conceptually as your question.
There are no need to hightlight the question without you provide more details.

+++
 

Unless you provide some code how do you expect us to fix your problem, we can't guess what you are doing in your code.

Alex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top