TPI Programmer for ATtiny 4/5/9/10
Few ATtiny IC uses TPI for programming the FLASH. This project shows how to program with Atmel Studio or MPLAB X using USBASP or AVRISP MKII
The Atmel® Tiny Programming Interface (TPI) is featured on selected low-end Atmel AVR® microcontrollers, and allows external programmers to access the nonvolatile memory (NVM) of the device. The interface provides access to device lock bits, the program flash memory, and the signature, configuration, and calibration sections.
- RESET: TPI enable input
- TPICLK: TPI clock input
- TPIDATA: TPI data input/output
- ATtiny4
- ATtiny5
- ATtiny9
- ATtiny10
- ATtiny102
- ATtiny104
- ATtiny20
- ATtiny40
This is one of the easiest and straight forward method to develop and program the ATtiny chips. Just write the code in C or assembly and program using many tools which includes AVRISP MKII.
To use a machined 6 pin IC base, we also need to have round pins in the adapter. These round pins are useful for handling the ICs with a 6 pin IC base.
The above board uses 10 pin connector similar to USPasp programmer. Many pins are unused. The advantage is we can directly insert the IC and programmer connector into this board for programming. There is NO additional target POWER is required.
6 pin target connector:
Some other programmer uses 6 pin target connector for programming. Compared to 10 pin connector, 6 pin uses 5 of the pins for programming.
R5 and and D1 are just power indicator and placed under the IC base and not required for normal operation. R3 and PB2(LED) are connected to PB2 port pin. This is also optional.
There are few things worth noting in the above board.
We can insert any of the compatible USB connector breakout board having 4 or 5 pins with female header of 2.54mm pitch. In this case Type-C and Mini USB connectors are shown.
Pay attention while inserting the 10 pin to 6 pin converter into the board if the connector does not have a locking notch for proper orientation. The signal names are marked in the bottom of the board so that we can easily match the connections. We also need to set the jumper into the ISP side for proper operation.
Make sure the target IC orientation with the target adapter board pin 1 alignment.
Open the ATMEL STUDIO and write the blink LED program. Compile it. Select the programmer as AVRISP MKII. Provide the target power of 5V and GND. Now we can erase and program flash or lock bits etc.,
There are procedure to attach the USBasp as the default programmer and appears in the listed devices. But I have used the AVRDUDE along with AVRDUDESS for GUI based instead of command line typing of commands.
MPLAB X with USBasp:
The best option is using the 10 pin FRC connector with 10 pin connector which does not require any additional conversion, jumper or external power.
With Windows 10 and Windows 11 the USBasp may not be recognized properly. We can try THIS firmware with integrated WinUSB driver support which eliminates any third party drivers.
We can find the circuit, layout and firmware for USBasp from
Support for WinUSB to USBasp firmware added by mariusgreuel and can be found at HERE
Atmel studio and MPLAB X IDE can be downloaded from Microchip website.
TPI Programmer using Atmel Studio and AVRISP MKII can be seen HERE
NOTE: This TPI programmer supports only 5V and does not support the High Voltage programming mode. To disable the reset pin on an ATtiny microcontroller using the TPI programmer, you need to set the Reset Disable fuse (RSTDISBL). This fuse must be set to allow the chip to enter TPI programming mode. If this fuse is set, the chip requires a constant 12V applied to the reset pin to enter TPI mode. This can be done externally during the programming process, as the reset pin does not need to pulse. However, it is important to note that this requires a high voltage programmer to reset the fuse and reprogram the chip.

Discussion (0 comments)