| Author |
Message |
Drew
Joined: 15 Nov 2004 Posts: 6
|
09 May 2005 8:01 keyboard microcontroller |
|
|
|
|
| I'm having a problem getting my 5 pin keyboard to interface to my microcontroller. I have the Vcc and GND lines connected to 5V and ground. I'm using an oscilloscope to read the Data and Clock lines but come up short. Even when I'm holding a key down continuously, the oscilloscope doesn't pick up any signals. Do the DATA and Clock lines have to be connected to 5V through external pull up resistors? I thought keyboards had internal pull up resistors. Thanks for any responses.
|
|
| Back to top |
|
 |
IanP
Joined: 05 Oct 2004 Posts: 6661 Helped: 1577 Location: West Coast
|
09 May 2005 8:15 interfacing keyboard to 8051 |
|
|
|
|
It is possible that there are no pull-ups inside the keyboard, so you can easily connect ≈4.7kΩ as pull-ups.
What happens when you apply power to the keyboard, do the 3 LEDs flash a couple of times as normal?
|
|
| Back to top |
|
 |
Drew
Joined: 15 Nov 2004 Posts: 6
|
09 May 2005 8:20 interfacing keyboard with 8051 |
|
|
|
|
| The lights don't flash after power up. However, it does work when plugging it into a motherboard. When I press a key continuously should I see signals on the Data and Clocks lines using the oscilloscope? I've tried this test on 3 keyboards already, coming up short each time.
|
|
| Back to top |
|
 |
Google AdSense

|
09 May 2005 8:20 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
bogdanm
Joined: 24 Jun 2003 Posts: 112 Helped: 1
|
09 May 2005 8:34 keyboard interfacing with 8051 |
|
|
|
|
| The keyboard should perform a RESET on startup, and this should be visible by looking at the LEDs, they should blink briefly. Check your electrical connections. Also be aware that the KB may need well above 100mA to function properly, so check if your power source meets this requirement.
|
|
| Back to top |
|
 |
IanP
Joined: 05 Oct 2004 Posts: 6661 Helped: 1577 Location: West Coast
|
09 May 2005 8:37 keyboard with microcontroller |
|
|
|
|
Make sure you connect power (+5V and 0V) correctly: it should flash after power is applied.
Both lines, clock and data, are HIGH at the idle stage. When you press a button you should see pulses from High/Low/High ..
Are we talking about the same keyboards: PS/2 .. AT?
|
|
| Back to top |
|
 |
Drew
Joined: 15 Nov 2004 Posts: 6
|
09 May 2005 9:25 interfacing keyboard to microcontroller |
|
|
|
|
| My bad. The three LED lights DO flash after power up. The Data and Clock lines are held high at 5 V and remain there even when pressing on a key continuously. I'm using an AT keyboard.
|
|
| Back to top |
|
 |
bogdanm
Joined: 24 Jun 2003 Posts: 112 Helped: 1
|
09 May 2005 9:27 interfacing keyboard with microcontroller |
|
|
|
|
| This is strange. Is the keyboard connected to a microcontroller which I/O pins force the data and/or clock lines to logical 1, by any chance?
|
|
| Back to top |
|
 |
Drew
Joined: 15 Nov 2004 Posts: 6
|
09 May 2005 9:35 related:electrosofts.com/8051/keyboard.html |
|
|
|
|
| The data and clocks lines are connected to 5V through 5 Kohm external pullups. and to the oscilloscope. There are no connections to the microcontroller. Do I have to give it a permission-to-send command?
|
|
| Back to top |
|
 |
bogdanm
Joined: 24 Jun 2003 Posts: 112 Helped: 1
|
09 May 2005 9:41 microcontroller keyboard |
|
|
|
|
| No, it needs no special permissions, both clock and data are idle. Very weird. Check your oscilloscope settings.
|
|
| Back to top |
|
 |
zhanhualiu
Joined: 09 Mar 2004 Posts: 18 Helped: 1
|
09 May 2005 10:20 keyboard interfacing with 8051 microcontroller |
|
|
|
|
Maybe this application note is useful for you.
|
|
| Back to top |
|
 |
fnovoac
Joined: 01 Oct 2005 Posts: 12
|
07 Oct 2005 7:38 keyboard interfacing to 8051 |
|
|
|
|
| does anybody have some similar code in pic basic pro???
|
|
| Back to top |
|
 |
harshaperla
Joined: 21 Nov 2005 Posts: 7
|
15 Nov 2006 8:03 8051 microcontroller interfacing with keyboard |
|
|
|
|
Interfacing the Keyboard to 8051 microcontroller:
http://electrosofts.com/8051/keyboard.html
|
|
| Back to top |
|
 |
jayavardhan
Joined: 01 Sep 2006 Posts: 125 Helped: 3 Location: India
|
23 Nov 2006 9:22 interfacing of keyboard with 8051 |
|
|
|
|
| Is the keyboard connected to a microcontroller? then force the data and/or clock to pull up.
|
|
| Back to top |
|
 |
aviv6371
Joined: 07 Jul 2006 Posts: 47 Helped: 1
|
23 Nov 2006 22:23 interfacing keyboard microcontroller |
|
|
|
|
hi,
if u send the electric diagram it will be much more easy to help u.
r u using bi-directional communication or uni ?? make sure that the microcontroller's control pins are configured as input when using uni direction (in my opinion keyboard-host is enough).
one more thing the ideal state is reached automatically by using the pull up resistors, the micro controller should not force there "1" !!!
avi.
|
|
| Back to top |
|
 |