Saturday, September 22, 2012

V-USB Works

I spent some time looking for a way to test the virtual USB ("V-USB") possibility and functionality of this board.  I stumbled across the EasyLogger project that looked like a great example to show if V-USB would work.  In looking through the source code, it was clear that my board used different USB pins to the ATtiny85 than the stock EasyLogger program did, so I was certain that I wouldn't be able to use the included .hex file as it was.  I managed to find the directions to equip my linux box with AVG-GCC and associated libraries.  I changed the EasyLogger source code header file to point to the right two pins I had set aside for USB D+ and D- on this board and compiled a new .hex file.  I was so stoked that it actually compiled, then, even loaded to the chip with AVRDUDE.  Subsequently, I was printing numbers to a notepad in Windows and had the ATtiny recognized as a HID keyboard device.  Yay!

I used the same AVRDUDE version and config file that comes with Arduino 1.01 to upload my own hex file.  I found the commands for this by enabling the verbose output in the Arduino preferences.  It shows exactly the command line required when you upload a sketch using an external programmer.  Just pointing it to a different .hex file works well.

Helpful Links:
EasyLogger:
http://www.obdev.at/products/vusb/easylogger.html

Requirements to compile for AVR under Linux:
http://tldp.org/HOWTO/Avr-Microcontrollers-in-Linux-Howto/x207.html

Setting up the fuse bits on the ATtiny85 properly for V-USB:
http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/

No comments:

Post a Comment