Rendered at 16:57:12 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
superxpro12 5 days ago [-]
I remember wishing for something like this that emitted C or C++ code a few years ago. Micropython is a fine choice, but very limiting. It's nearly impossible to do anything hard-realtime with it. But if it fits the nice, which is usually some flavor of a communication bus abstraction, this is probably a nice toy to play with. Curious how hard you can push the pedal on this.
Can it saturate the adc sampling? Can it configure a 20khz systick? Can it link interrupts together?
How easy is it to stand up uart/i2c/spi concurrently? What about canbus and usb?
How does it handle threaded programs? IS that part of the Node-RED arch? Or maybe micropy?
mkarliner 5 days ago [-]
All very good questions. Which really have to be answered by real world testing.
On the subject of performance, there are really two points
- Microcontrollers are now a lot more powerful than they were, although clock speed isn't everything, an esp32s3 runs at 230Mhz and the RP2350(Rp Pico 2) can easily be clocked past 300 and have two cores.
- Also, MicroPython now supports two extra code emitters, Native and Viper, which create native code. They are already used on the spi display driver nodes and layout engine.
So I'm not sure it's as much a toy are you might think it is. OTOH, if this gets take up, I'd look at a lower level language.
Also, with AI somewhat more reliable now, making C/C++ addins is a much more reasonable proposition. Let me get this one tested and being used by folks and I'll think about how to create high speed paths :-)
At the end of the day, I'm trying to aim for use cases that aren't trying to squeeze the last drop of performance, but not toy use cases either.
mkarliner 33 minutes ago [-]
These questions have been niggling me all weekend, and I've been running a number of benchmarks to answer them. I'm not finished yet, but so far the viper code generator is around 10x slower than C code, plus or minus, which is much slower, but not as much as some people seem to think.
The specifics of running an ADC at 20KHz are that the Pi Pico's can do it, the Pico2 at 28ks/s and the RISV 38ks/s. At stock clock speeds.
It's prompted me to write a block input node that would run dma and emit sample frames for batch processing.
Can it saturate the adc sampling? Can it configure a 20khz systick? Can it link interrupts together?
How easy is it to stand up uart/i2c/spi concurrently? What about canbus and usb?
How does it handle threaded programs? IS that part of the Node-RED arch? Or maybe micropy?
On the subject of performance, there are really two points - Microcontrollers are now a lot more powerful than they were, although clock speed isn't everything, an esp32s3 runs at 230Mhz and the RP2350(Rp Pico 2) can easily be clocked past 300 and have two cores.
- Also, MicroPython now supports two extra code emitters, Native and Viper, which create native code. They are already used on the spi display driver nodes and layout engine.
So I'm not sure it's as much a toy are you might think it is. OTOH, if this gets take up, I'd look at a lower level language.
Also, with AI somewhat more reliable now, making C/C++ addins is a much more reasonable proposition. Let me get this one tested and being used by folks and I'll think about how to create high speed paths :-)
At the end of the day, I'm trying to aim for use cases that aren't trying to squeeze the last drop of performance, but not toy use cases either.
It's worth remembering that for stuff that really takes some cycles, you can drop down to machine code, like this fft from Peter Hinch. https://github.com/peterhinch/micropython-fourier