RP2040 is pretty underwhelming as a microcontroller. Its sleep mode draws 0.8 mA. And the ADC has DNL issues [1]
Capabilities-wise it feels like "NIH syndrome" ESP32-alike with USB in lieu of wireless.
At least it's much cheaper than Arduino (like 2-3x compared to Uno). The price of Arduino Uno is not justified by anything when its NRE cost must have been recouped long ago.
Yes, having played with the pico, ESP32 and predessor I kinda agree, thouogh ADC's in microcontrollers are limited depending upon what you want to do and will often lean towards an external.
The ESP also has hardware floating point, which if you need to use that sure does blast past the pico's core's.
What the pico does shine well at is the PIO controllers and a good documentation user base. The fact that within a year it had early on full support in the ecosystem of microcontrollers is pretty darn amazing, more so given Espressif not exactly known for their doumentation and the whole intergration with IDE's like the ardiuno was dedicated users off their own steam driving it.
Another plus for the PICO is that you can get for a dollar the chip itself and with the advent and ease of doing your own circuits, afforded the ability to roll your own controller board how you want them. Sure can do that with the ESP's but not sure so easily accesable price wise as the PICO chip is and not as cheap.
Yes the whole lack of wifi and BT upon the PICO in todays times with IOT this and other projects, does leave shortfalls, though there are boards that do that, sadly many get WIFI by adding something like an ESP01 chip and the whole ironic aspect of a microcontroller needing another microcontroller for it's wifi when maybe what you wanted to do could be done upon the ESP01 alone, well. Bit of a chuckle.
So for me, were the PICO stands out is the PIO controllers and how they with the USB host option allow many device avenues. Want your own joystick - doable, want to emulate some odd protocol - may well find the PIO can take a lot of strain from that.
I'm currently working on a keyboard with a pico, and am not the most experienced at working with microcontrollers. It's crazy how much easier it is for me to do things on the pico then the old standard, the pro micro. I can just have my vscode open, and the serial port just connects. Changing a file causes the controller to reboot and run the new code. No flashing, or dealing with compiling QMK.
Given that you can buy a pico chip in the pro micro form factor, with usb c, for cheaper then an elite c, I'm hoping these end up in a lot more keyboards.
You've raised real downsides (for some applications), but the rp2040 also many features that are unheard of at its price point (1$): dual core, PIO, lots of ram. In fact the RAM + dual core means you're almost getting two Cortex-M0+ MCUs for the price of one (with shared peripherals).
For comparison, Microchip (formerly atmel) SAMD21 (also Cortex-M0+, of Arduino Zero fame) is about 3-4 $, single core, less RAM.
>For comparison, Microchip (formerly atmel) SAMD21 (also Cortex-M0+, of Arduino Zero fame) is about 3-4 $, single core, less RAM.
But it has built in flash.
Sure, external flash is still cheaper* (512K for ~$0.2) but it's a major downside having a mandatory extra chip because of how much more physical space it takes up.
* Might not actually be cheaper if you consider pick&place cost of an extra part you're not likely to use anywhere else.
External flash also messes with real-time response times - if your IRQ handler is not forced to be in RAM it can take tens-hundreds of microseconds to start, which in many applications is not acceptable. Built-in flash is much more predictable.
Last time I tried RP2040 SDK (a few months back) many functions you would need to use in these IRQ handlers were not marked as RAM, which means you have to copy&paste them from SDK to your code and add the attribute.
The ESP32 suffers from similar problem, but at least they seem to have been more thoughtful about slapping these RAM attributes here and there.
Having said that, the RP2040 is generally much more pleasant to program than ATSAMD21 or ESP32 and the PIOs are awesome. Also you can easily get it with assembly from JLCPCB at $1.20 or thereabouts.
What's your source for this? The RP2040 datasheet claims 0.18 mA for Dormant state and 0.39 mA for Sleep. As you've got detailed control over what gets clock gated in sleep state suspect you can bring that 0.39 mA down if you've only got one or two wake events to care about.
The datasheet is really skimpy about the power draw, especially compared to what ST Micro tells you. In STM32 parts the Sleep mode is usually pretty bad (say half of normal consumption) and you need to go to Stop mode, where the core and most peripherals are not clocked to get into micro-amp range. However, once there you can typically get by with under 5uA. You can wake up from that in a few microseconds if you clock from internal oscillator with no PLL (so you run at 8-16MHz not 48-64MHz).
In that context, 180uA is pretty bad, but again, the datasheet is not very clear.
That's still really high though. nRF51 sleep current is around 2 microamps. You can run it off a coin cell for years (depending on what you're doing). Sounds like an RP2040 would last maybe a week.
The onboard RAM is a bit light, I agree. But the chip is quite powerful, they can usually be overclocked to about 250 Mhz, and have dual cores. The real star of the show is the PIO system.
You've got 2 sets of 4 state machines, that can do a whole lot of stuff at really impressive I/O rates. People have used them to generate VGA or DVI (HDMI) with just some resistors and connectors.
It's almost as good as having an FPGA. I suspect people will be wringing more and more performance out of this chip over the next year or two.
Here is a posting about driving an LCD. It starts with a bitbanged version and goes through rewriting it using PIO and thereby reducing CPU usage from full load to "almost negligible". Maybe that's an interesting read?
As I understand it the chip was partly intended as a starter project for RPi's newly founded in House silicon design team, so not using an existing design could be partly deliberate.
I've seen "claims" the ESP32 can do 0.1 mA in sleep, but haven't seen anyone actually implement that in a functional application.
My use case is different though, I will be adding an NRF9160 for connectivity so ESP32-based stuff just didn't make sense. It's also for academic customers who want to be able to work using MicroPython should I get hit by a bus.
The Raspberry Pi foundation focuses on accessibility and education. In that regard, the RP2040 excels. The price is especially advantageous and the beginner-focused documentation are great for introducing people to microcontrollers.
But I do agree that this feels like the Arduino situation all over again, where many people mistake the sudden popularity and influx of Tweets, YouTube videos, and headlines as an indicator that it’s the premier microcontroller on the market or the only logical choice for new projects.
It has a few unique and cool features, but we should periodically remind everyone that every microcontroller is a set of tradeoffs and compromises that the user should evaluate.
On the other hand, if you’re going for maximum clicks or views, putting “Raspberry Pi” in your headlines is a guaranteed way to bring in more eyeballs. It’s constantly a hot topic.
The price of an Uno is very low, considering that "Buying an Arduino" usually means "Buying a clone".
But yeah, the only reason I'd use an RP2040 is as a USB peripheral, and even then I'd use an ESP32 S2 or something.
I just... don't have much use for non-connected chips as a hobbyist. On a pro project, I get it that there's sometimes demand for non-connected stuff, but it's usually not super exciting.
Note that the price of a genuine Arduino UNO is essentially funding the development of the Arduino IDE and open source tooling and documentation. Pretty clever really, since few like to pay for ide or dev environment. The Arduino ide isn’t fancy but it helped spur change in the embedded world.
Nearly all of the stuff that makes the Arduino interesting comes from places other than the Arduino company itself, though - even the IDE and the user-friendly Arduino libraries that ship with it were basically just copied from the Wiring project. Their ports to microcontroller architectures other than the one Wiring was based on have also been kind of poor compared to community-developed and third party ports.
The actual Uno (i.e. AVR-GCC) toolchain I wouldn't expect to change a lot. But they do have a habit of releasing a crapton of boards on different uC archs.
And the libraries are written mostly by 3rd parties.
Given that RP2040 needs external flash, I'm quite worried about the performance when pulling uncached code from it (on top of using M0 core - I'm used to M4 by now). I know the MCU has 16kB of cache, but my firmware for which I'm still deciding on whether to port it to RP2040 or not is about 80k. Does anyone here has some real-life data on this?
With 80k of firmware, you can just put it all in RAM ;)
The M0 is not much slower than M4 when running at the same clock, and the RP2040 can run quite fast. Of course it's different if you comparing to M4F and need float32.
If you end up putting code in SPI flash and you need predictable latency, you will need to put ISRs and everything they depend on in RAM [0]. However, if you don't need down-to-microsecond latency, then it's just fine.
At least it's much cheaper than Arduino (like 2-3x compared to Uno). The price of Arduino Uno is not justified by anything when its NRE cost must have been recouped long ago.
[1] https://pico-adc.markomo.me/