bitbanging usb bootloader?

given that some usb adapters actually use avr pics, is it conceivable that a duino style bootloader could be written that can do all the "gruntwork" of a usb connection? So that it could receive a new sketch via usb with a simplified interface circuit (like a couple transistors)?

I know practically nothing about bit-banging USB, but I know that the USB protocol is pretty complicated and it's difficult enough fitting a simple serial bootloader in the limited (2k) bootloader space. I'd be very surprised if you could fit it all in 2k.

  • Ben

I did find this after seeing some other threads here

http://www.obdev.at/products/avrusb/index.html

So it is basically a few diodes/resistors and less than 2k of code to get an atmega168 to communicate over USB without extra chips :slight_smile:

But, this would only be good for loading new scripts, once the script is running, I would expect the usb stuff needs to be shut down (takes significant resources to be usb), so it couldn't be used for script serial communication. And it would probably be a manual reset situation. Simplifying the hardware is worth something, but I don't know if it is worth complicating the load procedure or losing usb communication at script time.

Actually, USBTiny and AVR-USB use about 1400 bytes for the base functionality, so with some careful coding it just might be possible. Of course USBTiny currently wants a 12MHz clock only, which AVR-USB can run at the Arduino 16MHz frequency among others.

FWIW: Project Log : Arduino USB - ProjectLogArduinoUSB (Cache until it's back up)

--Phil.