Notes »

Programming the ATtiny10

Programming ATtiny10 with USBASP and avrdude

Notes on programming a small (SOT-23-6) and cheap (44-46 cents at qty 1) microcontroller, the Microchip ATtiny10 in a Linux environment using C and a USBASP programmer. The ATtiny series uses TPI (Tiny Programming Interface) instead of ISP (In System Programming) so I couldn't use my Adafruit ISP programmer.


These videos helped a lot: Connecting to the USBASP and Compiling and uploading

Compile with avr-gcc:

avr-gcc blink.c -mmcu=attiny10 -DF_CPU=1000000L -Os -o blink.bin

Upload with avrdude:

avrdude -c usbasp -p t10 -U flash:w:blink.bin

This code showed me how to enable the PWM.

Reference Links

Programming ATtiny10 with HVSP (High Voltage Serial Programming)

I've been working on a project that expanded to use all four pins of the ATtiny10. One of the pins is the reset (RST) pin which can only be used as a (weak) GPIO if you program using 12vdc. Here are my notes trying to figure that out.

Reference Links

hvsp adapter

The design partially works, I am able to enable the HV reset, the board outputs 12.2v, and I'm able to disable the RST pin by writing 0xFE to the fuse byte (by default it's 0xFF, the lsb is changed to 0 to disable reset, RSTDISBL)


I did this by using avrdude to read the fuse byte to a file, changed it with hexedit and then programmed the ATtiny10 with it, disabling the low enabled RST. The RSTDISBL file attached above is what I used with this command:

sudo avrdude -c usbasp -p t10 -U fuse:w:RSTDISBL

but when I flash the memory it fails to verify, every time, with different bytes not being read back correctly. So there must be some noise issue somewhere. I was afraid of this and even tried to route the data traces in such a way to keep them away from the boost IC and inductor.

edit SideBar

Page last modified on September 28, 2023, at 11:33 pm