The RP2040 Stamp
github.com
github.com
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.
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.
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.
Are you using micropython? This sounds like a treat.
But it is a microservices architecture!
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.
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.
edit: typo
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.
In that context, 180uA is pretty bad, but again, the datasheet is not very clear.
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.
However the PIO state machines set it apart.
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.
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.
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.
And the libraries are written mostly by 3rd parties.
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.
[0] eg https://github.com/lancaster-university/codal-rp2040/blob/ma...
ADC
DNL
NIH
NRE
If you want it cheap - this project is fully open source - one can make the board themselves, might be possible even order it assembled in larger quantities from PCBWay or JLCPCB.
I'd probably say suck it up and solder the QFN directly if you need all the GPIO in minimal space, though.
I've had stuff that wanted 3-5 pins, or maybe 10 pins. I've had stuff that wanted 100's of pins. I can't think of anything that wanted, specifically, between 27 and 30 inclusive.
Does the Pico really fail to bring out 4 of them anyway? That is kind of surprising. I know that it uses one of the ADC's for battery monitoring, leaving just 3, but maybe you can get it back by cutting a trace or something.
Is it practical and useful to connect 20+ of the pins to PIO ports? The PIO's are very limited.
This brings out 20 and has castellated pads: https://www.adafruit.com/product/5302
This is bigger but fancier, has a lipo charger and other stuff. I think it brings out all available pins, though the # mentioned is 21. More of an SBC than a solder-down, I guess. I have one (old version) but am trying to figure out where I left it: https://www.adafruit.com/product/5302
The southern region seems to have so much exciting tech going on, it really feels like it's starting to do laps around the Stockholm region.
The city embraced digital culture decades ago with a crazy amount of game dev jobs per capita and even a brief precense in Second Life. Now it seems full of startups and it's nice to see smaller projects pop up as well!
To get to Massive you have to go to Triangeln since it's closer to Mollan these days.
Paradox is mostly in Stockholm, not really in Malmo. IO is mostly Copenhagen, Avalanche is primarily Stockholm too.
I guess there's Tarsier?
So, Tarsier, Sharkmob and Massive, the rest being sattelites. :\
What else is there?
Some cheap, learning platforms like the micro:bit do emulated PWM which yields jittery servo demos. Sure you could put a circuit to smooth the on/off cycle, but as an instructional tool, I like the external hardware to be as minimal as possible.
BTW, the problem with servo is not about "flickering not fast enough" but about length of the pulse. Servos require ~0.5-1.5ms pulse every 20ms, where the length of the short pulse maps ~linearly to angles of the servo. If you miss the timing by say 50us you get jitter.
It just has a few hundreds KB of Ram.
It usually runs bare metal or some RT OS.
The stamp draws its legacy from the BASIC Stamp, a small stamp sized (by a stretch) module that could be programmed with BASIC.
It's not a standard form factor.
Think it can output 4k video?
It's also a microcontroller, which in general don't output video signals at all. You might be confusing it with a Raspberry Pi.
I'm thinking about creating a programmer with 3D printer and some spring contacts, but I really would love some tiny device with RP2040 inside where I can put another RP2040 and have all pins available for further connecting if necessary. Right now it's a mess of wires.
Another RP2040 aspect which I didn't like is a complexity of boot process. Now I have no idea whether it's common to microprocessors or not. What I wanted to do is to write my software with pure assembly without any SDKs. So far my research is as follows:
RP2040 contains unmodifiable boot1 code. You can't modify it at all. It contains some preliminary initialization code and some procedures like float point operations, etc. That looks very weird to me: why put that code in unmodifiable ROM. There're few revisions of this ROM with different procedures (I guess they optimize them in later revisions).
Boot1 connects to flash and loads 256 bytes of boot2 loader which contains 252 bytes of code and CRC32.
Boot2 is compiled from SDK. It configures flash for some kind of faster access mode and calls sdk initializtion procedures. I didn't investigate further yet.
I managed to learn ARM Cortex M0 assembly, at least most of it, and it's interesting to try to program with it. But now I'm stuck with reading about flash, those QSPI protocols and their commands to make sense of their boot2 bootloader (I could just re-use one from SDK but I don't like this way). And then I still need to understand how to configure the whole stack to run code from flash.
Basically to re-implement writing hello world to UART, I have to learn a lot of things. Which is fine, I guess, but I didn't imagine this being that hard. I thought that I would need to learn about UART hardware and how to interact with it and that's about it.
And I really don't like their SDK. I managed to get it up and running, but they're using cmake which is cryptic for me, it takes seconds to compile my software, I have enough of that in my Java work. I guess that's fine for professionals who need to get things done.
That's not to say that I don't like this project, I still think that's the most friendly ARM, at least when I tried to use STM32 it was much worse. RP2040 datasheets are very readable for beginner. I just wish their setup was not so convoluted.
At this stage I'm considering to drop flash usage at all. I have 256 KB of RAM anyway, ought to be enough for anybody, right? Just copy my program from flash to RAM and run it from RAM. On the plus side is predictable performance. I still don't understand how can one write timing-sensitive code with flash where jump to non-cached address could stall CPU for some unspecified number of tacts.
For programming the RP2040 you can use any SWD debugging probes (which you can also use to debug the chip, single stepping, setting breakpoints and more).
Many like the Segger J-Link (the EDU Mini might be an option), while I prefer to use daplink based probes, of which there many available.
The RP2040 is especially egregious with it's RAM caching, but many ARM Cortex chips, especially the faster ones, utilize some sort of caching, since internal flash might not be fast enough.
Often dedicated peripherals are used (the PIOs for the RP2040) and/or critical routines are copied into RAM (but usually not everything).
Yes, the picoprobe is the official programmer/debugger. It's super cheap, easy to set up, and I'm not sure why you'd want anything else.
I'm curious what you think made the STM32 worse however, as in my experience they have good documentation and good options for the development software (and also a few not so good ones)
It's particularly fun if you want to write a driver for all TIMx - you have to de-dup in your head.
I find the LL (low level) library from STM relatively nice; OTOH their (high-level) HAL is plain awful. Simply writing registers isn't too bad either, especially that even in that case what you write will mostly work across their different microcontrollers.
In general, I find the NRF52 docs and hardware to be much more straightforward but it could be that they don't have to support every single feature on the planet like STM ;)
edit: typos, wording
Nice touch!