Need help using the ATTiny841 with avrdude

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made a circuit using the new ATTiny841 and now I need to get avrdude to recognize it. I find myself lost tying to edit avrdude.conf to add the 841. Has anyone written a avrdude config file for the ATTiny841? Thanks. Jay.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you downloaded the recent build of avrdude 6.0.1? I'd be very surprised if it didn't have details for all recent AVRs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Have you downloaded the recent build of avrdude 6.0.1? I'd be very surprised if it didn't have details for all recent AVRs.

Indeed...
http://nongnu.askapache.com/avrd...
...lists that model.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, there is no support for tiny841 in avrdude. You have to add it yourself or wait for someone else to do it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

No, there is no support for tiny841 in avrdude. You have to add it yourself or wait for someone else to do it.


Interesting. As the document I linked to gives that model as a parameter, I assumed there was support. Is this a case of ass-u-me?
Quote:

Chapter 2: Command Line Options 4
2 Command Line Options
2.1 Option Descriptions
AVRDUDE is a command line tool, used as follows:
avrdude -p partno
options
...
Command line options are used to control AVRDUDE’s behaviour. The following options
are recognized:
-p
partno
This is the only mandatory option and it tells AVRDUDE what type of part (MCU) that is connected to the programmer. The partno parameter is the part’s id listed in the configuration file. Specify -p ? to list all parts in the configuration file. If a part is unknown to AVRDUDE, it means that there is no config file entry for that part, but it can be added to the configuration file if you have the Atmel datasheet so that you can enter the programming specifications. Currently, the following MCU types are understood:
...
t45 ATtiny45
t461 ATtiny461
t5 ATtiny5
t84 ATtiny84
t85 ATtiny85
t861 ATtiny861
t88 ATtiny88
t9 ATtiny9
x128a1 ATxmega128A1
...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's about the new tiny841, not 861. I can't see the string "841" anywhere in that document.

It's a 14 pin tiny with 2*USART, 1 8-bit and 2 16 bit timers. One of the USART's with re-mapable pins. The PWM outputs can be selected from a couple of pins. Real SPI interface and slave TWI interface...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

It's about the new tiny841, not 861. I can't see the string "841" anywhere in that document.

Oh, my, indeed! I must have read past that a half dozen times today.
My CRS condition is getting worse and worse... :(

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
My CRS condition is getting worse and worse... :(

Don't feel bad about it, you are in very good company here. :)

Now what were we talking about? :wink:

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." - Marcus Aurelius               

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

snigelen wrote:
[T]here is no support for tiny841 in avrdude.
Further, AS 6.1 doesn't support it out of the box. Atmel Tech Support sent me a .vsix file to add support for the tiny441/841. Even then, however, there are no XML files to allow AVRISP mkII to program the tiny441/841 either from within AS 6.1 or using the command line utility atprogram.exe.

Moreover, the AVR Toolchain v3.4.2 says that it supports the tiny841 (not the tiny441, however) but there are no include files for them. The latest AVR Toolchain, v3.4.3, contains the include files and can target both the tiny441 and tiny841. I copied the include files to the include directory for AVR Toolchain v3.4.2 so now I'm able to compile for the tiny841.

I'm using a board previously designed for the tiny84 to try out the tiny841 (SOIC-14). Although the tiny84 and tiny841 are pin compatible (unless I've overlooked something) I haven't yet gotten the AVRISP mkII to read the signature of the tiny841. I created XML files for the tiny841 by copying/editing those for the tiny84 so it is possible that I missed something that needed changing.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey- I got avrdude to work with the ATTiny841. Add the following data to the avrdude.conf file.

#------------------------------------------------------------
# ATtiny841
#------------------------------------------------------------

part
id = "t841";
desc = "ATtiny841";
has_debugwire = yes;
flash_instr = 0xB4, 0x07, 0x17;
eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
0x99, 0xE1, 0xBB, 0xAC;
## no STK500 devcode in XML file, use the ATtiny45 one
stk500_devcode = 0x14;
## avr910_devcode = ?;
## Try the AT90S2313 devcode:
avr910_devcode = 0x20;
signature = 0x1e 0x93 0x15;
reset = io;
chip_erase_delay = 4500;

pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
"x x x x x x x x x x x x x x x x";

chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
"x x x x x x x x x x x x x x x x";

timeout = 200;
stabdelay = 100;
cmdexedelay = 25;
synchloops = 32;
bytedelay = 0;
pollindex = 3;
pollvalue = 0x53;
predelay = 1;
postdelay = 1;
pollmethod = 1;

hvsp_controlstack =
0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
hventerstabdelay = 100;
hvspcmdexedelay = 0;
synchcycles = 6;
latchcycles = 1;
togglevtg = 1;
poweroffdelay = 25;
resetdelayms = 0;
resetdelayus = 70;
hvleavestabdelay = 100;
resetdelay = 25;
chiperasepolltimeout = 40;
chiperasetime = 0;
programfusepolltimeout = 25;
programlockpolltimeout = 25;

ocdrev = 1;

memory "eeprom"
size = 512;
paged = no;
page_size = 4;
min_write_delay = 4000;
max_write_delay = 4500;
readback_p1 = 0xff;
readback_p2 = 0xff;
read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8",
"a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o";

write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8",
"a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i";

loadpage_lo = " 1 1 0 0 0 0 0 1",
" 0 0 0 0 0 0 0 0",
" 0 0 0 0 0 0 a1 a0",
" i i i i i i i i";

writepage = " 1 1 0 0 0 0 1 0",
" 0 0 x x x x x x",
" x a6 a5 a4 a3 a2 0 0",
" x x x x x x x x";

mode = 0x41;
delay = 6;
blocksize = 4;
readsize = 256;
;
memory "flash"
paged = yes;
size = 8192;
page_size = 16;
num_pages = 512;
min_write_delay = 4500;
max_write_delay = 4500;
readback_p1 = 0xff;
readback_p2 = 0xff;
read_lo = " 0 0 1 0 0 0 0 0",
" 0 0 0 0 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";

read_hi = " 0 0 1 0 1 0 0 0",
" 0 0 0 0 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";

loadpage_lo = " 0 1 0 0 0 0 0 0",
" 0 0 0 x x x x x",
" x x x a4 a3 a2 a1 a0",
" i i i i i i i i";

loadpage_hi = " 0 1 0 0 1 0 0 0",
" 0 0 0 x x x x x",
" x x x a4 a3 a2 a1 a0",
" i i i i i i i i";

writepage = " 0 1 0 0 1 1 0 0",
" 0 0 0 0 a11 a10 a9 a8",
" a7 a6 a5 x x x x x",
" x x x x x x x x";

mode = 0x41;
delay = 6;
blocksize = 32;
readsize = 256;
;
# ATtiny841 has Signature Bytes: 0x1E 0x93 0x15.
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;

memory "lock"
size = 1;
write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
"x x x x x x x x x x x x x x i i";
read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
"0 0 0 0 0 0 0 0 o o o o o o o o";
min_write_delay = 9000;
max_write_delay = 9000;
;

memory "lfuse"
size = 1;
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
"x x x x x x x x i i i i i i i i";

read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x o o o o o o o o";
min_write_delay = 9000;
max_write_delay = 9000;
;

memory "hfuse"
size = 1;
write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
"x x x x x x x x i i i i i i i i";

read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x o o o o o o o o";
min_write_delay = 9000;
max_write_delay = 9000;
;

memory "efuse"
size = 1;
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
"x x x x x x x x x x x x x x x i";

read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x o o o o o o o o";
min_write_delay = 9000;
max_write_delay = 9000;
;

memory "calibration"
size = 1;
read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
"0 0 0 0 0 0 0 a0 o o o o o o o o";
;
;

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Add the following data to the avrdude.conf file

Why would you do that and not simply download and use the later version that already has 841 support?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Why would you do that and not simply download and use the later version that already has 841 support?

Note that I was corrected above about that support -- not.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Imagecraft issued a new set of h files supporting the new tinys in case someone wants to compile a c program for them.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi to JayHVSTech who provided the config file above for the ATTiny841;

I tried appending your config code to the end of the config file, but got an error when re-running the CMD prompt command to list ICs
C:\>avrdude -c avrisp

The error was:
C:\Apps\WINAVR-20100110\bin\avrdude.config:15536 unrecognized character: "o"

I don't recognize any obvious errors in the config code you provided. Any suggestions?
Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All that you have to do is inspect line #15536

I suspect you have done a typo or copy/paste error.

Looking at JayHVSTech's post in Courier font, it all looks quite kosher.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bigblueskywater wrote:
C:\Apps\WINAVR-20100110\bin\avrdude.config:15536 unrecognized character: "o"
I suspect that you're using a version of avrdude that is too old, i.e. it doesn't support all of the features of the .conf file. I can get the same error if I copy the avrdude.conf file that I'm using with avrdude v6.1 to the bin directory of the 20100110 installation which contains avrdude v5.10.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dkinzer wrote:
Moreover, the AVR Toolchain v3.4.2 says that it supports the tiny841 (not the tiny441, however) but there are no include files for them.

Perhaps fixed in a later build of 3.4.2? My 3.4.2 downloaded a few days ago does have an iotn841.h ?

Quote:
I'm using a board previously designed for the tiny84 to try out the tiny841 (SOIC-14). Although the tiny84 and tiny841 are pin compatible (unless I've overlooked something) I haven't yet gotten the AVRISP mkII to read the signature of the tiny841.

They're pin compatible as far as ISP goes. I was able to program my own breakout board using avrdude 6.0.1 (with above conf lines) and my AVR Dragon.

It should work - bot-thoughts.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have also tested the config entry above with avrdude 6 and it seems to work fine. To use it with avrdude 5.11.1 I had to remove (or comment out) the line

    ocdrev              = 1;

then it worked to flash a small program on a tiny841 (using an usbasp).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that the above avrdude.conf file doesn't work when trying to set the fuses (the tiny84 only used a single bit in the extended fuse, while the tiny841 uses all eight bits).

Change the existing lines:

 memory "efuse" 
 size = 1; 
 write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", 
 "x x x x x x x x x x x x x x x i"; 

to this

 memory "efuse" 
 size = 1; 
 write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", 
 "x x x x x x x x i i i i i i i i"; 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And if anyone wants to use the tiny841 with the "eXtreme Burner" program instead of avrdude, just add the following lines to your "chips.xml" file in the extreme burner\data\ directory:

  
    ATtiny841
    8192
    512
    0x0015931E
    16
    YES
    YES
    YES
    YES
    YES
    .\Images\Placements\ZIF_DIP_40.bmp
  
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ATTiny441/841 have flash with 8 words page size. So conf should be slightly changed under <memory "flash">:

 

loadpage_lo = " 0 1 0 0 0 0 0 0",
" 0 0 0 x x x x x",
" x x x x x a2 a1 a0",
" i i i i i i i i";

loadpage_hi = " 0 1 0 0 1 0 0 0",
" 0 0 0 x x x x x",
" x x x x x a2 a1 a0",
" i i i i i i i i";

writepage = " 0 1 0 0 1 1 0 0",
" 0 0 0 0 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 x x x",
" x x x x x x x x";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I must renew post.

Has any one conf file for DUDES for ATtiny441

 

It the same family processor .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you (or anyone else) are still interested, here is config for 841 and 441. Go to .avrduderc and paste content to avrdude.conf. Worked for me on mac 10.6.8 

 

https://github.com/adam-dej/avr-toolchain-patches

 

Cheers,

Gary