Fun with ATtiny and V-USB

Sometime you have to do build just for the fun of it.

Recently, while I was about to order a set of PCBs from my favorite website, I told a friend about a really funny project based on the V-USB stack with ATtiny devices, and he was impressed by the size of the thing… So I decided to design my own ATtiny V-USB board!

This project is a really small USB gadget without any specific I/O, and it’s designed to fit into a USB connector with the exposed PCB as small as possible.

The original idea for this board was to use it for April-fool like jokes, but the project also uses a couple of interesting features of the V-USB stack.

Hardware

To build such a small board, you have to use as few components as possible.

The microcontroller works at 3.3V, so that it does not need clamping diodes. It still needs two series .7V drop diodes to get the ~3.3V from the 5V input. In the PCB I placed two SMD diodes footprint, but later I modified the design to use a BAT54S I had laying around.

The microcontroller footprint can fit an ATtiny45 or any other SOIC8 AVR. As the board is really small, there is no programming connector. That means that the microcontroller have to be programmer offline or you have to solder a temporary connector to it.

For this reason, there is a solder-jumper on the PB3 pin, which was provided to activate an internal bootloader, such as a modified version of the AVRUSBBoot. Unfortunately, I only had some ATtiny25 available, so I never used the bootloader option as my microcontrollers barely have the memory for a simple USB application.

The USB contact pads are the one designed by SparkFun, and provided on their free library. It works great but the 1.6mm PCB is a little to thin, so you have to add a small spacer on the bottom of theboard.

Software

The microcontroller runs at 16.5MHz, without any external oscillator. This means that the fuse have to be modified to the one indicated in the Makefile and that firmware have to implement the oscillator calibration function as demonstrated in the EasyLogger firmware.

The firmware I had in mind at the time was something similar to the “Haunted Cable’s” one, but here I’ll just provide an hid-mouse example firmware version, modified to run on the ATtiny25 without external oscillators.

Other Ideas

Recently I used this board with a vendor-specific class USB firmware to add a tiny light sensor to one of my home systems… I think that’s a good platform for simple single-sensor-boards. Keep an eye for future posts about it!

The PCB and example firmware source files are available on GitHub.


The schematics in PDF version can be downloaded from here.

Have fun!

Advertisement

10 Responses to Fun with ATtiny and V-USB

  1. David says:

    Hi,

    I was trying to grab a few of those tiny PCBs but unfortunately the file format you provided is not accepted at BatchPCB. Do you know where I can find those PCBs?

    Thanks,
    David

    • Hi David,

      you have to generate the gerber files from the eagle pcb using the CAM function.

      BatchPCB website should have some tutorial in the website or their support forum… they also used to have a custom .cam file just for eagle.

  2. Pingback: Linux kernel device drivers for AVR V-USB devices « fabiobaltieri

  3. This is really a good project …for a fun!

  4. Shay says:

    You could throw micronucleus on this to make it updatable via USB, without any need for an external ISP connector!

  5. dan3008 says:

    Very nice :)
    Working with your schematics, and this (http://www.instructables.com/id/VUSBTiny-AVR-SPI-Programmer/) I’m working on making the worlds smallest USB attiny programmer (for 8pin variants)

    Thanks for pointing me in the right direction :)

    • You’re welcome!

      If you take some measurement on the USB port and go for QFN/MLF package you can go really tiny… good luck with it! :-)

  6. Dan says:

    What is the function of firmware-keyboard, firmware-sensor, etc.? This projects according to hardware scheme have no buttons, no inputs… How it works, what it does? In my Windows 10, in my USB does not do anything. What does BL SMD jumper? Thanks. (Note: Other projects ATtiny and USB are functional)

    • Hey Dan, these are various firmware that I experimented with on that board, usually by just soldering sensors and other stuff to the pins directly. I like to keep that code as reference just in case but I never documented those properly. :-)

Leave a Reply to Shay Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: