Advertisement
Strat0s

attiny bootloader tut

Jan 16th, 2018
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.16 KB | None | 0 0
  1. Burning bootloader [DISCLAIMER: If fuse is already burned, ATtiny can be programmed only with 12V programmer]
  2. 1. Awesome video tutorial: https://www.youtube.com/watch?v=FI3s4d2I1eQ
  3. 2. Go to: https://github.com/micronucleus/micronucleus to grab your self bootloader [we will move it to newfolder]
  4. 3. My own 100% working bootloader: https://uloz.to/!tksqJt9EcIo3/t85-100-working-hex [we will move it to new folder]
  5. 4. Use arduino UNO (others can be used to) as arduino ISP programmer.
  6. a. Load ArduinoISP program on arduino
  7. b. Upload program to arduino [in this case UNO]
  8. 5. Connect ATtiny85 with arduino
  9. Arduino +5V -> ATtiny VCC
  10. Arduino GND -> ATtiny GND
  11. Arduino Pin 10 -> ATtiny P5 [reset pin, If you already burned fuse, you have to use 12V programmer]
  12. Arduino Pin 11 -> Attiny P0
  13. Arduino Pin 12 -> ATtiny P1
  14. Arduino Pin 13 -> ATtiny P2
  15. 6. Tools -> Board -> ATtiny25/45/85 [depends on your ATtiny board]
  16. 7. Tools -> Processor -> Attiny85
  17. 8. Tools -> Clock -> Internal 16MHz
  18. 7. Tools -> Programmer -> Arduino as ISP
  19. 8. Open -> Basics -> Blink
  20. 9. Change every "LED_BUILTIN" to "1" [ATtiny board does not have built in led. Instead it is using pin1 for blink]
  21. 10. Click "Upload"
  22. 12. If your ATtiny85 starts to blink, you are good to go [if not, there is a mistake somewhere]
  23. 13. Find your Arduino folder [folder where Arduino IDE is installed]
  24. 14. My case: O:\Program Files (x86)\Arduino [in reality my case is: O:\Windows\Plocha\Arduino\arduino\hardware\tools\avr/bin/avrdude -CO:\Windows\Plocha\Arduino\arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cstk500v1 -PCOM7 -b19200 -Uflash:w:O:\Windows\Plocha\Arduino/t85_100%_working.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m]
  25. 15. Copy "Arduino" folder to your desktop [becuase we dont want any spaces in address]
  26. 16. Find in "Arduino" file called "averdude.exe" and copy its path -> C:\Desktop\Arduino\hardware\tools\avr\bin\averdude.exe [you might have different address]
  27. 17. Open CMD and type path to averdude: [change \avr\bin\averdude.exe to \avr/bin/averdude]
  28. C:\Desktop\Arduino\hardware\tools\avr/bin/averdude
  29. 18. Dont hit entre and continue typing: " " "-C""C:\Desktop\Arduino\hardware\tools\avr/etc/averdude.conf"
  30. C:\Desktop\Arduino\hardware\tools\avr/bin/averdude -CC:\Desktop\Arduino\hardware\tools\avr/bin/averdude.conf
  31. 19. Dont hit enter.We still need to add some other commands:" -v -pattiny85 -cstk500v1 -PCOM7 -b19200 -Uflash:w:C:\Desktop\Arduino/t85_100%_working.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m"
  32. C:\Desktop\Arduino\hardware\tools\avr/bin/averdude -CC:\Desktop\Arduino\hardware\tools\avr/bin/averdude.conf -v -pattiny85 -cstk500v1 -PCOM7 -b19200 -Uflash:w:C:\Desktop\Arduino/t85_100%_working.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
  33.  
  34. a. Change PCOM to port which arduino UNO is connected to
  35. b. Move your downloaded bootloader to "Arduino" folder
  36. c. Rename "t85_100%_working.hex" to name of your downloaded bootloader
  37. 20. Hit enter
  38. 21. If everything goes well, you should see this in CMD:
  39.  
  40. avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
  41. Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
  42. Copyright (c) 2007-2014 Joerg Wunsch
  43.  
  44. System wide configuration file is "O:\Windows\Plocha\Arduino\arduino\hardware\tools\avr/etc/avrdude.conf"
  45.  
  46. Using Port : COM7
  47. Using Programmer : stk500v1
  48. Overriding Baud Rate : 19200
  49. AVR Part : ATtiny85
  50. Chip Erase delay : 400000 us
  51. PAGEL : P00
  52. BS2 : P00
  53. RESET disposition : possible i/o
  54. RETRY pulse : SCK
  55. serial program mode : yes
  56. parallel program mode : yes
  57. Timeout : 200
  58. StabDelay : 100
  59. CmdexeDelay : 25
  60. SyncLoops : 32
  61. ByteDelay : 0
  62. PollIndex : 3
  63. PollValue : 0x53
  64. Memory Detail :
  65.  
  66. Block Poll Page Polled
  67. Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
  68. ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
  69. eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
  70. flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
  71. signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
  72. lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
  73. lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
  74. hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
  75. efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
  76. calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
  77.  
  78. Programmer Type : STK500
  79. Description : Atmel STK500 Version 1.x firmware
  80. Hardware Version: 2
  81. Firmware Version: 1.18
  82. Topcard : Unknown
  83. Vtarget : 0.0 V
  84. Varef : 0.0 V
  85. Oscillator : Off
  86. SCK period : 0.1 us
  87.  
  88. avrdude: AVR device initialized and ready to accept instructions
  89.  
  90. Reading | ################################################## | 100% 0.02s
  91.  
  92. avrdude: Device signature = 0x1e930b (probably t85)
  93. avrdude: safemode: hfuse reads as DD
  94. avrdude: safemode: efuse reads as FE
  95. avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
  96. To disable this feature, specify the -D option.
  97. avrdude: erasing chip
  98. avrdude: reading input file "O:\Windows\Plocha\Arduino/t85_100%_working.hex"
  99. avrdude: writing flash (8124 bytes):
  100.  
  101. Writing | ################################################## | 100% 0.02s
  102.  
  103. avrdude: 8124 bytes of flash written
  104. avrdude: verifying flash memory against O:\Windows\Plocha\Arduino/t85_100%_working.hex:
  105. avrdude: load data flash data from input file O:\Windows\Plocha\Arduino/t85_100%_working.hex:
  106. avrdude: input file O:\Windows\Plocha\Arduino/t85_100%_working.hex contains 8124 bytes
  107. avrdude: reading on-chip flash data:
  108.  
  109. Reading | ################################################## | 100% 0.02s
  110.  
  111. : verifying ...
  112. : 8124 bytes of flash verified
  113. : reading input file "0xe1"
  114. avrdude: writing lfuse (1 bytes):
  115.  
  116. | ################################################## | 100% 0.01s
  117.  
  118. avrdude: 1 bytes of lfuse written
  119. avrdude: verifying lfuse memory against 0xe1:
  120. avrdude: load data lfuse data from input file 0xe1:
  121. avrdude: input file 0xe1 contains 1 bytes
  122. avrdude: reading on-chip lfuse data:
  123.  
  124. Reading | ################################################## | 100% 0.01s
  125.  
  126. avrdude: verifying ...
  127. avrdude: 1 bytes of lfuse verified
  128. avrdude: reading input file "0xdd"
  129. avrdude: writing hfuse (1 bytes):
  130.  
  131. Writing | ################################################## | 100% 0.01s
  132.  
  133. avrdude: 1 bytes of hfuse written
  134. avrdude: verifying hfuse memory against 0xdd:
  135. avrdude: load data hfuse data from input file 0xdd:
  136. avrdude: input file 0xdd contains 1 bytes
  137. avrdude: reading on-chip hfuse data:
  138.  
  139. Reading | ################################################## | 100% 0.01s
  140.  
  141. avrdude: verifying ...
  142. avrdude: 1 bytes of hfuse verified
  143. avrdude: reading input file "0xfe"
  144. avrdude: writing efuse (1 bytes):
  145.  
  146. Writing | ################################################## | 100% 0.01s
  147.  
  148. avrdude: 1 bytes of efuse written
  149. avrdude: verifying efuse memory against 0xfe:
  150. avrdude: load data efuse data from input file 0xfe:
  151. avrdude: input file 0xfe contains 1 bytes
  152. avrdude: reading on-chip efuse data:
  153.  
  154. Reading | ################################################## | 100% 0.01s
  155.  
  156. avrdude: verifying ...
  157. avrdude: 1 bytes of efuse verified
  158.  
  159. avrdude: safemode: hfuse reads as DD
  160. avrdude: safemode: efuse reads as FE
  161. avrdude: safemode: Fuses OK (E:FE, H:DD, L:E1)
  162.  
  163. avrdude done. Thank you.
  164. 22. You have successfully burned bootloader on your ATtiny85
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement