Enable SMC Self-Programming
Self-programming requires extra steps to set the self-programming enable fuse bit on the ATTINY861. This only ever needs to be done once and hopefully all X16s shipped after today will come with the self-programming bit set and these instructions will not be needed.
Things that you will need:
- A working copy of avrdude
- The avrdude config file for ATTiny controllers
- A programmer such as USBTinyISP or Arduino-as-ISP
1. AVRDUDE
If you have Arduino IDE installed, you probably already have avrdude. In my installation (Windows) it is located at
%LOCALAPPDATA%\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17\bin\avrdude.exe.
Arduino IDE requires Java. If installing Java is not an option, the avrdude executable by itself can be downloaded from its GitHub release page:
https://github.com/avrdudes/avrdude/releases/tag/v7.1
2. Config File
The avrdude config file for the ATTiny861 can be found bundled with the ATTinyCore plugin for Arduino IDE which similarly can be found on GitHub at
https://github.com/SpenceKonde/ATTinyCore/. If using the standalone avrdude, the config file can be cherry-picked from its GitHub project here:
https://github.com/SpenceKonde/ATTinyCo ... rdude.conf
3. Programmer
Updating the fuse bits does not seem to work reliably using the TL866II+, a device that seems to reliably update everything else, including the non-fuse bits of the ATTiny. I used a USBTinyISP which costs about US$8 on Amazon or US$5 + US$3 shipping from sellers on eBay. Connect the USBTinyISP to a USB port on a desktop Linux, Mac, or Windows machine then connect the 10-pin IDC cable from the USBTinyISP to the "I2C" header on the X16 dev board.
Programming
You are now ready to run avrdude and set the fuse bits. The exact steps to do this vary depending on your ISP programmer.
In Windows, use this command to program the configuration (you may need to change the path to
avrdude.exe and
avrdude.conf if you are using a stand-alone avrdude installation):
Code: Select all
%LOCALAPPDATA%\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17\bin\avrdude.exe -C%LOCALAPPDATA%\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf -v -pattiny861 -cusbtiny -B8 -Ulfuse:w:0xF1:m -Uhfuse:w:0xD4:m -Uefuse:w:0xFE:m
If you have successfully programmed the ATTiny, and you used the
-v option in your command line, you should see this informational output at the end of execution:
Code: Select all
avrdude: safemode: lfuse reads as F1
avrdude: safemode: hfuse reads as D4
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:FE, H:D4, L:F1)
avrdude done. Thank you.
If
efuse comes back as
1, something went wrong. Try programming the device again. Self-programming is only enabled if
efuse reads as 0.
Need help?
If you need help, please post in the X16 Hardware Forum
viewforum.php?f=11. Do not reply to this thread.