atprogram command for ATtiny816 fuse bits

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

I am trying to program ATtiny816 using Atmel-ICE from command line

 

I can erase/write flash/lock bits using command line sucessfully : 

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz chiperase

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz program -f C:\MyProgram.hex

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz write -lb  --values 3A  --verify

 

but I have no idea how to write fuse bits, since there are 8 fuse registers :

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz write -fs --values ????  --verify

 

shall I write 8 byte consecutively ?

what is the order of 8 bytes ?

 

I appreciate replies

 

 

 

 

 

This topic has a solution.

Majid

Last Edited: Thu. Apr 26, 2018 - 06:55 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reference method of command help.

atprogram help write

 

This is how to designate the whole fuse. Specify 9 byte HEX with byte3 fixed to FFh.

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz write -fs --value 00e602ff00c5000000 -v

 

To write only byte2 (OSCCFG), specify the offset.

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz write -fs -o 2 --value 01 -v

 

Notice that the actual byte sequence does not match the device programming screen.

 

 

 

The fuse byte can be described in the program source and included in the ELF file.
Writing using the ELF file is simple and no doubt.

 

https://www.avrfreaks.net/forum/...

Last Edited: Thu. Apr 26, 2018 - 03:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you kabasan

 

your answer solves my problem. this works fine for my project :

atprogram -t atmelice -i UPDI -d ATtiny816 -cl 125KHz write -fs --values 00C402FF00F6070000  --verify

 

as you mentioned fuse address order is different from Atmel Studio 7 screen. (datasheet : "6.9.3 Fuse Summary - FUSE")

 

regards

Majid