USB On The ATtiny10

tiny10

Atmel’s ATtiny10 is their smallest microcontroller in terms of physical size – it’s an SOT-23-6 package, or about the same size as surface mount transistors. The hardware inside this extremely bare-bones; three I/O lines, 1kB of Flash, 32 bytes of RAM, and a reduced AVR core with 16 registers instead of 32. With such a minimal feature set, you would think the only thing this micro would be good for is blinking a LED. You’d be right, but [cpldcpu] can blink a LED with the ‘tiny10 over USB.

The V-USB interface usually requires about 1.5kB of Flash in its most minimal implementation, and uses 50 bytes of RAM. This just wouldn’t do for the ‘tiny10, and although [cpldcpu] is working on a smaller, interrupt-free V-USB, there were still some hurdles to overcome.

The biggest issue with putting code on the ‘tiny10 is its reduced AVR core – on the ‘big’ 32-register core, direct memory access is two words. On the ’10, it’s only one word. AVR-GCC doesn’t know this, and no one at Atmel seems to care. [cpldcpu] worked around this problem using defines, and further reduced the code size by completely gutting V-USB and putting it in the main loop.

It’s not much, but now [cpldcpu] can blink an LED with a ‘tiny10 over USB. If you’re wondering, 96.4% of the Flash and 93.8% of the SRAM was used for this project.

Comments

  1. notabena4us says:

    Cool, very cool… +1

  2. efahrenholz says:

    But why even produce a chip so crippled? Who is it targeted at?

  3. Jacques says:

    @cplcpu,
    congratulation! The kind of hack I like.

  4. cpldcpu says:

    Nice to see this here!

    I’d like to add that it does not just blink the LED. To the computer, the device looks like little-wire (http://www.littlewire.cc) and you can set the color of the WS2812 LED using the little-wire host software.

  5. krb686 says:

    Very cool project!

    As an aside, SOT-23-6 is smallest Atmel uC? ATtiny20-UUR disagrees.

    http://www.digikey.com/product-detail/en/ATTINY20-UUR/ATTINY20-UURDKR-ND/3775099

    < 2.2 mm^2

  6. SYNTRONIKS says:

    I’ve used these types of microcontrollers to make LFSR digital noise sources for prototyping/breadboarding circuits. It was actually easier than wiring up an analog circuit in terms of development time

  7. raimue says:

    Working with attiny10 is hard enough already without these memory issues. Although the AVR toolchain shipped with Atmel Studio can handle this target just fine, the support for the attiny10 architecture has not been merged into mainline gcc. Therefore, the avr-gcc packages in many Linux distributions do not support this microcontroller at all.

    The modified sources for the toolchain are available from Atmel as large tarballs, unfortunately not as separate patches for integration: http://distribute.atmel.no/tools/opensource/

Leave a 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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,339 other followers