Ben Heck Can Program The Smallest Microcontroller

Microcontrollers are small, no one is arguing that. On a silicon wafer the size of a grain of rice, you can connect a GPS tracker to the Internet. Put that in a package, and you can put the Internet of Things into something the size of a postage stamp. There’s one microcontroller that’s smaller than all the others. It’s the ATtiny10, and its brethren the ATtiny4, 5, and 9. It comes in an SOT-23-6 package, a size that’s more often seen in packages for single transistors. It’s not very capable, but it is very small. It’s also very weird, with a programming scheme that’s not found in other chips from the Atmel/Microchip motherbrain. Now, finally, we have a great tutorial on using the ATtiny10, and it comes from none other than [Ben Heck].

The key difference between the ATtiny10 and other AVRs is that the tiny10 doesn’t use the standard AVR ISP protocol for programming. Instead of six pins for power, ground, MISO, MOSI, SCK, and RST, this is a high-voltage programming scheme that needs 12 Volts. The normal AVR programmer can do it, but you need to build an adapter. That’s exactly what [Ben] did, using a single-sided perf board, a lot of solder, and some headers. It looks like a lot, but there’s really not much to this programmer board. There’s a transistor and an optocoupler. The only thing that could make this programmer better is an SOT-23 ZIF socket. This would allow bare tiny10s to be programmed without first soldering them to a breakout board, but ZIF sockets are expensive to begin with, and the prices on SOT-23 sockets are absurd.

Programming the device was a matter of loading Atmel Studio and going through the usual AVR rigamarole, but Ben was eventually able to connect a light sensor to the tiny10 and have it output a value over serial. This was all done on a device with only 32 Bytes of RAM. That’s impressive, and one of the cool things about the smallest microcontroller you can buy.

56 thoughts on “Ben Heck Can Program The Smallest Microcontroller

  1. What is the typical case for these small uC’s? PWM a led (only 2 PWM channels so no RGB? Or some small control loops (it has an ADC and PWM)?

    BTW: PIC10f family is also available in sot23-6 package for quite some time..

    1. I don’t know what the killer app for these would be, but I could see using it to drive a stepper motor type automotive gauge from an analog input, a simple sequencer for timing a camera shutter, or some sort of smart nightlight.
      It could probably replace a 555 timer in a lot of applications and add some smarts.

        1. My understanding is a lot of micros have a master clear (MCLR) type input that basically doubles as a reset during operation and a way to hold the micro in programming mode. Now if the fuses/config words are not set to low voltage programming mode this pin is often multiplexed to work as an input and thus would require a high voltage pulse (often 12V) on it to put the chip back into programming mode. If the fuses are set for LV programming mode then this mclr pin is dedicated to allow the micro to hold in reset and thus cannot be used as a general purpose input. I could be wrong but it seems to work this way at least for PIC micros.

    1. You can set a fuse in the chip that redefines the reset pin for an additional I/O pin. If you set this fuse then the reset pin won’t reset the chip any more, but putting 12V on it will. So if you need the additional I/O pin, you have to use the high voltage programming mode.

  2. What, no love for the WLCSP?
    Something like the ATtiny20-UUR has more pins and is even smaller. Though at that point I’m pretty sure you’d be soldering with a needle or something.

    1. My guess is it is part advertising money and part that throwing together a video is often easier than doing a thorough write-up. I used to do full write-ups on my blog but I found hardly anyone would visit and I’d spend hours writing it up so it was hardly worth it. However, I can film, edit and upload a video in an hour and get much more traffic. Not trying to justify it as I personally also prefer reading writeups but that is just the way things are.

  3. AVRDude has had support for these for a while and a simple USBasp programmer can be used in-circuit if you can tolerate the gigantic-by-comparison ISP header. I have an ATTiny10 PWMing the heated grips on my motorcycle.

Leave a Reply to sjm4306 Cancel reply
