ATtiny10

(As of 2021-10-15)

ATtiny10, TPI programming and  What worked for me..

First thanks to the links that may not have worked for me, but still pointed me in the direction of now being able to program the ATtiny10 successfully.

https://irq5.io/2010/07/15/programming-the-attiny10/

https://irq5.io/2017/09/09/writing-code-for-the-attiny10/

http://www.technoblogy.com/show?1YQY

Tools Used in my attempts:

Attempt 1:

Tried to use UsbASP after firmware update, without success. I tried every library (three to select from) in Zadig-2.6. I tested using avrdude command line and in Arduino IDE (with its use of avrdude). It would worked for ATtiny13a, ATtiny85, ATtiny202, ATtiny806, and 1604 just great. Both command line and Arduino IDE.  I was close. When I asked it to read, it would show it had 1k of mem but then no luck. When I tried to send it a hex file I would get the dreaded:

avrdude: error: program enable: target doesn't answer.avrdude: initialization failed, rc=-1         Double check connections and try again, or use -F to override         this check.
avrdude done.  Thank you.

I first tried bread board, but one of the things that can cause above error is a crappy connection. 

So I spent about 5 minutes and soldered one together.


It failed to program the little ATtiny10...

Attempt 2:

I while reading up more after the first failures,  I ran across darell tan 's article ( https://irq5.io/2010/07/15/programming-the-attiny10/ ) on programming the Attiny10 with an FTDI.. No problem, I've got a few of those.. But as I read through it looked like seeing if avrdude.conf was set up for it since there had been a few versions since. So I did a find for TPI in avrdude.conf and BINGO.. Found this section:

# USBtiny can also be used for TPI programming.# In that case, a resistor of 1 kOhm is needed between MISO and MOSI# pins of the connector, and MISO (pin 1 of the 6-pin connector)# connects to TPIDATA.programmer  id    = "usbtiny";  desc  = "USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp";  type  = "usbtiny";  connection_type = usb;  usbvid     = 0x1781;  usbpid     = 0x0c9f;;

Cool!!, so I grabbed the breadboard, wired up with Mosi having a 1k resister to Miso and Miso going to Pin 1 of Attiny10.  Like this:

Hooked up the UsbTiny up and fired up avrdude:

avrdude  -v -pt10 -cusbtiny -b 9600avrdude: Version 6.3-20201216         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is "C:\Users\me\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino18\etc\avrdude.conf"
         Using Port                    : usb         Using Programmer              : usbtiny         Overriding Baud Rate          : 9600avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f         AVR Part                      : ATtiny10         Chip Erase delay              : 0 us         PAGEL                         : P00         BS2                           : P00         RESET disposition             : dedicated         RETRY pulse                   : SCK         serial program mode           : yes         parallel program mode         : yes         Timeout                       : 0         StabDelay                     : 0         CmdexeDelay                   : 0         SyncLoops                     : 0         ByteDelay                     : 0         PollIndex                     : 0         PollValue                     : 0x00         Memory Detail                 :
                                  Block Poll               Page                       Polled           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------           signature      0     0     0    0 no          3   16      0     0     0 0x00 0x00           fuse           0     0     4    0 no          1   16      0     0     0 0x00 0x00           calibration    0     0     0    0 no          1   16      0     0     0 0x00 0x00           lockbits       0     0     0    0 no          1   16      0     0     0 0x00 0x00           flash          0     0   128    0 no       1024   16      0     0     0 0x00 0x00
         Programmer Type : USBtiny         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyispavrdude: programmer operation not supported
avrdude: Using SCK period of 10 usecavrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9003 (probably t10)
avrdude done.  Thank you.

Looking Better!!

So then I tried loading a hex file (the blink one from http://www.technoblogy.com/show?1YQY )

and I got this:

avrdude -CC:\Users\me\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -pattiny10 -cusbtiny -Pusb -Uflash:w:blink.hex:i
avrdude: Version 6.3-20201216         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is "C:\Users\me\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"
         Using Port                    : usb         Using Programmer              : usbtinyavrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f         AVR Part                      : ATtiny10         Chip Erase delay              : 0 us         PAGEL                         : P00         BS2                           : P00         RESET disposition             : dedicated         RETRY pulse                   : SCK         serial program mode           : yes         parallel program mode         : yes         Timeout                       : 0         StabDelay                     : 0         CmdexeDelay                   : 0         SyncLoops                     : 0         ByteDelay                     : 0         PollIndex                     : 0         PollValue                     : 0x00         Memory Detail                 :
                                  Block Poll               Page                       Polled           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------           signature      0     0     0    0 no          3   16      0     0     0 0x00 0x00           fuse           0     0     4    0 no          1   16      0     0     0 0x00 0x00           calibration    0     0     0    0 no          1   16      0     0     0 0x00 0x00           lockbits       0     0     0    0 no          1   16      0     0     0 0x00 0x00           flash          0     0   128    0 no       1024   16      0     0     0 0x00 0x00
         Programmer Type : USBtiny         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyispavrdude: programmer operation not supported
avrdude: Using SCK period of 10 usecavrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9003 (probably t10)avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed         To disable this feature, specify the -D option.avrdude: erasing chipavrdude: reading input file "blink.hex"avrdude: writing flash (72 bytes):
Writing | ################################################## | 100% 0.41s
avrdude: 72 bytes of flash writtenavrdude: verifying flash memory against blink.hex:avrdude: load data flash data from input file blink.hex:avrdude: input file blink.hex contains 72 bytesavrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.29s
avrdude: verifying ...avrdude: 72 bytes of flash verified
avrdude done.  Thank you.

Oh yes.. But no blinking light yet. I powered down and powered it back up and ...

20211016_125533.mp4

GOT BLINKING!! (note this little vid is after a made a more permanent board for programming)

So now I have it running and wondered it I could use Arduino IDE. The best board support I found for it was at:  https://github.com/technoblogy/attiny10core

Just use C and you will be fine. But since I'm using the usbtiny to program, I compile then go to command line and load the hex from the temp dir.


Update (Just a few moments later):

I managed to add USPTiny programmer to Arduino IDE in both old and new Beta.

I just located the programmers.txt file ( had it in two locations since I have a separate install for Beta 2.0.0-Beta.12) inside the AppData\Local\Arduino15\packages\ATtiny10Core\hardware\avr\2.1.0 dir. I then added:


usbtinyisp.name=USBtinyISPusbtinyisp.protocol=usbtinyusbtinyisp.program.tool=avrdudeusbtinyisp.program.extra_params=

Then I saved it then opened up the IDE and I had the programmer now in the IDE. 

Now I can write the code and upload in the Arduino IDE. Still using C  :)


UPDATE  5/12/2023:

Compile in Microsoft studio with -Og  to get smallest file possible. Per:  

https://www.avrfreaks.net/s/topic/a5C3l000000UkCKEA0/t190668  (some more of my learning experience with Microchip Studio and ATtiny10)


Hope this little experience helps some one on what to do or not to do with the Attiny10 ..


Enjoy

Sherm