EmbDev.net

Forum: µC & Digital Electronics Simpler USB HID Controller / Simple USB HID Controller


Author: Chris (Guest)
Posted on:

Rate this post
0 useful
not useful
Good evening,

I've got the following problem that I'm trying to solve. I'm currently 
doing a masters project in electronics, involving some analogue and 
digital signal processing.
This all works rather well using an ADC and a DSP.

However, I'm now trying to achieve the following:

Based on the analysed data the DSP recognizes one of 6 cases and uses 3 
GPIO pins as outputs for these.
I'd like to be able to send simple keycommands to a PC via USB based on 
what case has been recognized.

Is there a simple, readily available, device that acts as a USB HID 
(keyboard) device that automatically sends "left arrow" "right arrow" 
etc to the PC ?
I'm looking for a solution thats relatively easy to implement, as I 
don't have much time to implement this, which isn't a main part of my 
project.

Any tips / ideas are greatly appreciated.

Thanks

Author: Klaus Albers (klaus-albers)
Posted on:

Rate this post
0 useful
not useful
A PS/2 keyboard is quite easy to implement, if you need a solution on a 
very short time scale...

Author: Chris (Guest)
Posted on:

Rate this post
0 useful
not useful
easier to implement than USB HID ?

Author: mizch (Guest)
Posted on:

Rate this post
0 useful
not useful
PS/2 is a simple serial asynchronous connection, and the data the 
keyboard sends is easy to implement.

For a HID client implementation (USB) with an ATmega have a look for 
V_USB; they have a project which does about what you need 
(http://www.obdev.at/products/vusb/hidkeys.html).  It sends keystrokes 
over USB depending on some inputs (keys).

Author: Chris (Guest)
Posted on:

Rate this post
0 useful
not useful
Thanks,
I had a look at their demo HIDkeys, looks great, only issue is that I 
don't have the required number of output pins on the device I'm using. 
Otherwise I'd just use the HIDkeys circuit and code, change the key 
assignments and pull the required pins low using output pins of my 
device.

I've looked at the USB-I2C device at 
http://www.firmwarefactory.com/USB-I2C.aspx

Do you think I can rig that to identify as a keyboard and just send the 
required messages to it via I2C when I want to "press a key"?

Thanks

Chris

Author: Klaus Albers (klaus-albers)
Posted on:

Rate this post
0 useful
not useful
There's a commercial PS/2 keyboard emulation add-on for Bascom 
(www.mcselec.com), which makes sending scan codes to a PC a piece of 
cake... If you're using C, there should be ready-to-use code as well. 
The search phrase would be "arcade" (people building there own game 
controllers with PS/2 connections).


Good luck

Klaus

Author: fchk (Guest)
Posted on:

Rate this post
0 useful
not useful
The NXP LPC1343 CortexM3 has USB HID and USB Mass Storage drivers in its 
on-chip rom.

fchk

Author: Chris (Guest)
Posted on:

Rate this post
0 useful
not useful
Just had the idea to simply use a I2C 8bit I/O extender. That way I 
could use the HIDkeys circuit and code an simple pull one pin at a time 
to trigger a "key pressed".

According to the ATMega8A datasheet 12MHz at 3.3V is outside the Safe 
Operating Area.

Has anyone got any experience running the ATMega8A at 3.3V and 12MHz? I 
don't really fancy introducting yet another voltage level to my circuit, 
with another set of level shifters etc.

Author: Master Snowman (Guest)
Posted on:

Rate this post
0 useful
not useful
microchip has for their PICs with USB examplecode which implements a HID 
keyboard and mouse. this is for free also the compiler and development 
software.

Author: TheBug (Guest)
Posted on:

Rate this post
0 useful
not useful
Is this for a one-off design or are you planning to mass produce this?

In the second case I can only recommend to stay away from PS/2 as it is 
an aged and never well documented interface. It can take you a few years 
to get the protocol stack sufficiently debugged because there are so 
many implementations around that vary in significant non-obvious 
details.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.