Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
avr_bootloader:bootloader [2020/03/23 17:38] admin [Burning the Bootloader with the AVRdude] |
avr_bootloader:bootloader [2020/03/23 20:32] admin [Burning the Bootloader with the AVRdude] |
||
---|---|---|---|
Line 72: | Line 72: | ||
Go to the folder with the bootloader: | Go to the folder with the bootloader: | ||
$ cd /usr/share/arduino/hardware/arduino/avr/bootloaders/optiboot/ | $ cd /usr/share/arduino/hardware/arduino/avr/bootloaders/optiboot/ | ||
+ | |||
+ | === Fuse Bits === | ||
+ | In the board.txt file for the Arduino UNO the fuse bits are set like that: | ||
+ | uno.bootloader.low_fuses=0xFF | ||
+ | uno.bootloader.high_fuses=0xDE | ||
+ | uno.bootloader.extended_fuses=0xFD | ||
+ | uno.bootloader.unlock_bits=0x3F | ||
+ | uno.bootloader.lock_bits=0x0F | ||
+ | The extended fuse bits settings for the brown-out detection level (BOD) are: | ||
+ | 0xFF (BOD disabled) | ||
+ | 0xFC (BOD = 4.3V) | ||
+ | 0xFD (BOD = 2.7V) | ||
+ | 0xFE (BOD = 1.8V) | ||
+ | That is the level where the Arduino resets when underpowered.\\ | ||
+ | |||
+ | A good manual for calculating the fuse bits one findes here [[https://www.instructables.com/id/How-to-change-fuse-bits-of-AVR-Atmega328p-8bit-mic/]]. | ||
+ | |||
+ | === ... with the Paper-USBasp Programmer ==== | ||
+ | |||
+ | {{:avr_bootloader:paper-usbasp_programming_board.jpg?400|}}\\ | ||
+ | |||
+ | For setting the fuse bits one has to type: | ||
+ | $ sudo avrdude -p m328p -c usbasp -P usb -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0xFD:m | ||
+ | And for the bootloader: | ||
+ | $ sudo avrdude -p m328p -c usbasp -P usb -U flash:w:optiboot_atmega328.hex:i | ||
+ | |||
=== ... with an AVR ISP Programmer ==== | === ... with an AVR ISP Programmer ==== | ||
For setting the fuse bits one has to type: | For setting the fuse bits one has to type: | ||
- | $ sudo avrdude -p m328p -c stk500v2 -P /dev/ttyACM0 -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m | + | $ sudo avrdude -p m328p -c stk500v2 -P /dev/ttyACM0 -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0xFD:m |
And for the bootloader: | And for the bootloader: | ||
$ sudo avrdude -p m328p -c stk500v2 -P /dev/ttyACM0 -U flash:w:optiboot_atmega328.hex:i | $ sudo avrdude -p m328p -c stk500v2 -P /dev/ttyACM0 -U flash:w:optiboot_atmega328.hex:i | ||
Line 84: | Line 110: | ||
If one has a [[avr_bootloader:paper-avrisp_mk2|Paper-AVRISP mkII]] one hast to type in the terminal the following. For setting the fuse bits: | If one has a [[avr_bootloader:paper-avrisp_mk2|Paper-AVRISP mkII]] one hast to type in the terminal the following. For setting the fuse bits: | ||
- | $ sudo avrdude -p m328p -c avrispmkII -P usb -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m | + | $ sudo avrdude -p m328p -c avrispmkII -P usb -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0xFD:m |
And for the actual bootloader: | And for the actual bootloader: | ||
$ sudo avrdude -p m328p -c avrispmkII -P usb -U flash:w:optiboot_atmega328.hex:i | $ sudo avrdude -p m328p -c avrispmkII -P usb -U flash:w:optiboot_atmega328.hex:i | ||
Line 92: | Line 118: | ||
or even: -e -F\\ | or even: -e -F\\ | ||
Sometimes a specific Baud rate helps, too: -b 19200\\ | Sometimes a specific Baud rate helps, too: -b 19200\\ | ||
+ | For verbose mode output use: -v\\ | ||
=== Burning an Atmega328 (without P) == | === Burning an Atmega328 (without P) == |