├── TestSketch.ino ├── burn_attiny85_bootloader.bat ├── README.md └── t85_default.hex /TestSketch.ino: -------------------------------------------------------------------------------- 1 | bool high = false; 2 | void setup(){ 3 | pinMode(1, OUTPUT); 4 | } 5 | 6 | void loop(){ 7 | high = !high; 8 | digitalWrite(1, high); 9 | delay(1000); 10 | } -------------------------------------------------------------------------------- /burn_attiny85_bootloader.bat: -------------------------------------------------------------------------------- 1 | "%~dp0\hardware\tools\avr/bin/avrdude" -C"%~dp0\hardware\tools\avr/etc/avrdude.conf" -v -pattiny85 -cstk500v1 -PCOM22 -b19200 -Uflash:w:"%~dp0\t85_default.hex":i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m 2 | @pause -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Attiny85-Bootloader-Tutorial 2 | I recently got one of those cheap chinese attiny USB socket boards and discovered that in order to use the arduino IDE, you need to burn a bootloader onto it. I found a few tutorials online, but a lot of them felt incomplete or included redundant steps. 3 | 4 | Video: 5 | 6 | [![View the making of here](https://img.youtube.com/vi/axagDO8AKSI/0.jpg)](https://www.youtube.com/watch?v=axagDO8AKSI) 7 | 8 | Here's how to burn a bootloader to an Attiny85 using an Arduino UNO: 9 | 10 | 1. Install the Arduino IDE https://www.arduino.cc/en/Main/Software 11 | 2. Install the digistump drivers https://github.com/digistump/DigistumpArduino/releases 12 | 3. Open the arduino IDE and go to file > preferences. 13 | 4. Add http://digistump.com/package_digistump_index.json to the additional boards manager URLs. 14 | 5. Go to tools > board > boards manager. 15 | 6. Search for digistump, and install Digistump AVR boards. 16 | 7. Connect your arduino uno via USB. 17 | 8. Go to file > examples > 11. ArduinoISP > ArduinoISP to open the ArduinoISP sketch. 18 | 9. Hit the arrow button to upload it to your arduino. 19 | 10. Unplug your arduino and get your Attiny85, breadboard, some wires, and a 10uF capacitor. 20 | 11. Wire the following: 21 | 22 | | Attiny physical pin | Arduino GPIO/Pin | 23 | | --- | --- | 24 | | 1 | 10 | 25 | | 4 | GND | 26 | | 5 | 11 | 27 | | 6 | 12 | 28 | | 7 | 13 | 29 | | 8 | 5V | 30 | 31 | Also connect a 10uF capacitor between arduino RST and arduino GND. If using an electrolytic capacitor, put anode on RST and cathode on GND. 32 | 33 | 12. Connect your arduino again via USB and go into the Arduino IDE. Check what port it's connected to. In my case it's COM3. 34 | 13. Edit the burn_attiny85_bootloader.bat file from this repository (right click and edit). Edit the part that says -PCOM22 to match your port. In my case since I use COM3, I'll edit it to -PCOM3 35 | 14. Save and copy both the bat file and t85_default.hex to your arduino install directory. 36 | 15. Run the bat file, and it should now burn the bootloader to your attiny85. 37 | 38 | # Uploading via arduino 39 | After adding the bootloader, you can now upload via arduino. There's a testsketch in this repo if you just want to blink the debug LED. 40 | 41 | 1. Write your sketch as usual. 42 | 2. Connect your attiny to your USB socket board. But don't plug it to the computer yet. 43 | 3. In the arduino IDE, pick Digispark (Default - 16.5mhz). Port doesn't matter. 44 | 4. Hit upload sketch. 45 | 5. After compiling, the IDE will ask you to plug your attiny in. Do that, and the sketch will upload. 46 | 47 | 48 | Credits & sources: 49 | https://www.youtube.com/watch?v=FI3s4d2I1eQ 50 | https://create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829 51 | https://digistump.com/board/index.php?topic=1841.0 52 | -------------------------------------------------------------------------------- /t85_default.hex: -------------------------------------------------------------------------------- 1 | :1019800017C0197A4005930B09021200010100806B 2 | :101990003209040000000000000012011001FF00E5 3 | :1019A0000008D016530703020000000104030904D5 4 | :1019B00011241FBECFE5D2E0CDBFDEBF20E0A0E600 5 | :1019C000B0E001C01D92AC38B207E1F7BFC1A82F4B 6 | :1019D000B92F80E090E041E050EA609530E009C026 7 | :1019E0002D9182279795879510F084279527305E53 8 | :1019F000C8F36F5FA8F30895EADF8D939D93089570 9 | :101A0000CF93CFB7CF93C395B39BE9F7B39B0BC0ED 10 | :101A1000B39B09C0B39B07C0B39B05C0B39B03C076 11 | :101A2000B39B01C0D9C00F92DF93C0916E00DD2738 12 | :101A3000CA58DF4F012EB39B03C0DF910F90E6CF52 13 | :101A40002F930F931F934F932FEF4F6F06B303FB0B 14 | :101A500020F95F933F9350E03BE065C016B3012649 15 | :101A6000502953FDC89556B3012703FB25F92F7361 16 | :101A700006B3B1F05027102713FB26F906B2223027 17 | :101A8000F0F000C016B3012703FB27F90126502907 18 | :101A900006B22430E8F54F77206816B30000F6CF81 19 | :101AA00050274F7D206206B2102F000000C006B301 20 | :101AB00000265029102713FB26F906B2E2CF4F7BF0 21 | :101AC00006B3206400C0DACF01265029187106B28F 22 | :101AD00069F14E7F2160012F16B328C000265029DE 23 | :101AE0004D7F06B22260102F29C0012650294B7F5E 24 | :101AF00006B22460012F2DC016B301265029477F5E 25 | :101B00002860000006B22EC04F7E06B3206130C0B0 26 | :101B1000422706B3499300265029102706B24FEFFB 27 | :101B200013FB20F9297F16B379F2187159F10126B8 28 | :101B3000502906B2012703FB21F9237F06B371F276 29 | :101B4000002650293150D0F006B2102713FB22F99D 30 | :101B5000277E16B351F201265029012703FB06B256 31 | :101B600023F92F7C49F2000006B3102713FB24F958 32 | :101B70000026502906B22F7939F270CF10E21ABF31 33 | :101B800000271DC03B503195C31BD04010E21ABF47 34 | :101B90000881033C29F10B3419F120916C00198163 35 | :101BA000110F1213EDCF093651F10D3211F0013E34 36 | :101BB00039F7CAE01AB715FD02C0CA95D9F70093E4 37 | :101BC00074003F915F914F911F910F912F91DF9181 38 | :101BD0000F90CAB7C5FD17CFCF91CFBFCF91089552 39 | :101BE00020917400222369F3109172001123F1F403 40 | :101BF0003430F2F03093720020936D0019C00091E0 41 | :101C0000720001309CF40AE530916F0034FD11C080 42 | :101C100000936F00C1E6D0E010C0052710E000C0BF 43 | :101C200021C0052710E0C89508BB14C03AE501C0E3 44 | :101C300032ED032EC0E0D0E032E017B31861C39A52 45 | :101C400008B317BB58E120E84FEF20FF052708BB7A 46 | :101C5000279517951C3F28F700004552B0F720FF45 47 | :101C60000527279508BB17951C3FB8F629913A958B 48 | :101C700061F7077E10917300110F08BBC250D0406E 49 | :101C800011F010936C0010E21ABF086017B3177EB2 50 | :101C9000402F477E54E05A95F1F708BB17BB48BB6D 51 | :101CA00090CF2FEFB0E8A0E04AE0B1BF000081EE96 52 | :101CB0009CE0B399FECFB39BFECF0197B399FDCFC4 53 | :101CC00097FF03C0BA1B819501C0BA0FA69539F4DE 54 | :101CD000A0E428F4281710F031B7282FA1E04150D4 55 | :101CE00021F731BF00000895F201309741F02AE753 56 | :101CF000421629E1520629F481B790E002C08FEB29 57 | :101D00009CEC21E00C0120935700E8951124CF01B1 58 | :101D100002962C01089514BE88E181BD87E081BD43 59 | :101D2000BB9A2FE28BE19FE0215080409040E1F789 60 | :101D300000C00000BB988AE580936F008FEF80930E 61 | :101D40006000AC9A8BB780628BBF0895EAE7F9E137 62 | :101D5000E491EF3F11F0E1BF0000DDDF712C312C89 63 | :101D6000412C512CCCE7D5E114E686B3887109F0FB 64 | :101D700014E6115029F41092730010926C0091DF58 65 | :101D80000AB605FE05C03CDE80E28ABF712C04C0A5 66 | :101D9000219759F7C0E0D0E0A89522E032120CC09C 67 | :101DA000E0E8F9E1E054F10983E080935700E89519 68 | :101DB0003097C1F7412C512C832D803459F4F20116 69 | :101DC0003297E03889E1F80750F485E080935700B6 70 | :101DD000E89505C0843019F4CD2B11F4EAC0312CFC 71 | :101DE00080917200835087FD99C090916D009D3263 72 | :101DF00009F092C0883009F08FC083EC80936100B5 73 | :101E00008AE580936F0080917700807690917800CA 74 | :101E1000882379F1911108C082E899E190937100CB 75 | :101E20008093700086E06DC0913069F441145104D4 76 | :101E3000F1F080917B00807C482E50907C0081E105 77 | :101E400087BFE89514C0933081F480917900909118 78 | :101E50007A004ADF80917B0090917C0045DF842DE1 79 | :101E60008F7329F490E4392E4CC09F73392E80E093 80 | :101E700048C08091790010926A00911106C01092BA 81 | :101E80006B002AE630E082E038C0953019F4809388 82 | :101E9000730025C09630E9F490917A00913019F4DE 83 | :101EA0008AE999E104C0923041F488E899E190937D 84 | :101EB00071008093700082E124C09330C1F68111DB 85 | :101EC000D6CF8CEA99E1909371008093700084E002 86 | :101ED00018C0983079F0993031F4809375002AE673 87 | :101EE00030E080E00AC081E09A3009F080E02AE624 88 | :101EF00030E003C025E730E081E0309371002093AB 89 | :101F0000700090917E00911105C090917D0098170E 90 | :101F100008F4892F809360001092720080916F0006 91 | :101F200084FF31C0809160008F3F69F1C82F8930F4 92 | :101F300008F0C8E08C1B809360009091610088E8F5 93 | :101F4000892780936100CC2391F080917000A2E6F4 94 | :101F5000B0E0E82FF091710094919D9331969C2F01 95 | :101F6000980F9E13F9CFF0937100E09370006C2FDF 96 | :101F700082E690E041DDCC5FCC3019F08FEF8093AA 97 | :101F80006000C0936F00C30101963C01803B944008 98 | :101F900029F4EDE7F9E1E491EF3F59F40AB605FEC3 99 | :101FA000E1CE8DE1B39B8DE18150E1F780E28ABF04 100 | :0C1FB000D9CEB1DE1BBE15BAE1CCFFCFCC 101 | :040000030000198060 102 | :00000001FF 103 | --------------------------------------------------------------------------------