7 comments

  • superxpro12 6 days ago 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 6 days ago 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 18 hours ago 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.

        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

  • mbanzi 14 hours ago ago

    I only looked at the demo video. I appreciate the effort of creating something that would help people code MCUs visually but It's not going to be useful to a larger audience. For example to connect a timer to a pin you need to manually write a function using a node. Right there you're going to lose a lot of beginners. Casting different data types should be dealt with behind the scenes in a visual tool. The examples show how you still have to write a bit of code by hand and I feel it would be faster to teach my students to edit python code directly. Finally one feature that is missing from every visual tool that I know of is the design and implementation of State Machines. When you program MCUs to do anything a bit sophisticated you have to build State Machines. That is usually a pretty important part of my classes, this tool doesn't seem to solve that. I've been doing this for 25 years and I have co-founded Arduino so I am well aware of the pain and complexity of building tools that are easy to use. You need extensive user testing with real users.

    • mkarliner 8 hours ago ago

      Gosh, I feel quite honoured that you've weighed in.

      A couple of points: - This is not a beginner's tool, it's stated quite plainly on the front page, so I'm not trying to teach people to program.

      - In terms of usabiliy, I can only point to the sucess of Node-RED, on which this is closely modelled, and fits in roughly the same niche.

      - The state machine point is interesting and well made, I've a long career in coms and OS work, so I fully appreciate your point and will have to think on it.

      Thanks for the comments.

  • CamperBob2 17 hours ago ago

    Honestly, all you need to program microcontrollers is a decent LLM. No need for a particular toolchain and workflow, even a simplified drag-and-drop environment.

    Tell it what you want, give it access to the COM port or JTAG header, and go have lunch. It'll be working when you get back.

    • mkarliner 17 hours ago ago

      Author here:

      Thanks for making the point. You might want to read this short blog post https://blog.karliner.net/posts/thingstudio-common-ground/

      The general point is that yes, you can ask an AI to write this for you, but AI code is notoriously tricky to read. I actually do use an AI to write ThingStudio flows, and I can understand what it produces at a glance. The constrained environment and big functional blocks tend to keep its output crisp and hand editable.