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 usb keyboard to 16f877A microcontroller

Status
Not open for further replies.

kiong86

Newbie level 3
Joined
Feb 23, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
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..
 

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.
 

16f877a usb

blueroomelectronics said:
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.
 

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.computer-engineering.org/ps2protocol/
http://en.wikipedia.org/wiki/IBM_PS/2
**broken link removed**
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"?
 

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.
 

interfacing microcontroller 16f877a

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

pic keyboard usb

bepobalote said:
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.computer-engineering.org/ps2protocol/
http://en.wikipedia.org/wiki/IBM_PS/2
**broken link removed**
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?
 

pic send usb keyboard

Excerpt from http://www.computer-engineering.org/ps2protocol/ :
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 : 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:
**broken link removed**
http://www.trash.net/~luethi/microchip/projects/keyboard/v1xx/keyboard_v1xx.html
**broken link removed**
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.... :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top