PDA

View Full Version : Keyboard socket to USB socket?



Philldapill
01-08-2008, 11:12 AM
I've been thinking about getting the Prop accessory kit. I really want to get it now that I had an idea about how to store virtually limitless amounts of data for very little money. It seems that an SD card socket is fairly expensive and bulky inside a case. If you've ever gotten a new keyboard that was USB, you'll notice that it comes with a PS/2 to USB adapter. You just plug the adapter into your PS/2 socket on your computer, and plug the keyboard into that and presto! PS/2 to USB! Why not use this same adapter and plug it into the keyboard/mouse socket on the accessory kit? It SEEMS like an easy, cheap way to interface all sorts of USB devices... like flash drives.

Can this be done?

Paul Baker
01-08-2008, 11:23 AM
No it can't, it only works because some mice and keyboards are programmed to communicate both usb and ps/2, so it's ps/2 data being communicated through the adapter, not usb.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

Mike Green
01-08-2008, 11:28 AM
No.

The PS/2 to USB adapter you're describing is just a plug adapter. The keyboards that come with this are specially designed to interface to either a USB connection or a PS/2 connection. Most newer keyboards don't come with this adapter because the keyboard itself isn't designed for the PS/2 protocol.

An SD card socket is relatively expensive ($18 on a breakout board from Spark-Fun). There was a posting some months ago about a do-it-yourself SD card socket.

Philldapill
01-08-2008, 11:30 AM
Yeah, I figured as much(well, maybe not the precise technical details). I looked around on wikipedia and saw how they differ. Darn.

Do you know of any USB solutions that can be interfaced to the prop? I know there is the prop plug, but is that strictly for programming the propeller?

Philldapill
01-08-2008, 12:20 PM
I've been thinking about this more. What is so difficult about interfacing the prop to USB? It's not a voltage difference, is it? If so, can't that easily be overcome in hardware? Is it software?

Mike Green
01-08-2008, 12:31 PM
The USB protocol is quite complicated. Someone here has been working on a USB "stack". You might try searching for it.

There are several USB host devices that can be interfaced to a Propeller. Parallax has its Memory Stick Datalogger which can attach mass storage devices, keyboards, mice, and serial adapters via a serial or SPI connection. This uses the same chip as the VDrive2 and VMusic2 from Vinculum (FTDI).

GHI Electronics also has a USB host interface, their USBwiz. This can interface to both an SD card and a USB device, either a mass storage device, or a keyboard / mouse / serial adapter / printer. It can connect via serial / SPI / I2C.

hippy
01-09-2008, 02:24 AM
As Mike says, "it's complicated". There are two different sides to USB, slave devices which plug into a PC and can act as keybaord, mouse, joysticks, modem, serial link, memory storage ( thumb drives ), etc ( that has been the focus of the prior USB work on the Propeller ) and host controllers which can interact with USB slave devices ... that's a much tougher proposition.

Thus a Propeller can act as a USB keyboard, but it's not so far possible to connect a USB keyboard to a Propeller, a Propeller could act as a Memory Stick but could not use a Memory Stick unless it's via a separate device/interface/product which allows that connection to be made.

Philldapill
01-09-2008, 05:36 AM
Alright. You guys seem to know what your talking about so I guess I'll take your word for it for now. USB has become so common place that I just figured it was really simple. I'm assuming when you say it's complicated, you're talking about the software side of it? I mean come on! It's only 4 wires on the darn thing!(joking)

Paul Baker
01-09-2008, 05:44 AM
The reason it has become so ubiquitous is that it is very flexible and has several different ways to communicate on the bus and more than one slave device can be connected to the same bus, also the plug and play device enumeration which takes place adds a layer of complexity, as well as power management. It's this complexity and "ease of use" by the end consumer which makes implementing USB so difficult. As a slave you only need to understand a subset of the USB protocol, but to be a full featured host you must implement all of the USB protocol.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

Philldapill
01-09-2008, 05:47 AM
Wow. That makes a lot of sense with it being easy to use, but hard to develop. Thanks guys for the clarification.