I have been using PlatformIO for a while, and with great success. However I have hit my first stumble.
I wish to use the ATmega328p with the internal clock.
Normally I would Download a file, “breadboard-1-6-x.zip” open it into a ARDUINO sketchbook folder marked “hardware”. After doing this there is a new board in the menu of the arduino IDE marked BREADBOARD.
Lastly I select “arduinoISP” and use an arduino UNO to load sketches up to the arduino chip. Is there a way of doing this in PIO? If so anyone got an Idea as to how? I am includeing a video of how I do this in a link Incase I am not clear as I need to be.
The easiest way to use your breadboard Arduino would be to find the closest board in the list of ATMega328P boards listed at PlatformIO Registry (type in “ATMega328P” for MCU) and then just use board = xyz in your platformio.ini.
If your unique configuration is not found within these boards, you have the following options:
… will work with a Atmega328 that is running on a 8Mhz crystal, or a 8Mhz internal clock. It looks like one of the supported upload methods is an Arduino programmed as a ISP (ArduinoISP), so you can add…
upload_protocol = arduinoisp
… to the above platformio.ini config, making the only thing left to do is set the fuses on the Atmega328 correctly. Don’t know if that is readily doable in platformio - probably, since you can also pass parameters to avrdude via upload_flags, but I’m not sure what to set there as I usually use avrdudess on Windows to do my fuse settings and first upload of a compiled arduino sketch (which includes the serial bootloader).
Er, no, I didn’t… doing that makes the verification error go away nicely! Thanks! I’ve also since found the extra_scripts notation about custom fuses, so have also done that. Final step will be to try uploading to a fresh atmega328p and see if the fuses are correctly changed when code is loaded onto it…