Life after mBed and the next step from Arduino  - Page 1
Forum section: electronics / general

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 11:29:52 am
content: I've developed loads of stuff - "contraptions" - in Arduino, but want to further extend my skill set and learn new stuff.A few years ago I took the advice of Tim Wilmshurst, who was a colleague of mine and is the author of several books on microcontrollers, and he advised going to ARM mBed. I was never that impressed by the mBed world, for reasons which are probably irrelevant, but I did make one device using it (an audio flanger). Recently ARM announced end-of-life for mBed, which I think is a wise decision.However, it was a valuable experience; mBed was much more "grown up" than Arduino, and probably more like a professional product, so the experience wasn't wasted.So, like many people, I am asking myself, "Where next after Arduino?" Yes, I realise this is a frequent question, but the answer changes as time goes by.Like most people in my position I want an integrated development environment that lets me write, load and debug my code. I want my code to be able to talk directly to the hardware, but also work one layer up from that using a comprehensive set of libraries. I want to be able to write stand-alone programs, and also to write programs that run under a real-time OS such as FreeRTOS. I am up for learning the new skills and disciplines necessary.Because I'm only an Arduino hacker I realise that the list I've just given is itself incomplete (the bootstrap problem: I don't know enough to know what I want). Feel free to add to it or tear it apart.At the moment I only have eyes for the Pi Pico 2. This is because it seems to have a very professional and comprehensive infrastructure supporting it. The documentation is thorough and is in native English (not translated). Also, it's a British company so I like the idea of supporting them in my small way. Importantly, the Pico 2 platform is remarkably cheap and is probably more than powerful enough for any application I could think of.So, is Pi Pico 2 the best Arduino++? What other platforms should a person wanting to graduate from Arduino consider?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 12:12:09 pm
content: There are several choices to be made here.1) What IDE suits me best?Many have their own preference and mine is version 8.2 of Netbeans. It allows me to do what I want. Have not looked any further since, but maybe I should. A search for available IDE's can be done and will show things like Eclipse, Visual Studio, etc.2) What is it that I want my hardware to do for me?This is more of an issue. There are so many different MCU's to be found and also many and many different applications to be thought of.For instance, do you need a display, and if so what kind of display. Do you need a wireless connection, and if so what type of wireless. Wifi, bluetooth, etc.The new RPI Pico 2 sounds very nice, although somewhat unobtainable for cheap. Mostly sold out. But ask yourself what am I going to do with the two ARM cores and the two Risk-V cores. Often a single core is already sufficient for a certain job.Moving on from Arduino could be seen as evaluating your needs and interests and do more real research than just looking at some how to youtube videos and copy what they made.Or you can do as some of us do, buy every different MCU board you can find and play with them. I have all sorts of boards from STM32 based, ESP32 based, RPI Pico, AVR based, etc. Testing can initially be done with the Arduino IDE and framework, but after that it is basically bare metal what I do.Read the datasheet and reference manual, look online to find some bare metal coding examples to learn from if needed, and go from there to write up your own system.Using a real time OS can be handy at times, but there you also have to ask yourself if it is really needed. Often you can do without.

author: Psi
author_rank: Super Contributor
timestamp: September 03, 2024, 12:36:10 pm
content: I would recommend visual studio code.Watch some youtube videos and set yourself up a project, maybe stm32 or something.Get the debugging workingGet intellisence workingSome other things that are not all that interesting but are important to understand to some degree- Understand enough so you can work with either makefiles or cmake.- Understand enough about Linker scripts to get by

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 03:06:12 pm
content: Quote from: Psi on September 03, 2024, 12:36:10 pmYes that is a good point. For the more sophisticated MCU's that have memory scattered over the address range you need to know how to set these up in the linker script and how to use the ranges in your code.As an example, for some actions you want to use the core coupled memory because it is faster. For this you have to tell the compiler and linker about the existence of this memory. In the linker script you define sections and in the code you use __attribute__((section("xxxxx"))) to assign something to the section in question. "xxxxx" needs to be replaced with the name of the section you gave it.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 05:47:44 pm
content: Quote from: pcprogrammer on September 03, 2024, 12:12:09 pmYou raise a good point. It does kinda seem wasteful to use a device with two ARM cores for many hobby projects, although the unit price is so cheap it is more of a philosophical objection than a rational one.There is an argument that more processing power often means more energy consumption, so a lower power devicemightbe better for battery powered applications. On the other hand, power management is improving all the time, and the Pico 2 (for example) has better low power modes than the original.Come to think of it, a basic Arduino Micro Pro has enough processing oomph for many of my projects from times past.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 06:05:11 pm
content: Quote from: SteveThackery on September 03, 2024, 05:47:44 pmTrue, and for what it is worth I was not considering price. I have 9 Pico boards in my stash with 2, 4 and 16MB of FLASH, which often is also a bit of a waste, so much FLASH space.But for audio synthesis both the extra core and a lot of memory for samples can be beneficial. Just bought a bunch of 16MB PSRAM chips for a project with a PCM1808 ADC and a PCM5102 DAC module to do some effects. For now just to play around a bit. No chiselled in stone ideas yet.Quote from: SteveThackery on September 03, 2024, 05:47:44 pmAlso true but a lot of what I do is wall powered so not much of an issue. Did make a wireless remote control system but even running at 72MHz the consumption is somewhere in the range of 30mA. Can run quite some time on a bunch of batteries.Quote from: SteveThackery on September 03, 2024, 05:47:44 pmYep, the simple AVR based MCU's can do quite a bit. Even synthesis. The only drawback at the moment is the price being higher than a lot of the more powerful MCU's.