OpenLoopEngineer

Engineering in all directions
  • Home
  • About
  • OpenLoopBlog
  • WhiteNoise
  • Home
  • About
  • OpenLoopBlog
  • WhiteNoise
IMG_3848.jpg

OpenLoopBlog

  • All
  • Hardware debug
  • Software Development
avrispmkII and ATtiny9.jpg

Finally able to program an Atmel Attiny9 using the TPI protocol from avrdude on Linux

Kevin Marr September 8, 2020

TL;DR

The Atmel Attiny 4/5/9/10 devices are programmed vi TPI interface which is not supported on standard ISP programmers by avrdude.

  • Device Programming Software:
    avrdude: Version 6.3-20171130
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2014 Joerg Wunsch

  • Device Programmer:
    AVRISP mkII (ATAVRISP2)
    Working Firmware as reported by avrdude:
    Programmer Model: AVRISP mkII
    Hardware Version: 1
    Firmware Version Master : 1.24

  • Command: Verify avrdude can access micro by checking the device signature
    sudo avrdude -p t9 -c avrispmkII -U signature:r:sig.txt
    …
    avrdude: Device signature = 0x1e9008 (probably t9)

  • Command: Program test file:
    sudo avrdude -p t9 -c avrispmkII -U flash:w:tpitest1.hex

Background

I had a few ATtiny9 six-pin micros lying around and had a project that that did not need a lot of horsepower and the part cost is $0.33 for quantity 1. These were lying around from a previous project that got derailed because I couldn’t get my generic ISP programmer to program via TPI. I say derailed because I started writing my own software to program the part using an FTDI232RL module. I got the project to the point that I could read and write via TPI, but moved on before I could parse Intel hex files.

Now I’m working on a project that needs a micro with 1 input, two outputs and two time delays. Perfect for an ATtiny9!

This time around, I stumbled onto the Ubuntu man page for avrdude and it it called out “ For ATtiny4/5/9/10 devices, the STK600 and AVRISP mkII are supported in TPI mode.”

Ref: http://manpages.ubuntu.com/manpages/bionic/man1/avrdude.1.html

I was able to purchase a new old stock AVRISP mkII (ATAVRISP2) on ebay for $49.95 plus shipping and sales tax.

Of course, the AVRSIP MKII couldn’t even read the device id. I kept getting the following errors:

avrdude: stk500v2_command(): error in CMD_XPROG_SETMODE: Unknownavrdude: stk600_xprog_program_enable(): CMD_XPROG_SETMODE(XPRG_MODE_TPI) failedavrdude: initialization failed, rc=-1avrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x802f28avrdude: Expected signature for ATtiny9 is 1E 90 08

Back to square 1.

I decided to test the programmer on windows with Atmel Studio. I downloaded an eval Windows 10 guest virtual machine file and imported it into virtualbox. Powered it up, downloaded and installed Atmel Studio and tried to read the signature from an ATtiny9. Atmel Studio popped a notification that the AVRISPmkII needed an update. Once updated, it worked in Atmel Studio in WIN10 and avrdude in Linux.

  • OpenLoopBlog
  • Older
  • Newer

Sidebar Title

Not sure what will go here yet...

*This sidebar is displayed on all blog pages. It will render on both the list and item views of each blog you create.


Podcast Links:

​Security Now

Techwise Conversations

The Amp Hour

Favorite Sites:

Hackaday.com

Thenewboston.org

​

Powered by Squarespace

OpenLoopEngineer

Engineering in all directions

Aimlessly wandering engineering