Author Topic: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE  (Read 1963 times)

Jeroen3 and 1 Guest are viewing this topic.

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Hello,

I primarily work as an analog/RF and board designer (so I tend to lurk on the other forums).
Recently, I've started integrating simple embedded platforms to control my analog circuits or read sensors and close simple feedback loops. I’m comfortable using Arduino boards and the Arduino IDE for basic HAL programming, so no issues there.

I’ve learned that there are libraries that allow the Arduino IDE to program Pico boards, which I haven’t tried yet but it looks straightforward.

Now, I want to take things up a notch. I’d like to embed an Arduino-compatible MCU directly into my board (not just using a Nano or other board).
I want to simplify the digital section and use the same MCU found on Arduino boards while doing my own layout.

If I buy the same MCU used in Arduino boards and design my own layout, how do I program these MCUs using the Arduino IDE? What’s the official programmer for Arduino microcontrollers, and how do I install the bootloader for the first time? Do I need an FTDI programmer?
I haven’t found much official documentation from Arduino, probably because they focus on selling the complete boards rather than the individual MCUs.

As for the RP2040, I’ve seen good documentation from Raspberry Pi on hardware design around this MCU, but I’m struggling to find information on programming it and installing the bootloader for the first time.
These devices arrive blank, right?

How can I program an RP2040 using Picoprobe and the Arduino IDE if I design my own board around the RP2040?

Thanks!
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4458
  • Country: nz
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #1 on: September 26, 2024, 05:48:48 am »
There is no such thing as an official Arduino programmer. You use exactly the same interface as you would to program the same hardware without going near Arduino.

Generally the Arduino IDE uses avrdude software for AVRs and OpenOCD for many other chip types.

MCUs are generally programmed using JTAG or SPI.

Official Arduino boards (and some others) are programmed directly over USB and have an FTDI or other (e.g. WCH CH340) USB to uart/JTAG interface chip. For those that don't have an onboard USB converter like those you can use a cable with one built in.  You can also run a special program on another Arduino or sometimes (e.g. for RP2040) another Raspberry Pi. For example the Arduino IDE has a specific board setup for "Arduino as ISP". You first download a special programmer "sketch" to one Arduino, then use that as the programmer for typically a bare AVR chip or an AVR chip on some custom board.
 
The following users thanked this post: Sariel

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #2 on: September 26, 2024, 06:16:14 am »
Thank you!
Is there any good documentation on how to do this?

If I want to use one of the microcontrollers from the Nano boards without the companion USB bridge controller, what’s the best approach? How should I program and upload sketches to the bare MCU? Should I use SWD, JTAG, or another method?
Would a USB cable with a built-in FTDI adapter be sufficient?

 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4458
  • Country: nz
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #3 on: September 26, 2024, 06:23:53 am »
Here's what I use for the ATTiny85. I haven't done a bare ATMega328, but I'm sure there are guides for that.

https://www.instructables.com/How-to-Program-an-Attiny85-From-an-Arduino-Uno/

I've programmed bare chips, and also chips built into a commercial product, using a SOIC-8 test clip.
 
The following users thanked this post: Sariel

Offline DashApple

  • Newbie
  • Posts: 1
  • Country: gb
  • So Far, So Good
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #4 on: September 26, 2024, 06:50:07 am »
I'm just a hobbyist when it comes to microcontrollers but I've used the SMD package ATMega328 and DIP package type in most of my projects so can only speak about them, but it would apply to others in the family that have cores for the Arduino platform like the ATMega1284, ATMega2560 ect

My goto when using them is to upload the bootloader to the 328 so they can be programed over serial with a USB to uart bridge with the Arduino IDE, you could also go down the route of doing it with the SPI and no bootloader and using another Arduino as the ISP or some other dedicated programmer, I personally prefer the bootloader option as just requires the USB to uart bridge.

Placing a connector that breaks out the serial port and SPI port of the MCu is a nice option if you switch or want to mess with either type of programming, I have done this on a few boards for testing, but keep in mind when you upload over the ISP the bootloader is overwritten so needs to be added back if you want uart capable programming again

The cable with the FTDI or such built in would be fine if you went down the bootloader with uart programming option, there are cheap boards around too with the USB to uart chip on

Just my 2 cents

« Last Edit: September 26, 2024, 06:59:31 am by DashApple »
 
The following users thanked this post: Sariel

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #5 on: September 26, 2024, 08:22:42 am »
Installing a little CH340 chip onto your pcb would seem to make everything so much simpler than programming the AVR chip direct,  plus if anyone else uses your board they can easiily reprogram it from their PC/Arduino ide with just a usb cable.
 
The following users thanked this post: Sariel, DashApple

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #6 on: September 26, 2024, 09:58:45 am »
This sounds like a great idea. There are different versions of the CH430 chip.
Which specific one should I use?

Once the CH430 is on the board and the Windows drivers are installed, how do I program the bare AVR chip using the Arduino IDE before uploading a sketch?

 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4172
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #7 on: September 26, 2024, 10:51:01 am »
When embedding a mcu onto a board it's always wise to look if the chip in question has a rom bootloader.
For example, the RP2040 has a USB bootloader, iirc it's a USB-MSC (your drop a bin file to it).

Former ATmel parts (atmega/attiny) as used in Arduino do not have any, and you normally upload your firmware over USB-serial through a bootloader that was previously flashed into the chip before it was shipped to you.

When you buy bare chips, this bootloader is missing. You have to flash this yourself, or find someone who can.

I recommend to always obtain an original or compatible in-system-programmer. Because these often also have debuggin capabilities if the chip supports it.

When I used AVR chips this used to be a AVR-ISP MKII, I see they have now replaced it for a more expensive ATMEL-ICE... Or maybe they made a pic/avr combo programmer?
ST has the ST-Link, but many of their demo-board contain a miniature version of an st-link.
You may also obtain a Segger, or other third-party ISP programmer, but these are often pricey.
There will be many clones around of these tools if the chips are popular, ymmv.

When using ISP you will need to make pins available on the board to a connector with a specific pinout.
Read the datasheet of the chip and programmer to find out more.

Many ST parts are also Arduino compatible, see the various Nucleo boards!
« Last Edit: September 26, 2024, 10:52:36 am by Jeroen3 »
 
The following users thanked this post: Sariel

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4458
  • Country: nz
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #8 on: September 26, 2024, 11:48:03 am »
Former ATmel parts (atmega/attiny) as used in Arduino do not have any, and you normally upload your firmware over USB-serial through a bootloader that was previously flashed into the chip before it was shipped to you.

When you buy bare chips, this bootloader is missing. You have to flash this yourself, or find someone who can.

There are many places that sell them with bootloader already installed e.g. here are 10 chips for $33, pre-programmed:

https://www.amazon.com/Atmel-Atmega328P-PU-Arduino-Loader-Installed/dp/B01KH54A6C

Quote
When using ISP you will need to make pins available on the board to a connector with a specific pinout.

I've reprogrammed AVRs in commercial products without such pins -- just attached a test clip directly to the chip.
 
The following users thanked this post: Sariel

Online drvtech

  • Regular Contributor
  • *
  • Posts: 113
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #9 on: September 26, 2024, 02:44:47 pm »
For AVRs I use a USBASP and connect it via a Tag-connect. No bootloader required (I use AVRDUDE) and the connector on the PCB costs absolutely nothing and takes up less space than a 6-way header. And you can put it on the back of the board if you're short of space on the top side.
 
The following users thanked this post: Sariel

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #10 on: September 26, 2024, 04:29:44 pm »
Thank you, everyone.

Here's a summary of what I’ve gathered so far, with a focus on my preference to use the Arduino IDE for uploading sketches.
(In the future, I plan to dive into more bare-metal coding, but not just yet.)

I have the following options:

1.Embed an Arduino Nano or Raspberry Pi Pico boards into my board layout. Both are compact enough, and I can directly use the Arduino IDE for programming. For the Raspberry Pi Pico, I'll need to download the necessary libraries and environment for the IDE (a topic to explore later).

2.Embed the AVR devices used in Arduino boards directly. Connect them to a USB-to-UART bridge like the CH340.
This raises a few questions:
A. Which reputable companies manufacture CH340 devices, and are they available on Digikey/Mouser?
 B. Are these CH340 devices plug-and-play, or do they need programming? Would a Windows driver installation suffice?
 C. How do I use the Arduino IDE to install the bootloader?

Once these steps are done, uploading Arduino sketches should be straightforward.

3.Use RP2040 devices, which are great and outperform AVR devices. From what I understand, they come with a factory-installed bootloader, so I can upload sketches directly via USB, using the appropriate Arduino libraries,right?
However, I’m unsure about the role of the Raspberry Pi Pico Probe. Do I still need it for programming, and is it compatible with the Arduino IDE?
Raspberry provides good hardware guidelines for the RP2040 but lacks clarity on the various programming methods.
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #11 on: September 26, 2024, 04:56:35 pm »
Looking at several Arduino and ESP clone boards they all use the CH340G chip.
Would assume the chps are ready to run, though you need to check the datasheets for the connections.
Always assumed the CH340 is a Far East clone, so doubt you can buy " reputable " ones ?

https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF


As said earlier you could add that chip and the few extra components it needs to your board, but it might be equally easier you use one of the very low cost CH340 modules and just put a 6 pin socket on your board ready to plug the module into at programming time ?
Just depends if you want to regularly reprogam the AVR chips ?


« Last Edit: September 26, 2024, 04:59:14 pm by Lindley »
 
The following users thanked this post: Sariel

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4300
  • Country: us
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #12 on: September 26, 2024, 09:06:37 pm »
Quote
Is there any good documentation on how to do this?
Do what?  There has to be more documentation on Arduino and Arduino-like boards out on the www than nearly any other subject.  Starting with the complete published schematics, board layouts, and source code for the Original Arduino(s) plus half a dozen credible derivative works.  How are you not finding it?
Quote
A. Which reputable companies manufacture CH340 devices, and are they available on Digikey/Mouser?
 B. Are these CH340 devices plug-and-play, or do they need programming? Would a Windows driver installation suffice?
They're manufactured by WCH Qinheng Microelectronics in China, and AFAIK you currently have to buy them from China via dealers like Aliexpress.
See https://wchofficialstore.aliexpress.com/store/1102052740/pages/all-items.html?shop_sortType=bestmatch_sort
They're not "programmable" per se, but do need a windows driver installation.

I'm more fond of the pre-built "modules" (also available from China, or from some Amazon dealers.)  https://www.aliexpress.us/item/3256806016175910.html - about $1 gets you a pre-wired WCH chips with (your choice of) USB connector, Power and Traffic LEDs, and a common pinout for connection on your board.)
Ends up looking like this:

 
The following users thanked this post: Sariel

Online drvtech

  • Regular Contributor
  • *
  • Posts: 113
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #13 on: September 26, 2024, 11:26:42 pm »
With my method (post #9) you can still program directly from the Arduino IDE. Go to Tools|Programmer and choose USBasp (only need to this once) then go to Sketch|Upload using programmer. That's it. You'll need a USBasp board (less than a fiver on eBay) and if you don't want to go to the vast expense of a 15 quid TAG-Connect lead you can put a bog-standard 6-pin header on the board and use the lead that comes with the USBasp. Most Arduino boards have one of these headers which you use for burning bootloaders, (which I think answers one of your other questions).
 
The following users thanked this post: tooki, Sariel

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #14 on: September 27, 2024, 09:21:30 am »
Looking at several Arduino and ESP clone boards they all use the CH340G chip.
Would assume the chps are ready to run, though you need to check the datasheets for the connections.
Always assumed the CH340 is a Far East clone, so doubt you can buy " reputable " ones ?

https://cdn.sparkfun.com/datasheets/Dev/Arduino/Other/CH340DS1.PDF


As said earlier you could add that chip and the few extra components it needs to your board, but it might be equally easier you use one of the very low cost CH340 modules and just put a 6 pin socket on your board ready to plug the module into at programming time ?
Just depends if you want to regularly reprogam the AVR chips ?






I like the idea of using an external CH430 programmer.
If I add a bare AVR MCU (like the ones used in Arduino) to my board, how can I upload the bootloader for the first time?

After that, I understand uploading sketches with the CH430 should be straightforward.

Thanks!
 

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #15 on: September 27, 2024, 09:26:53 am »
If I design a layout with the RP2040:

1. Do RP2040 devices come blank, or do they include a bootloader?

2. On my custom-designed board with the RP2040, will I need an external programmer, or can I simply use the USB connection to upload the program?

3. What is the recommended method for programming the RP2040 using Arduino? I've heard about Earle Philhower's framework—does it work well, and will it be compatible with my custom RP2040 layout?

Thanks!
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #16 on: September 27, 2024, 10:20:41 am »

I like the idea of using an external CH430 programmer.
If I add a bare AVR MCU (like the ones used in Arduino) to my board, how can I upload the bootloader for the first time?

After that, I understand uploading sketches with the CH430 should be straightforward.

Thanks!


If you seach Ytube on  "bootloader to atmega328" you will find lots of examples of how to do that.

What you need to appreciate is that its not just the microchip that you put on your board, they do need extra components like Crystals and Caps to make them run.

Although we have not used them, the RPi 2040 chips need quiet a lot of components to make it run - see this pdf.

https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf

Perhaps you can now see that for both the AVR and RPi chips, using the lo-cost ready made plug in modules is probably a much simpler and better solution, though agree, possibly not as integrated looking as a chip on the pcb.

Also wonder what features you are looking with the RPi chips vs the AVRs,  wifi, BT, extra speed ?   You might want to look at the ESP32 modules , they are coded and programmable from the Ardunio IDE.
Lots of ESP info here  -
 https://randomnerdtutorials.com/


 

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #17 on: September 27, 2024, 12:05:23 pm »

I like the idea of using an external CH430 programmer.
If I add a bare AVR MCU (like the ones used in Arduino) to my board, how can I upload the bootloader for the first time?

After that, I understand uploading sketches with the CH430 should be straightforward.

Thanks!




If you seach Ytube on  "bootloader to atmega328" you will find lots of examples of how to do that.

What you need to appreciate is that its not just the microchip that you put on your board, they do need extra components like Crystals and Caps to make them run.

Although we have not used them, the RPi 2040 chips need quiet a lot of components to make it run - see this pdf.

https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf

Perhaps you can now see that for both the AVR and RPi chips, using the lo-cost ready made plug in modules is probably a much simpler and better solution, though agree, possibly not as integrated looking as a chip on the pcb.

Also wonder what features you are looking with the RPi chips vs the AVRs,  wifi, BT, extra speed ?   You might want to look at the ESP32 modules , they are coded and programmable from the Ardunio IDE.
Lots of ESP info here  -
 https://randomnerdtutorials.com/



Thank you!
 I'm an experienced board designer with a strong background in analog, RF, and power systems, though I have limited experience with embedded development. I’m confident I can design the circuitry around the MCU and reverse engineer Arduino/Pi boards.

My main concern is the programming and bootloading process, as I want to avoid ending up with a bricked board.

Another question just came to mind:

If I create my own layout using AVR devices but assign different pins than Arduino, will Arduino sketches still work? For example, will the "blink" sketch function properly?
Since Arduino HAL libraries refer to the pin numbers based on the board’s pinout rather than the MCU’s actual pins, this could cause a mismatch, right?
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #18 on: September 27, 2024, 02:01:08 pm »

If I create my own layout using AVR devices but assign different pins than Arduino, will Arduino sketches still work? For example, will the "blink" sketch function properly?
Since Arduino HAL libraries refer to the pin numbers based on the board’s pinout rather than the MCU’s actual pins, this could cause a mismatch, right?


Basically yes, But  most micros i/o pins are multi-functional . such as digital only, Analogue, PWM etc.  so you have to check the datasheet etc to ensure the pin you want to use has the function your need.

These diagrams give you an easy quick reference but always check with the datasheet if unsure.

https://content.arduino.cc/assets/Pinout-NANO_latest.pdf
 
The following users thanked this post: Sariel

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #19 on: September 28, 2024, 01:58:38 pm »
I came across this link in the Arduino documentation that explains how to use the in-circuit programming (SPI) interface by turning another Arduino board into a bootloader programmer.

https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/?_gl=1*5eu64j*_gcl_au*NTU0MTU1OTAyLjE3MjU2MDkyMzM.*FPAU*NTU0MTU1OTAyLjE3MjU2MDkyMzM.*_ga*MTQwODcyMDU2NS4xNzI1NjA5MjI5*_ga_NEXN8H46L5*MTcyNzQzOTc3MS4xNC4xLjE3Mjc0Mzk4NTYuMC4wLjEwNTI1NDk4OTU.*_fplc*Smhob2R4cFRxNDRlRmdUQ3dBQ3JENTh5ZTlQYndaNjhQYUpwZUJkNFpGRXBHcWhJa2ZDcVlyRHQ2WFRWeUQzcSUyQjFiYkZtTjVwMHBkZE85eTFQVThYUFVoJTJGdXRjYSUyQmJKUzdSaXlia0pHZFpETzZJZmNmSkVYQ0JQVmR6SFZ3JTNEJTNE

Now, let’s say I design my own PCB using an AVR chip like those found in Arduino devices and mount a bare MCU on my board.
If I burn the bootloader using that method, what’s the next step?
Do I just use the CH430 and upload sketches through the UART interface it provides, or is there more to the process?
After the bootloader is loaded to a bare AVR chip, what is the simplest method to upload the sketches?
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4458
  • Country: nz
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #20 on: September 28, 2024, 03:01:11 pm »
I came across this link in the Arduino documentation that explains how to use the in-circuit programming (SPI) interface by turning another Arduino board into a bootloader programmer.

I already sent you a link to information how to do that three days ago.

https://www.eevblog.com/forum/microcontrollers/programming-arduino-mcu-and-rp2040-on-custom-boards-using-arduino-ide/msg5655369/#msg5655369
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12568
  • Country: ch
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #21 on: September 28, 2024, 03:37:47 pm »
This sounds like a great idea. There are different versions of the CH430 chip.
Which specific one should I use?

Once the CH430 is on the board and the Windows drivers are installed, how do I program the bare AVR chip using the Arduino IDE before uploading a sketch?
To flash the bootloader to an AVR, you need to use SPI. So why even bother with the bootloader, only to then need another piece of hardware to upload the sketch? You can flash your sketch to the AVR directly, with no bootloader. This saves you a big programming step, and is faster to flash, and the MCU boots faster. Yes, you can do this with Arduino IDE.

Not that I would likely design a new product around an AVR, since they're not particularly powerful for what they cost.


If you do decide to use a bootloader and USB-serial bridge, instead of the CH340 or other no-name Chinese chip, I'd use an FT232 or CP2102N. The FTDI chips are the best supported out of the box on a wide array of OSes.

The RP2040 has USB built in.
« Last Edit: September 28, 2024, 03:39:37 pm by tooki »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12568
  • Country: ch
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #22 on: September 28, 2024, 03:55:46 pm »
When I used AVR chips this used to be a AVR-ISP MKII, I see they have now replaced it for a more expensive ATMEL-ICE... Or maybe they made a pic/avr combo programmer?
They combined them. The PICkit 4 and 5 are now the low-cost programmer/debuggers for the AVR chips. I thought they were not supported in AVRdude (and thus in ArduinoIDE), but apparently the PICkit 4 will respond as an AtmelICE if addressed as one, so AVRdude supposedly just works with it. The PICkit 5 (and MPLAB ICE 4 and MPLAB ICD 5), on the other hand, are not supported by AVRdude.

But given that a $3 Arduino Uno clone can be flashed into a programmer, or that you can get a USBasp or AVRasp clone from aliexpress for $3, I wouldn't bother with the original tool, at least not for simple flashing. It'd definitely be worth it for debugging in MPLAB X.
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: gb
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #23 on: September 28, 2024, 04:06:35 pm »
This tutorial might be more helpful for you than Bruces good one, as it shows the connections for programming  the Arduino 328 chip.

https://www.instructables.com/How-to-Burn-the-Arduino-BootLoader-on-to-a-AtMega3/

Once you have programmed the bootloader you can program your user program from the Arduino IDE using either the same method as the bootloader, or using one of the USB CH340 modules or one of those Tooki mentions which connect to the 328s Serial instead of the SPI pins.

Tip, if using a Crystal on a breadboard as in the tutorial above,  its leads are very thin and often create a poor connection and the programming can fail,  best to solder some thicker, but short wires to its lead so you have a sound connection.
 
The following users thanked this post: Sariel

Offline SarielTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: il
Re: Programming Arduino MCU and RP2040 on Custom Boards Using Arduino IDE
« Reply #24 on: September 28, 2024, 06:36:02 pm »
Thank you all for your input.

Here’s a summary:

It’s possible to burn the bootloader onto an AVR using the SPI pins with another Arduino acting as the programmer and the Arduino IDE. Once the AVR has the bootloader, it can be programmed using external USB cables or onboard chips like the CH430/FTDI or still through the SPI pins. (But what will happen if other devices are on board and connected also to these SPI pins. Will they be damaged during programming??)

The reason I'm pursuing this is that, although I prefer using the Arduino IDE (I'm still fairly new to programming), I can't rely on Arduino boards being around long-term, as they are frequently updated or become obsolete. The AVR chips, on the other hand, are likely to outlast them, so I'm considering directly integrating the AVRs into my designs.

I agree that performance-wise, these devices aren't the best. That's why I'm also researching RP2040 devices and, eventually, the RP2350. I still need to figure out their bootloading and programming processes as bare chips, but that might be a topic for another discussion.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf