Programming an ATTINY861 - Page 1
Forum section: electronics / projects

author: smbaker
author_rank: Regular Contributor
timestamp: September 16, 2018, 02:39:16 am
content: I have a project where I decided to use an ATTINY861. Unfortunately, I'm not sure I have the ability to program it. I should, but I don't.My ICSP programmer is a usbasp. I'm able to program other ATTINY ics, such as the ATTINY85 with it. However, the ATTINY861 always results in "avrdude: error: program enable: target doesn't answer. 1". I've checked, double-checked, and triple-checked connections. No luck.My high-voltage programmer is a TL866, the popular ebay eprom/microcontroller/everythingelse programmer. It has all sorts of devices in its database, except the ATTINY261/461/861. If I lie and tell the TL866 software that I have a ATTINY26, it can read the device id from the microcontroller, and reports the expected id. However, it can't program it because the device id doesn't match.Any thoughts on a way around this? I've considered trying to hack the TL866 software's device database to change the id for ATTINY26 to ATTINY861 and see if I can coerce it into working, at least far enough to check whether the fuses are programmed correctly.The microcontrollers I'm trying to program are brand new, from digikey.Thanks,Scott

author: DaJMasta
author_rank: Super Contributor
timestamp: September 16, 2018, 05:00:47 am
content: Haven't looked into this device specifically, but there are a number of ATTiny line chips introduced since Microchip bought Atmel that do not use the same core architecture and while they are compatible with AVRDude, they use a single programming pin and are not compatible on most of the programmers I've seen.I've heard there's an arduino sketch that will let you use one as a programmer for these devices, and there are a couple of more recent programmers available from Microchip that can do the job as well. I imagine the task isn't particularly difficult, so it may be a matter of updating your programmer's firmware.

author: smbaker
author_rank: Regular Contributor
timestamp: September 16, 2018, 05:47:39 am
content: After some work, I managed to figure it out:1) There's a minipro for Linux, it's available on github, and I was able to easily add ATTINY861 to it. This allowed me to verify the fuse settings on chip were correct. It would have sufficed for programming the chip as well.2) The issue with ICSP was the bit rate. The ATTINY861 by default has CLKDIV8 which divides the clock by 8. avrdude's default settings are too fast to program the chip in that circumstance. The ATTINY85 chips I had been using ICSP with already had CLKDIV8 disabled. Adding "-B 3" to avrdude's options slowed down the programming bit rate and was sufficient to ICSP program the chip!Scott

author: Buriedcode
author_rank: Super Contributor
timestamp: September 16, 2018, 11:05:52 am
content: It has been a while since I worked with the Attiny series but I believe that those with an internal 8MHz osc have the CLKDIV8 fuse set by default, to give all a 1Mhz internal clock. So the first time one programs them, the programmer should run at a slower speed. I vaguely remember this being the case with all the AVR's I've used. Whilst I'm sure newer ones don't have this, it just meant that I dropped the programmers SCLK down for flashing "virgin" devices.Note its also handy to have a clock source with your programmer in-case one accidentally configures the fuses for external clock. I made my own USBasp with configurable target power, and buffered 4MHz clock out for this task and it hasn't failed me.