Author Topic: Atmega168 as a Usb Human Interface Device  (Read 6165 times)

0 Members and 1 Guest are viewing this topic.

Offline MaltaeronTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Atmega168 as a Usb Human Interface Device
« on: November 20, 2009, 01:09:00 AM »
I am looking for an IC/module that will allow me to interface an Atmega168 as a Usb Human Interface Device. I have been looking at the FT232R, but am uncertain with whether it is capable of doing this, as the emphasis is all on its Virtual Com Port driver and usage. I need to use the HID device class so that I will be able to "plug and play" the finished project in place of a joystick, for example, in an application I don't have much control over, (though I do have some control, it doesn't have to be an exact match). Will the FT232R allow me to do this? If not, do any of you know of a chip that will?

I am not too interested in doing the Usb in software, though I suppose I could fall back onto that if all else fails.

Thanks in advance,

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
    • CircuitGizmos
Re: Atmega168 as a Usb Human Interface Device
« Reply #1 on: November 20, 2009, 06:33:26 AM »
These are USB HID modules: www.usbmicro.com

Quote
The U401/421 provides a simple digital i/o interface for the PC. Sixteen i/o lines from the microcontroller are provided. Commands can be sent to the U401/421 that change the i/o lines from input to output. I/o lines can be individually selected as inputs or outputs. The U401/421 supports commands to read the ports, and if the ports are set to output, to write to the ports.

The U401/421 is an interface to SPI devices. The firmware on the U401/421 provides generic access to read and write SPI devices. The SPI clock rate can be adjusted to 62.5 kHz, 500 kHz, 1 MHz, or 2 MHz. Because additional pins are available as generic i/o, the U401 can use these lines as slave select lines and address multiple SPI devices.

The SPI subsystem of the U401/421 can be used as a master to communicate with SPI devices such as EEPROMS and A/D converters. The U401/421 can also be used as a SPI slave to a microcontroller that uses the U401/421 as a gateway to the PC. A PIC or an AVR, for example, can act as a SPI master to communicate data with the U401/421, which can then transfer the data to a PC application.

The U401/421 is a convenient way to interface a standard Hitachi-type of intelligent LCD controller to USB. The commands that support communication to the LCD module are the "standard" LCD commands. Standard commands include writing characters to the display, and controlling the display.

USB interfacing is simple with the U401/421 - There are no USB drivers to write and there is no device firmware to develop. There are sample applications that will get you started in minutes. The sample code is available to change for your application. View the ODN - Online Development Notebook - for all documentation and applications.

( And, yes, sold here: www.circuitgizmos.com )
« Last Edit: November 20, 2009, 06:35:06 AM by GearMotion »

Offline MaltaeronTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Re: Atmega168 as a Usb Human Interface Device
« Reply #2 on: November 22, 2009, 09:52:37 PM »
While those don't seem to be quite what I'm looking for -- they are meant to be used with a specific DLL, not through generic HID drivers -- I have found and decided to use the AT90USB162, broken out as a "Bumble-B" http://fletchtronics.net/bumble-b, which has specific code demonstrations for use as a mouse, keyboard, and mass storage device.

Thanks,
 :)

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Atmega168 as a Usb Human Interface Device
« Reply #3 on: November 22, 2009, 10:14:14 PM »
V-USB
http://www.obdev.at/products/vusb/index.html

Basically the mega168 runs the code that makes it look like a HID. The V-USB code already has lots of examples that work 100%!

Offline MaltaeronTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Re: Atmega168 as a Usb Human Interface Device
« Reply #4 on: November 23, 2009, 01:32:09 AM »
Yeah, I looked into them earlier, but they have some limitations -- they only support low-speed usb -- and have some strange restrictions, like needing to post the entire project and source code that uses it. Plus, I wouldn't have as much flexibility in the code that I write as I would if I had hardware usb support.

 

SMF spam blocked by CleanTalk