arduino:arduino_without_a_bootloader
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
arduino:arduino_without_a_bootloader [2020/01/04 02:25] – [Hardware] mithat | arduino:arduino_without_a_bootloader [2021/04/22 01:01] – [Case 3: Pro Mini 3.3V/8MHz with USBtinyISP] mithat | ||
---|---|---|---|
Line 4: | Line 4: | ||
One of the things that simplifies Arduino development is its [[https:// | One of the things that simplifies Arduino development is its [[https:// | ||
- | In the case of the Arduino, the bootloader | + | In the case of the Arduino, the bootloader |
- | But a bootloader isn't the only way to program the microcontrollers on these boards. Instead, you can use an external programming device (a.k.a, // | + | But a bootloader isn't the only way to program the microcontrollers on these boards. Instead, you can use an external programming device (a.k.a, // |
- | So while it's entirely possible to program many Arduino boards without using a bootloader, you would have to tie up one USB port on your computer for programming | + | So while it's entirely possible to program many Arduino boards without using a bootloader, you would have to tie up one USB port on your computer for the programmer |
===== Cursed is the bootloader ===== | ===== Cursed is the bootloader ===== | ||
- | There are times when you might want to bypass the convenience a bootloader offers | + | In spite of the convenience a bootloader offers, there are times when you might want to forego this and program |
- | Another reason to not use a bootloader is that your project' | + | Another reason to not use a bootloader is that the startup time is critical. The Arduino bootloader introduces about a second and a half delay between power-up/ |
- | Yet another situation where you might not want a bootloader is if you have lowered or disabled the [[https:// | + | Yet another situation where you might not want a bootloader is if you have lowered or disabled the [[https:// |
There are situations apart from these where you wouldn' | There are situations apart from these where you wouldn' | ||
===== Hardware ===== | ===== Hardware ===== | ||
- | You're going to need a device you want to program (e.g., an Arduino board) and a device with which you will do the programming (a.k.a., the programmer). You can see the complete list of programmers supported by the Arduino framework by looking at the list available under //Tools > Programmer: " | + | To program an ATmega328P without a bootloader, you're going to need a device you want to program (e.g., an Arduino board) and a device with which you will do the programming (i.e., the programmer). You can see the complete list of programmers supported by the Arduino framework by looking at the list available under //Tools > Programmer: " |
{{ : | {{ : | ||
Line 27: | Line 27: | ||
That's a lot of options! | That's a lot of options! | ||
- | Below, I cover a few cases to get you started. Most of these use the USBtinyISP.((As near as I can tell, the original source of the USBtinyISP design is Dick Streefland' | + | ==== USBtinyISP |
- | The original USBtinyISP | + | Below, I cover a few cases to get you started. Most of these use the USBtinyISP.((As near as I can tell, the original |
- | If you are using a USBtinyISP clone, there' | + | The original USBtinyISP has a built-in 3x2 IDC cable that carries the signals needed for ISP (in-system programming) and a 5x2 IDC cable that carries the same signals but in a different layout. |
- | Depending on the board you are programming, | + | Depending on the board you are programming, |
<WRAP center round tip 80%> | <WRAP center round tip 80%> | ||
Line 39: | Line 39: | ||
</ | </ | ||
===== Procedures ===== | ===== Procedures ===== | ||
- | As is the case when uploading a program to your Arduino using a bootloader, when uploading a program using a programmer you must specify what the target board is. So when doing any of the following, make sure //Tools > Board// and //Tools > Processor// are set correctly for your board. | + | As is the case when uploading a program to your Arduino using a bootloader, when uploading a program using a programmer you must specify what the target board is. So when doing the following, make sure //Tools > Board// and //Tools > Processor// |
Now is also a good time to mention a significant caveat about using a programmer as described here. <WRAP center round important 80%> | Now is also a good time to mention a significant caveat about using a programmer as described here. <WRAP center round important 80%> | ||
- | Using a programmer involves making connections between the programmer and the Arduino' | + | Using a programmer involves making connections between the programmer and the Arduino' |
- | + | ||
- | However, | + | |
</ | </ | ||
- | Yes, this is yet another way the bootloader makes your life simpler. | + | This can be bit of a drag and is yet another way the bootloader makes your life simpler. |
With that out of the way, let's move on to some specific cases. | With that out of the way, let's move on to some specific cases. | ||
Line 57: | Line 54: | ||
</ | </ | ||
- | Directly uploading a sketch to an Uno or Nano using a USBtinyISP is very straightforward: | + | Directly uploading a sketch to an Uno or Nano using a USBtinyISP is pretty |
- Configure your IDE to use the USBtinyISP: //Tools > Programmer " | - Configure your IDE to use the USBtinyISP: //Tools > Programmer " | ||
- Unplug the USBtinyISP from the computer if it's connected and power down the Uno/Nano if it's powered up. | - Unplug the USBtinyISP from the computer if it's connected and power down the Uno/Nano if it's powered up. | ||
- Connect USBtinyISP' | - Connect USBtinyISP' | ||
- | * The ICSP header is the 3x2 header on the end of the board opposite the USB jack. Connect the USBtinyISP' | + | * The ICSP header is the 3x2 header on the end of the board opposite the USB jack. Connect the USBtinyISP' |
- Plug the USBtinyISP into your computer. This will power the Uno/Nano (and everything else) from the USBtinyISP' | - Plug the USBtinyISP into your computer. This will power the Uno/Nano (and everything else) from the USBtinyISP' | ||
- Use the Arduino IDE to //Sketch > Upload Using Programmer// | - Use the Arduino IDE to //Sketch > Upload Using Programmer// | ||
Line 69: | Line 66: | ||
- To re-program, power down the Uno/Nano and go back to **step 3**. | - To re-program, power down the Uno/Nano and go back to **step 3**. | ||
- | A caveat | + | A caution |
==== Case 2: Pro Mini 5V/16MHz with USBtinyISP ==== | ==== Case 2: Pro Mini 5V/16MHz with USBtinyISP ==== | ||
Line 115: | Line 112: | ||
<WRAP center round important 80%> | <WRAP center round important 80%> | ||
- | **Be careful!** | + | **Make sure your USBtinyISP level shifts |
- | + | ||
- | Version 1 of the Adafruit | + | |
- | + | ||
- | All the thrid-party USBtinyISP clones I've seen have the VCC jumper as well as the needed circuitry to level shift the I/O. But it's entirely likely that there are some old or bargain-basement versions that don' | + | |
- | Make sure your USBtinyISP level shifts | + | Version 1 of the Adafruit |
</ | </ | ||
Line 186: | Line 179: | ||
When you upload a program using a programmer, you overwrite the bootloader. This means your board will no longer work with the conventional //Sketch > Upload// command in the IDE. However, getting the bootloader back is straightforward. | When you upload a program using a programmer, you overwrite the bootloader. This means your board will no longer work with the conventional //Sketch > Upload// command in the IDE. However, getting the bootloader back is straightforward. | ||
- | Uploading a bootloader to your micro is almost identical to uploading a program using a programmer. The only difference is that instead of uploading a program using //Sketch > Upload Using Programmer//, | + | Uploading a bootloader to your micro is almost identical to uploading a program using a programmer. The only difference is that instead of uploading a program using //Sketch > Upload Using Programmer//, |
After uploading the bootloader, you should be able to use //Sketch > Upload// again just as you always have. | After uploading the bootloader, you should be able to use //Sketch > Upload// again just as you always have. | ||
arduino/arduino_without_a_bootloader.txt · Last modified: 2022/05/30 05:46 by mithat