electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

interfacing usb keyboard to 16f877A microcontroller


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> interfacing usb keyboard to 16f877A microcontroller
Author Message
kiong86



Joined: 23 Feb 2009
Posts: 4


Post23 Feb 2009 18:00   

pic usb keyboard


hi:
i have faced a problem of my project. currently, i'm doing a connection of usb keyboard to a serial in, parallel out shift register(mm74hc595). but i can't get any signal output even from the male usb port(i have tested just from keyboard usb port to the male usb port only) which is connecting to keyboard. there are 4 pins implement in the usb ports, they are 5V pin, D+, D- and Gnd pin(if i'm not mistaken). is there any command which i have missed in the middle? or any command have to transmit from microcontroller to keyboard in order to active the keyboard?

thanks in advance..
Back to top
blueroomelectronics



Joined: 17 Sep 2006
Posts: 1681
Helped: 99
Location: Toronto, Canada


Post23 Feb 2009 23:34   

usb keyboard pic


You need a USB host controller. A PS/2 keyboard is much easier to interface to the 877
Back to top
kiong86



Joined: 23 Feb 2009
Posts: 4


Post24 Feb 2009 3:56   

vinculum keyboard


i plan to use a serial in, parallel out shift register register and a 555 timer(generate the pulses for shift register) to convert the signal int parallel form, it is much earlier for microcontroller, is this possible?

beside, there are start bit, stop bit and etc while keyboard is sending the data in, does the ps2 or shift register recognize the actual signal that send from keyboard?

thanks a lot for giving me a teach.
Back to top
kiong86



Joined: 23 Feb 2009
Posts: 4


Post25 Feb 2009 14:58   

16f877a usb


blueroomelectronics wrote:
You need a USB host controller. A PS/2 keyboard is much easier to interface to the 877



second quation


i plan to use a serial in, parallel out shift register register and a 555 timer(generate the pulses for shift register) to convert the signal int parallel form, it is much earlier for microcontroller, is this possible?

beside, there are start bit, stop bit and etc while keyboard is sending the data in, does the ps2 or shift register recognize the actual signal that send from keyboard?

thanks a lot for giving me a teach.
Back to top
Google
AdSense
Google Adsense




Post25 Feb 2009 14:58   

Ads




Back to top
bepobalote



Joined: 19 Mar 2005
Posts: 72
Helped: 11
Location: Europe


Post25 Feb 2009 15:19   

16f877a microcontroller


It would be better if you try to make a search on Google with the following keywords "interfacing ps/2 keyboard".
The first hits you will get are:

http://www.beyondlogic.org/keyboard/keybrd.htm
http://www.computer-engineering.org/ps2protocol/
http://en.wikipedia.org/wiki/IBM_PS/2
http://www.jkmicro.com/documentation/pdf/PS2Keyboard_EN.pdf
http://www.sm.luth.se/csee/courses/smd/098/lab31.pdf
http://www.xess.com/projects/ps2_ctrl.pdf

I think they are enough to understand the inner workings on how to interface a PS/2 keyboard and make the interface you require!!!

P.S.: BTW, if you are using a true USB keyboard you will NEVER be able to interface it using shift registers, ...
P.P.S.: But the subject of your post wasn't "interfacing usb keyboard to 16f877A microcontroller"?
Back to top
gelidude



Joined: 14 Apr 2007
Posts: 24
Helped: 3
Location: Philippines


Post26 Feb 2009 2:45   

usb keyboard microcontroller


First, let's clear things up. Are you trying to interface a PS/2 or USB type keyboard?

If you are using a USB type keyboard, you need a USB Host Controller to manage the interfacing since USB signal levels are very different from PS/2 port. USB uses a differential voltage for signalling while PS/2 employs a TTL level or sort of.

If you are using a PS/2 type keyboard then the websites given in the previous post are enough to get yourself a working project. Good luck.
Back to top
kender



Joined: 19 Jun 2005
Posts: 1231
Helped: 88
Location: Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way


Post01 Mar 2009 7:54   

keyboard usb signal


It is actually possible to interface a USB keyboard to a PIC with a Vinculum host controller: http://www.vinculum.com. Just my $0.02
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5152
Helped: 766
Location: Bochum, Germany


Post01 Mar 2009 14:56   

interfacing microcontroller 16f877a


Quote:
It is actually possible to interface a USB keyboard to a PIC with a Vinculum host controller.
Yes, but is it reasonable?
Back to top
kiong86



Joined: 23 Feb 2009
Posts: 4


Post02 Mar 2009 16:14   

pic keyboard usb


bepobalote wrote:
It would be better if you try to make a search on Google with the following keywords "interfacing ps/2 keyboard".
The first hits you will get are:

http://www.beyondlogic.org/keyboard/keybrd.htm
http://www.computer-engineering.org/ps2protocol/
http://en.wikipedia.org/wiki/IBM_PS/2
http://www.jkmicro.com/documentation/pdf/PS2Keyboard_EN.pdf
http://www.sm.luth.se/csee/courses/smd/098/lab31.pdf
http://www.xess.com/projects/ps2_ctrl.pdf

I think they are enough to understand the inner workings on how to interface a PS/2 keyboard and make the interface you require!!!

P.S.: BTW, if you are using a true USB keyboard you will NEVER be able to interface it using shift registers, ...
P.P.S.: But the subject of your post wasn't "interfacing usb keyboard to 16f877A microcontroller"?


hai...
i have a problem here, there are six pins attached on ps2 port , the data, Vcc and clock pins are connected to 5V source, another is ground pin, the rest of 2 pins are not in used. this is what i have connected to, but it doesn't come with any data or clock signal when the power is on.

besides, the data signal from keyboard is an 11bits signal(including start and stop bits) but pic 16f877A is just a 8-bit PIC. what can i do to be able to receive a complete data from keyboard?
Back to top
bepobalote



Joined: 19 Mar 2005
Posts: 72
Helped: 11
Location: Europe


Post02 Mar 2009 16:56   

pic send usb keyboard


Excerpt from http://www.computer-engineering.org/ps2protocol/ :
Quote:
The Data and Clock lines are both open-collector with pullup resistors to Vcc. An "open-collector" interface has two possible state: low, or high impedance. In the "low" state, a transistor pulls the line to ground level. In the "high impedance" state, the interface acts as an open circuit and doesn't drive the line low or high. Furthermore, a "pullup" resistor is connected between the bus and Vcc so the bus is pulled high if none of the devices on the bus are actively pulling it low. The exact value of this resistor isn't too important (1~10 kOhms); larger resistances result in less power consumption and smaller resistances result in a faster rise time.


Have you put the pull-up resistors on data and clock lines, as shown on the schematics?

- - - -

Regarding your 11/8 bit problem, it seems you have to study a bit deeper the general workings of micros.
I suggest you to take a look at the code sample shown at http://www.beyondlogic.org/keyboard/keybrd.htm : it explains in a clearly and detailed way how to read/write from/to the keyboard.
Please do not try to copy the shown code in your program: it was written for a different micro!!! But the description of what actions must be taken to read/write the keyboard are enough to let you write the code for your micro.[/url]

- - - - - -

BTW, I don't think searching on google is too difficult: using the following keywords "interfacing keyboard pic" you will find links like:
http://www.gedanken.demon.co.uk/rs232-converters/ps2.html
http://www.trash.net/~luethi/microchip/projects/keyboard/v1xx/keyboard_v1xx.html
http://www.uelectronics.info/pic-interface-at-keyboard
http://www.arne.si/~mauricio/pic.html
http://homepages.tesco.net/~steve.lawther/steve/keybinfo.htm
Just to mention few of them.

In the next time, try to make a search before posting.... Very Happy
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> interfacing usb keyboard to 16f877A microcontroller
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
USB based Keyboard Interfacing with a 8051 Microcontroller (4)
Interfacing keyboard to microcontroller (13)
Interfacing ASCII keyboard with 8051 microcontroller board (2)
cypress ez usb fx2 microcontroller, interfacing with usb .? (2)
cypress ez usb fx2 microcontroller ,, interfacing with usb ? (1)
USB microcontroller interfacing (3)
Interfacing microcontroller with USB (13)
interfacing USB Flash device to microcontroller (2)
Interfacing Bluetooth USB Dongle with Microcontroller (115)
Interfacing USB storage device with microcontroller (23)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS