EmbeddedRelated.com
Forums
Memfault Beyond the Launch

How to connect USB keyboard to embedded device?

Started by Mike Silva July 15, 2005
On 15 Jul 2005 10:46:44 -0700, "Mike Silva" <snarflemike@yahoo.com>
wrote:

[Attribution lost]
>> On the other hand USB to PS/2 adaptor might siffice , >> <http://www.google.co.uk/search?q=keyboard+%22ps%2F2+male%22+usb> > >Now that _is_ interesting. And only $5-$10. That also makes me wonder >even more about how difficult it is to host USB keyboards. Thanks for >expanding my horizons! >
AIUI, some modern "USB" keyboards are like the dual-interface (serial-PS/2) mice: the "adapter" connects different signals, the keyboard detects how it is connected, and uses the appropriate interface. Regards, -=Dave -- Change is inevitable, progress is not.
On 15 Jul 2005 09:57:48 -0700, "Mike Silva" <snarflemike@yahoo.com>
wrote:

>What I'd like is a >chip that can take keyboard USB in one end and spit out serial or >parallel characters on the other end, taking as many shortcuts from a >universal USB design as possible given the keyboard-only requirement. >What would be the easiest approach to doing this?
A simple google turned up this: http://web.mit.edu/storborg/Public/USBserial.pdf It provides complete board layout, schematics, BOM, etc. You asked about a "chip" and this uses just such a thing and it may help you think out the idea more, in the context of medium volume. Jon
Jonathan Kirwan <jkirwan@easystreet.com> wrote:
> > A simple google turned up this: > > http://web.mit.edu/storborg/Public/USBserial.pdf > > It provides complete board layout, schematics, BOM, etc. You asked > about a "chip" and this uses just such a thing and it may help you > think out the idea more, in the context of medium volume. > > Jon
A quick glance through the BOM shows the use of the FT232, serial to USB converter, client only. The OP was looking for a host USB solution. -- -CH
On Fri, 15 Jul 2005 18:24:50 GMT, Chafik Hankour
<chankour@gmail.invalid> wrote:

>Jonathan Kirwan <jkirwan@easystreet.com> wrote: >> >> A simple google turned up this: >> >> http://web.mit.edu/storborg/Public/USBserial.pdf >> >> It provides complete board layout, schematics, BOM, etc. You asked >> about a "chip" and this uses just such a thing and it may help you >> think out the idea more, in the context of medium volume. >> >> Jon > >A quick glance through the BOM shows the use of the FT232, serial to USB >converter, client only. The OP was looking for a host USB solution.
Ah. Noted! 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
Mike Silva wrote:

> We have a need in a new product design to be able to connect a standard > USB keyboard. That's the only USB device we will ever want to plug in > (no, really!). I know next to nothing about USB, having just > downloaded the spec yesterday. I gather we want a USB Host, and that > most "USB micros" cannot function as hosts. I also gather that Hosts > are much more difficult than hubs and functions. What I'd like is a > chip that can take keyboard USB in one end and spit out serial or > parallel characters on the other end, taking as many shortcuts from a > universal USB design as possible given the keyboard-only requirement. > What would be the easiest approach to doing this? > > Oh yeah, while I'm not completely opposed to an existing stand-alone > brick, what I'm really asking about is a chip that can be designed into > a medium-volume product. Many thanks!
Mike: This takes some work, but not much. First you need a USB Host chip. We have used the Cypress 811HS and a microcontroller. The micro controller typically would have a UART. Since this is the only device that you would be bringing on line, you need only monitor the enumeration with an USB analyzer and emulate the same data exchanges with your uC/811HS. We have done this for USB printers. We have a little board that takes serial data and packages it into USB packets and delivers it to the printer. We service a 4 endpoints. From a development viewpoint, there are some idiosyncracies with the 811HS, but it yields without too much hair pulling. Doing this development without an USB analyzer however would make it a lot tougher. Blakely Blakely LaCroix Wrenchman, Inc. Minneapolis, Minnesota, USA "Design is Art in practice"

Jonathan Kirwan wrote:
>... > 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.
Yes, that is my hope. I just noticed another thread where the OP is using a USB host chip with a PIC, and it's mostly working. That lets me breathe a lot easier. :-)

Noone wrote:
> Mike: > > This takes some work, but not much. First you need a USB Host chip. We > have used the Cypress 811HS and a microcontroller. The micro controller > typically would have a UART. Since this is the only device that you would > be bringing on line, you need only monitor the enumeration with an USB > analyzer and emulate the same data exchanges with your uC/811HS. We have > done this for USB printers. We have a little board that takes serial data > and packages it into USB packets and delivers it to the printer. We service > a 4 endpoints. > > From a development viewpoint, there are some idiosyncracies with the 811HS, > but it yields without too much hair pulling. Doing this development > without an USB analyzer however would make it a lot tougher.
Thanks a bunch for your comments. I've got the 811HS data open in another window right now, and I just saw another thread where somebody had it more-or-less working with a PIC. I will also definitely take your USB analyser copy-what-works advice to heart.
Jonathan Kirwan <jkirwan@easystreet.com> wrote:
> On Fri, 15 Jul 2005 18:24:50 GMT, Chafik Hankour > <chankour@gmail.invalid> wrote: > >>Jonathan Kirwan <jkirwan@easystreet.com> wrote: >>> >>> A simple google turned up this: >>> >>> http://web.mit.edu/storborg/Public/USBserial.pdf >>> >>> It provides complete board layout, schematics, BOM, etc. You asked >>> about a "chip" and this uses just such a thing and it may help you >>> think out the idea more, in the context of medium volume. >>> >>> Jon >> >>A quick glance through the BOM shows the use of the FT232, serial to USB >>converter, client only. The OP was looking for a host USB solution. > > Ah. Noted! > > 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. -- -CH
On Fri, 15 Jul 2005 20:01:13 GMT, Chafik Hankour
<chankour@gmail.invalid> wrote:

>Jonathan Kirwan <jkirwan@easystreet.com> wrote: >> On Fri, 15 Jul 2005 18:24:50 GMT, Chafik Hankour >> <chankour@gmail.invalid> wrote: >> >>>Jonathan Kirwan <jkirwan@easystreet.com> wrote: >>>> >>>> A simple google turned up this: >>>> >>>> http://web.mit.edu/storborg/Public/USBserial.pdf >>>> >>>> It provides complete board layout, schematics, BOM, etc. You asked >>>> about a "chip" and this uses just such a thing and it may help you >>>> think out the idea more, in the context of medium volume. >>>> >>>> Jon >>> >>>A quick glance through the BOM shows the use of the FT232, serial to USB >>>converter, client only. The OP was looking for a host USB solution. >> >> Ah. Noted! >> >> 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
On 15 Jul 2005 13:01:52 -0700, "Mike Silva" <snarflemike@yahoo.com>
wrote:

> > >Noone wrote: >> Mike: >> >> This takes some work, but not much. First you need a USB Host chip. We >> have used the Cypress 811HS and a microcontroller. The micro controller >> typically would have a UART. Since this is the only device that you would >> be bringing on line, you need only monitor the enumeration with an USB >> analyzer and emulate the same data exchanges with your uC/811HS. We have >> done this for USB printers. We have a little board that takes serial data >> and packages it into USB packets and delivers it to the printer. We service >> a 4 endpoints. >> >> From a development viewpoint, there are some idiosyncracies with the 811HS, >> but it yields without too much hair pulling. Doing this development >> without an USB analyzer however would make it a lot tougher. > >Thanks a bunch for your comments. I've got the 811HS data open in >another window right now, and I just saw another thread where somebody >had it more-or-less working with a PIC. > >I will also definitely take your USB analyser copy-what-works advice to >heart.
It won't be quite that simple. All you need to do is read the USB HID spec. Unless you want to allow only ONE mfg/productid keyboard to be your (perpetually available) keyboard, you will need to parse the HID descriptors and figure out which key code goes to which key. Regards ~Steve There is no "x" in my email address.

Memfault Beyond the Launch