Notes on the ATTiny 841
Categories
Tags
Recent articles
Ubuntu 16.10 LXC host on ZFS Root, with EFI and Time Machine
How to connect any serial device to the internet
Working with the ATTiny841
Atmel released some new ATTinys in November 2013, essentially a refresh of the ATTiny 24/44/84. The new chips have quite a bit different, the highlights of which are (for me)
Hurdle 1: The pin names in the spec doesn't match the AVR includes
This wasn't a hurdle exactly, but took me a few minutes to figure out the error wasn't
mine. Some of the registers described in the specification are spelled differently
to the code in avr/iotn841.h
- for instance, it's
DDRB0
rather than DDB0
. If your code isn't compiling, check that include for the definitive #define
.
Hurdle 2: ArduinoISP and avrdude can't program
Note: it's; 2016 and I am still seeing lots of interest in this section. The avrdude.conf file listed here is way out of date. The latest version of avrdude should work with no changes.
Those are the good bits. The bad bits are that I can't program it with my existing
ISP rig, which is
based on the ArduinoISP and avrdude. I attempted to do so with the mods to /etc/avrdude.conf
listed
here
(and available for download here - append this to /etc/avrdude.conf
).
But no luck: the firmware would appear to write, but verification would always fail.
Atmel recommend
their own AVRISPmkii and Atmel Studio 6.1 for programming, so I ordered one.
Hurdle 3: Atmel Studio needs to upgrade the firmware on my AVRISp and that doesn't work either!
Reluctantly I fired up a Windows VM and installed Atmel Studio 6.1, along with the update for the GCC and studio available for download here. Starting Studio shows my AVRIspmkii detected, but the firmware (1.11) is too old and needs updating to 1.17.
This fails. And the procedure described by Atmel to recover fails too - the device will no longer communicate with Atmel Studio 6.1 at all. This is not uncommon apparently and I can still flash older versions of the firmware with Atmel Studio 4 and 5, just not 6. However I need the new firmware supplied with Atmel Studio 6 for the Attiny841! What to do?
Here was my solution.
- Copy the firmware files from
C:\Program Files\Atmel\Atmel Studio 6.1\tools\AVRISPmkII
toC:\Program Files\Atmel\AVR Studio 5.0\tools\AVRISPmkII
- Short the reset pins as described here to reset the device
- Upgrade the firmware using Atmel Studio 5.0. It will use the firmware you copied from Studio 6.1 in the first step
Finally I have firmware 1.17 on the device. More to follow.
PostScript - Feb 2013
Not much more to say other than these chips are a welcome improvement over the Attiny84. The I2C is working flawlessly, the USART makes debugging a lot easier, and programming with avrdude and the AVRISPmkII is quick and works - I splashed out on a Tag Connect cable and with that connector on my boards, I can now flash about 10 a minute.