I've been going round in circles the last 3 hours following numerous instructions on how to use an arduino to program a ATMEGA328 on a breadboard with a bootloader to allow it to run on 8mhz internal, using an UNO as an ISP.
I have got stuck at getting the board option into the IDE, under tools / board, where I can select the 8mhz option....it just never appears, none of the optiboot options appear. I've tried instructions such as on here
, using optiboot, but I just can not get the option in the dropdown, wherever I place the files. At the moment they are under arduino/hardware/optiboot with arduino being my sketch folder.
Can anyone shed some light on what I am doing wrong, I feel this should be quite a simple exercise which I am making very difficult by missing something simple.
The changes in how board packages are handled now makes modifying the arduino board defs act differently than you'd expect, and it's really not something that is made easy now. The file you're changing may not be the one it's looking at - that may be buried in app data (depending on whether you've ever updated the default boards through board manager)
Also, you need to restart the IDE to apply changes to those files - not sure if that's what you were missing.
I've tried this and got much further, Ive been able to see the different bootloader options now. Hardware questions now.
A question, is this really for programming ICs in the arduino board which can then be removed into their own bespoke PCB, or is it possible to program a chip directly in its own PCB? I was using an arduino Uno has an ISP but not sure that that is the way to go with the minicore option?
I'm a bit of a novice when it comes to Arduino though I do have a technical background, so a steep but hopefully quick learning curve for me.
I am planning to program an ATMEGA32 which is in a breadboard from an UNO, just most bottom left setup on that page.
Do I need the 10nf cap on reset?
Does the breadboard need to initially be set up with an external crystal in order to then be programmed with the bootloader for internal 8mhz?, or can it be programmed with a bootloader without the need for an external crystal?
If you're planning to use the bootloader functionality (upload code using a USB to serial adapter), you'll have to use the 100nF capacitor in order to get auto reset working.
You don't have to use an external oscillator on the ATmega32. If you download MightyCore, there's an 8 MHz and a 1 MHz internal oscillator option. When you buy the chip it runs on the internal oscillator (1 MHz) by default.
I'll recommend you buying a "real" ISP programmer, rather than having to wire up your UNO every single time. A lot of people recommend the USBasp, but I've had some issues on some microcontrollers. Personally I'm using a USBtinyISP, and if works for all AVRs I own It's super tiny too!
I only intend to burn a bootloader occasionally, but the USBtinyISP looks good if I end up doing it more often.
Novice question here, but what is a core exactly, how is it different to a bootloader?...and whats the difference between the mini and the mightycore?
Just to confirm, if loading a bootloader for 8mhz internal into a breadboard mega328, the breadboard mega328 does not need to have an external crystal.
Jonnysmith:
Novice question here, but what is a core exactly, how is it different to a bootloader?
The term core as used in MiniCore means a hardware package for the Arduino IDE. The term "platform" is also used sometimes. They are basically just a collection of files that add support for new boards to the Arduino IDE. This could be chips that are not already supported by the default Arduino IDE or adding new configurations or capabilities to already supported parts. Since the Arduino IDE allows you to reference components from other cores, a hardware package could be as minimal as just the board definitions in a boards.txt file or completely self contained, including a full toolchain. To make things more complicated, hardware packages may contain one or more cores. In that context the word core refers to the core libraries which contain the basic Arduino functions such as digitalWrite(), etc. MiniCore doesn't actually include core libraries because it references the Arduino AVR Boards core instead. Bootloaders can't be referenced so if the hardware package uses bootloaders they must be included but some packages only support Upload Using Programmer or otherwise don't require their own bootloaders and thus don't include them.
Jonnysmith:
whats the difference between the mini and the mightycore?
They support different chips. See
and
Jonnysmith:
Just to confirm, if loading a bootloader for 8mhz internal into a breadboard mega328, the breadboard mega328 does not need to have an external crystal.
Correct, unless the fuses have been set to use an external crystal in which case you would need to connect an external crystal to be able to set the fuses to use the internal oscillator. So be sure not to set the fuses for external.