User Tools

Site Tools


arduino:atmega328p_arduinos_and_custom_fuse_settings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
arduino:atmega328p_arduinos_and_custom_fuse_settings [2020/01/04 02:45] – [Upload with programmer and test] mithatarduino:atmega328p_arduinos_and_custom_fuse_settings [2021/04/22 01:37] (current) – [2. How do I specify new board characteristics?] mithat
Line 17: Line 17:
 ===== Four general questions ===== ===== Four general questions =====
  
-==== Where do I put new board specs? ====+==== 1. Where do I put new board specs? ====
  
 Specs for Arduino boards, including fuse bit settings, are found in various ''board.txt'' files, themselves found in various ''hardware'' folders. This can get a little confusing as there are number of these folders and files that you'll find on your computer. I'll try to go through the differences below. Specs for Arduino boards, including fuse bit settings, are found in various ''board.txt'' files, themselves found in various ''hardware'' folders. This can get a little confusing as there are number of these folders and files that you'll find on your computer. I'll try to go through the differences below.
  
 === The install bundle === === The install bundle ===
-A ''board.txt'' file is included in the Arduino package you installed and will be found at+A ''board.txt'' file is included in the Arduino package you installed. You'll find it at
 <code>/path-where-you-installed-arduino/hardware/arduino/avr</code> <code>/path-where-you-installed-arduino/hardware/arduino/avr</code>
-This file has board descriptions written in a syntax the IDE understands for the default boards Arduino supported at the time the package was released. This is //not// where you will add descriptions for your custom board or existing board with modified fuse settings, but it's good place to look to begin to grok the syntax.+This file has board descriptions written in a syntax the IDE understands for default boards Arduino supported at the time the package was released. This is //not// where you will add descriptions for your custom board or existing board with modified fuse settings, but it's good place to look to begin to grok the syntax.
  
-When you open the default ''boards.txt'' file in a text editor, look for the line:+When you open this ''boards.txt'' file in a text editor, look for the line:
 <code>uno.name=Arduino/Genuino Uno</code> <code>uno.name=Arduino/Genuino Uno</code>
 Following that are a number of lines starting with ''uno.'' These are all parameters that describe the specifics of the Arduino/Genuino Uno board. Knowing this, you can probably make at least partial sense of some of the parameters. The lines that begin ''uno.bootloader.'' are where the fuse settings are given. You can see hexadecimal entries for the low bits, high bits, and extended bits along with the lock and unlock bits. Following that are a number of lines starting with ''uno.'' These are all parameters that describe the specifics of the Arduino/Genuino Uno board. Knowing this, you can probably make at least partial sense of some of the parameters. The lines that begin ''uno.bootloader.'' are where the fuse settings are given. You can see hexadecimal entries for the low bits, high bits, and extended bits along with the lock and unlock bits.
Line 40: Line 40:
 This is //not// your Arduino sketch folder. Rather it's where global application configuration information is stored. You can see the path to your profile folder towards the end of the Preferences dialog box. The Arduino profile folder on Linux systems is ''/home/<username>/.arduino15''. This is //not// your Arduino sketch folder. Rather it's where global application configuration information is stored. You can see the path to your profile folder towards the end of the Preferences dialog box. The Arduino profile folder on Linux systems is ''/home/<username>/.arduino15''.
  
-The ''boards.txt'' here is one that your Aurdino IDE actually uses. It might be a copy of the ''boards.txt'' that shipped with the installation bundle, or it might have been subsequently updated by the IDE. +The ''boards.txt'' here is one that the Aurdino IDE actually uses. It might be a copy of the ''boards.txt'' that shipped with the installation bundle, or it might have been subsequently updated by the IDE. If you have added additional boards using the IDE, you are likely to find additional folders for their architectures under ''/your-Arduino-profile-folder/packages'' or its subfolders.
- +
-If you have added additional boards using the IDE, you are likely to find additional folders for their architectures under ''/your-Arduino-profile-folder/packages'' or its subfolders.+
  
 It's my understanding that you can add your custom board descriptions in these areas, but the prevailing advice is not to. This area is designed to be managed by the IDE. If you make additions here, the IDE may overwrite them or you might corrupt the ability for the IDE to successfully add/remove/update boards. You //can// safely add new boards here if you go through a somewhat [[https://www.hackster.io/wallarug/arduino-ide-creating-custom-boards-89f7a6|cumbersome process]] involving a few additional files. But there seems to be an easier way. It's my understanding that you can add your custom board descriptions in these areas, but the prevailing advice is not to. This area is designed to be managed by the IDE. If you make additions here, the IDE may overwrite them or you might corrupt the ability for the IDE to successfully add/remove/update boards. You //can// safely add new boards here if you go through a somewhat [[https://www.hackster.io/wallarug/arduino-ide-creating-custom-boards-89f7a6|cumbersome process]] involving a few additional files. But there seems to be an easier way.
Line 50: Line 48:
 The following method works on the version of Arduino I used at the time or writing this: 1.8.8. I don't know whether it can be relied on to hang around for a while or has been deprecated. The following method works on the version of Arduino I used at the time or writing this: 1.8.8. I don't know whether it can be relied on to hang around for a while or has been deprecated.
  
-So, until I'm advised this is a horrible idea, the way I recommended you add your own custom board descriptions is to create a folder called ''hardware'' in your Arduino sketches folder and add the needed files there. I walk through the details in the case study that follows. +So, until I'm advised this is a horrible idea, the way I recommended you add your own custom board descriptions is to create a folder called ''hardware'' in the folder where your sketches are located and add the needed files there. I walk through the details in the case study that follows. 
-==== How do I specify new board characteristics? ====+==== 2. How do I specify new board characteristics? ====
  
-There is a //lot// of arcane knowledge that applies to writing custom Arduino ''board.txt'' entries, and I haven't found a source that documents it thoroughly. So my best advice is to study the ''boards.txt'' found at <code>/path-where-you-installed-arduino/hardware/arduino/avr/</code> to get as familiar with the syntax. What interests us here are the entries for ''low_fuses'', ''high_fuses'', and ''extended_fuses'' (and to a certain extent ''unlock_bits'' and ''lock_bits''.+There is a //lot// of arcane knowledge that applies to writing custom Arduino ''board.txt'' entries, and I haven't found a source that documents it thoroughly. So my best advice is to study the ''boards.txt'' found at <code>/path-where-you-installed-arduino/hardware/arduino/avr/</code> to get as familiar with the syntax. What interests us here are the entries for ''low_fuses'', ''high_fuses'', and ''extended_fuses'' (and to a certain extent ''unlock_bits'' and ''lock_bits''. The values for these entries will change depending on what features and behavior you want to enable or disable.
  
 Another good resource to look through is the files found in the breadboard-1-6-x.zip archive found under "Minimal Circuit (Eliminating the External Clock)" at [[https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard|From Arduino to a Microcontroller on a Breadboard]] Another good resource to look through is the files found in the breadboard-1-6-x.zip archive found under "Minimal Circuit (Eliminating the External Clock)" at [[https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard|From Arduino to a Microcontroller on a Breadboard]]
  
  
-==== What specs do I want? ====+==== 3. What specs do I want? ====
  
 This article covers making a variant of an existing board where only the fuses have been changed. The relevant parameters in the ''boards.txt'' specs will have ''low_fuses'', ''high_fuses'', and ''extended_fuses'' in their names. The values associated with those parameters are hexadecimal. This article covers making a variant of an existing board where only the fuses have been changed. The relevant parameters in the ''boards.txt'' specs will have ''low_fuses'', ''high_fuses'', and ''extended_fuses'' in their names. The values associated with those parameters are hexadecimal.
Line 68: Line 66:
 There is one additional caveat here: You can only change fuses that are compatible with what the bootloader you plan to use will let you do. Again there isn't a lot of documentation here, so if you've done everything right but things still don't work, this might be the reason. The solution to this is to compile a custom bootloader, which is well beyond the scope of this piece. There is one additional caveat here: You can only change fuses that are compatible with what the bootloader you plan to use will let you do. Again there isn't a lot of documentation here, so if you've done everything right but things still don't work, this might be the reason. The solution to this is to compile a custom bootloader, which is well beyond the scope of this piece.
  
-==== How do I burn a bootloader? ====+==== 4. How do I burn a bootloader? ====
  
 This too is a pretty big topic, but the TL;DR is: hook up a programmer to your board, select the right board and programmer, then do a //Tools > Burn Bootloader//. This [[https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader/all|Sparkfun tutorial]] is a good reference if you need more hand-holding. This too is a pretty big topic, but the TL;DR is: hook up a programmer to your board, select the right board and programmer, then do a //Tools > Burn Bootloader//. This [[https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader/all|Sparkfun tutorial]] is a good reference if you need more hand-holding.
arduino/atmega328p_arduinos_and_custom_fuse_settings.1578105924.txt.gz · Last modified: 2020/01/04 02:45 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki