EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

How to connect USB keyboard to embedded device?

Started by Mike Silva July 15, 2005
On Fri, 15 Jul 2005 20:19:38 GMT, Jonathan Kirwan
<jkirwan@easystreet.com> wrote:

>On Fri, 15 Jul 2005 20:01:13 GMT, Chafik Hankour >>> Isn't it possible to significantly pare down what a host needs to do, >>> if there is ONLY going to be one and exactly one keyboard attached? >>> Being ignorant of the details, it sure seems to me that it should be >>> possible to set aside almost all of the host functionality and strip >>> the need down to a much simpler system. >>> >>> Jon >> >>The USB host side is not trivial to implement without a dedicated controller. Someone >>mentioned already the cypress chip, there is also the Philips one: >> >>http://www.semiconductors.com/similar/ISP1581.html >> >>which Digikey happens to have in stock. > >Yes, but that wasn't my question. I wasn't wondering about how >difficult it was to implement _if_ one does everything that a general >purpose host USB must do. I don't think anyone is disagreeing that >this is non-trivial and more. > >The question I'm asking from my ignorance of USB is whether or not it >is possible for someone very knowledgeable about USB hosts and the >requirements for PC keyboards to pare everything down (hardware and >software) so that the result would still work very well and not be >nearly the burden that a general purpose USB host would present. > >In other words, is it possible to strip it down to the essentials and >significantly reduce the problem, in this particular case? > >Jon
Well some crazy guy did something along those lines: http://www.cesko.host.sk/IgorPlugUSB/IgorPlug-USB%20(AVR)_eng.htm low speed only, connected to a avr. There is no "x" in my email address.

Steve Calfee wrote:
> On Fri, 15 Jul 2005 20:19:38 GMT, Jonathan Kirwan > <jkirwan@easystreet.com> wrote:
> >The question I'm asking from my ignorance of USB is whether or not it > >is possible for someone very knowledgeable about USB hosts and the > >requirements for PC keyboards to pare everything down (hardware and > >software) so that the result would still work very well and not be > >nearly the burden that a general purpose USB host would present. > > > >In other words, is it possible to strip it down to the essentials and > >significantly reduce the problem, in this particular case? > > > >Jon > > Well some crazy guy did something along those lines: > http://www.cesko.host.sk/IgorPlugUSB/IgorPlug-USB%20(AVR)_eng.htm > > low speed only, connected to a avr.
Well he did a function, not a host, but I still tip my hat to anybody who can bit-bang a USB device. Dang!

Vadim Borshchev wrote:
> Mike Silva wrote: > > > I did search for PS/2 keyboards but only found USB keyboards for > > PlayStation 2s. > > I suspect misunderstanding here. PS/2 does *not* mean PlayStation 2 in > this context. It is the name of IBM's system introduced in '87: > > http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html > http://www.tavi.co.uk/ps2pages/ohland/keyboard.html
Yes, thanks, I did understand the PS/2 reference, but I wasn't sure they were still available after my quick search. Now I see I just need to wade through the PlayStation 2 devices to find the PS/2 devices. BTW, question for everybody: are all these PS/2 keyboards being sold for replacement use only, or are there still computers being sold that use PS/2 keyboards? If no PS/2-keyboard computers are now being sold, when did they stop selling them and switch completely to USB keyboard computers?

Mike Turco wrote:

> Serial keyboards will certainly be around for another three or more years. > If the product does well and you're still in business, and PS/2 keyboards > start going out of style, you will still have an opportunity to buy a ton of > USB to PS/2 converters, which will buy you plenty of time to redesign your > product.
Yes, you're right of course, choosing PS/2 keyboards now does not lock us into them forever. At the same time, at least for my own knowledge, I need to pursue the USB angle a little more just to get a better feel for it. I got'sta know, as the man said.
> [OT] Are you of any relation to Jose?
Nope, afraid not.
On 16 Jul 2005 16:27:36 -0700, "Mike Silva" <snarflemike@yahoo.com>
wrote:

> > >Steve Calfee wrote: >> On Fri, 15 Jul 2005 20:19:38 GMT, Jonathan Kirwan >> <jkirwan@easystreet.com> wrote: > >> >The question I'm asking from my ignorance of USB is whether or not it >> >is possible for someone very knowledgeable about USB hosts and the >> >requirements for PC keyboards to pare everything down (hardware and >> >software) so that the result would still work very well and not be >> >nearly the burden that a general purpose USB host would present. >> > >> >In other words, is it possible to strip it down to the essentials and >> >significantly reduce the problem, in this particular case? >> > >> >Jon >> >> Well some crazy guy did something along those lines: >> http://www.cesko.host.sk/IgorPlugUSB/IgorPlug-USB%20(AVR)_eng.htm >> >> low speed only, connected to a avr. > >Well he did a function, not a host, but I still tip my hat to anybody >who can bit-bang a USB device. Dang!
Dang, you are right. I had another ...cesko... link that I THOUGHT was a host, but it is now a dead link. I am very aware of the diffence between a host and a device. Sorry for the noise on the newsgroup. There is no "x" in my email address.

Mike Silva wrote:
> Vadim Borshchev wrote: > > Mike Silva wrote: > > > > > I did search for PS/2 keyboards but only found USB keyboards for > > > PlayStation 2s. > > > > I suspect misunderstanding here. PS/2 does *not* mean PlayStation 2 in > > this context. It is the name of IBM's system introduced in '87: > > > > http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html > > http://www.tavi.co.uk/ps2pages/ohland/keyboard.html > > Yes, thanks, I did understand the PS/2 reference, but I wasn't sure > they were still available after my quick search. Now I see I just need > to wade through the PlayStation 2 devices to find the PS/2 devices. > > BTW, question for everybody: are all these PS/2 keyboards being sold > for replacement use only, or are there still computers being sold that > use PS/2 keyboards? If no PS/2-keyboard computers are now being sold, > when did they stop selling them and switch completely to USB keyboard > computers?
Not sure about branded computers, but every motherboard I looked at still support PS/2 k/b and floppy drive. Although the authority declared them dead some time ago, they are still there.
On Sat, 16 Jul 2005 03:16:48 GMT, Jonathan Kirwan
<jkirwan@easystreet.com> wrote:

[...]
>I am glad for a direct answer (well, not so glad myself, but more >vicariously for the OP.) But I have a hard time accepting this >assertion without the details. Why? It just seems that keyboard >support cannot possibly require every single feature of a general >purpose USB host. I mean, each and every single one?? Really???
Not really. Download the USB HID (Human Interface Device) spec, and look up "Boot Protocol." IIRC, it's a minimal USB interface that keyboards must support to allow BIOS keyboard interface. Regards, -=Dave -- Change is inevitable, progress is not.
On Tue, 19 Jul 2005 12:22:48 GMT, iddw@hotmail.com (Dave Hansen)
wrote:

>On Sat, 16 Jul 2005 03:16:48 GMT, Jonathan Kirwan ><jkirwan@easystreet.com> wrote: > >[...] >>I am glad for a direct answer (well, not so glad myself, but more >>vicariously for the OP.) But I have a hard time accepting this >>assertion without the details. Why? It just seems that keyboard >>support cannot possibly require every single feature of a general >>purpose USB host. I mean, each and every single one?? Really??? > >Not really. Download the USB HID (Human Interface Device) spec, and >look up "Boot Protocol." IIRC, it's a minimal USB interface that >keyboards must support to allow BIOS keyboard interface.
I'm not into USB just now, but I might just look that up on your recommendation, anyway. But before I do, your last sentence here suggests you are talking from the perspective of what a keyboard must support. Presumably, this is also what the host side must also support? But that makes me wonder if the host side must also provide this (the idea being that although it *may* be a requirement for the keyboard to support it, it may not be the case that keyboards insist that the host go through these steps in order to function -- keep in mind that I don't believe our OP needs to support identification of device/subdevice for driver loading, etc. -- so while all that might be necessary in general for Windows, it isn't necessary as I read it for the OP.) Can you address yourself to this? Or should I just go look and see for myself, anyway? Thanks for the comments, by the way. Jon
I understand how designing a USB host that will support multiple
devices like a PC would is a daunting task indeed.  But after designing
a few USB devices, it would seem a USB Host that only supports a
specific device (like a keyboard) wouldn't be incredibly difficult.

Host would have to:
-Wait for device detection (change of state on the D+ and D- lines)
-Read out descriptor from endpoint
-if (Endpoint != Keyboard)
-  Ignore
-else
-  start polling the endpoint where the keyboard data comes out.

The only BIG problem I see is the physical interface electronics,
because no one makes a physical interface only. In addition, no one
makes a simple host uC with the physical interface built in.  Any
thoughts or comments on this?

-J

I understand how designing a USB host that will support multiple
devices like a PC would is a daunting task indeed.  But after designing
a few USB devices, it would seem a USB Host that only supports a
specific device (like a keyboard) wouldn't be incredibly difficult.

Host would have to:
-Wait for device detection (change of state on the D+ and D- lines)
-Read out descriptor from endpoint
-if (Endpoint != Keyboard)
-  Ignore
-else
-  start polling the endpoint where the keyboard data comes out.

The only BIG problem I see is the physical interface electronics,
because no one makes a physical interface only. In addition, no one
makes a simple host uC with the physical interface built in.  Any
thoughts or comments on this?

-J


The 2024 Embedded Online Conference