What's after arduino - Page 1
Forum section: electronics / general

author: CyberGeek
author_rank: Newbie
timestamp: January 07, 2022, 06:33:33 pm
content: I've been working with arduino a while and want tap into the wisdom of the folks here on the next MC I should pursue subsequent to Arduino. Below are some criteria that to narrow down the candidates.1. An established MC that has:a. A proven toolsetb. Wide community supportc. The MC and subsequent iterations will be in the market for the foreseeable future2. The cost per board (think Arduino) is sub-$15US give or take3. The programming language is C or Python (I'm not opposed to learning a new language if the benefit outweighs the cost.)4. The processor speed and memory are increased as compared to Arduino to facilitate projects of higher complexity.5. Peripheral devices are available with a significant quantity of libraries are available. (I'm not opposed to programming libraries, but don't want to do that exercise as my first learning experience. )6. Will expand my knowledge of electronics and practical application of MCs.I've been in IT for over 25 years with experience as a developer, server and storage engineer, architect and now cybersecurity. My electronics experience is from analog repair back in the 90s. My attraction to electronics was rekindled about 2 years ago. So I've had to take refresher courses to clear the cobwebs. Hopefully, this information provides some insight on my skill level. I'm not afraid of a challenge or digging for answers..Appreciate the feedback.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 07, 2022, 07:27:57 pm
content: Is this for commercial products or for hobby use and learning purposes?For the latter, there are of course tons of options, but I can suggest the RP2040 from RPi - it appears to tick all your boxes while being cheaper than typical Arduino stuff. There's of course the official Pi Pico board (if you're looking for a dev. board rather than just the chip), but now quite a few other boards have appeared using this MCU - from Sparkfun, Adafruit, and others. Most are sub $15, the Pi Pico is about $4. Both C and CircuitPython are supported, and even if it's still a modest MCU, it's infinitely (well almost) more powerful than anything ATMEGA-based.

author: artag
author_rank: Super Contributor
timestamp: January 07, 2022, 07:37:23 pm
content: There are quite a few devices in the Arduino family, and more that are supported by the same toolchain but not produced by the Arduino organisation. They have the advantage of using familiar libraries and being able to use many of the generic extensions whilst providing a lot more rom, ram or peripherals than the common AVR arduinos.I would particularly suggest Teensy (more expensive but extremely good support from the vendor, PJRC) and ESP 8266 or ESP32 (very cheap, built-in wifi).

author: jpanhalt
author_rank: Super Contributor
timestamp: January 07, 2022, 08:50:39 pm
content: PIC's from Microchip have a lot of peripherals compared to Atmega. Same manufacturer.

author: CyberGeek
author_rank: Newbie
timestamp: January 07, 2022, 10:11:53 pm
content: Hobbie use and possibly small scale commercial mostly to feed my electronics addiction.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 07, 2022, 10:55:50 pm
content: Anything with an ARM core maybe, or an ESP32 with Wi-Fi and a camera, random examples:From Freescale/NXP:https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25ZHas USB OTG, DMA, 16 bits ADC, 14 bit DACs, Free Real Time OS, etc.From Texas Instruments:https://www.electrokit.com/en/product/tiva-c-series-tm4c123g-launchpad-development-board/Has extensive YouTube classes teaching ARM programming with the above board:Code:https://www.youtube.com/watch?v=3V9eqvkMzHA&list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM&index=42From EspressifSome more recent MCU boards with Wi-Fi and micropython, some with embedded cameras, etc:https://en.wikipedia.org/wiki/ESP32From Raspberry PISlightly bigger, a SBC (Single Board Computer), most can run Linux or other OS (Operating System), but they also have some very small RPi Zero, or maybe Pico:https://www.raspberrypi.com/products/

author: Howardlong
author_rank: Super Contributor
timestamp: January 07, 2022, 11:37:50 pm
content: There are microcontroller and microcontrollers, starting at 6 pinners like the PIC10F series for example, starting with 256 words of flash & 16 bytes of RAM.IME, the biggest drawback of relying on vendor peripheral libraries and frameworks is that they have a life span similar to that of a mayfly. It's almost as bad as developing cloud-based apps. They rarely provide backwards compatibility when a new rewrite comes along. Because of their lack of longevity, it's notoriously difficult to maintain legacy code.The following particularly applies to lower end devices, but it does extrapolate.While you say you're not interested in developing your own libraries, you're going to learn and understand a whole lot more by doing so, and your code will have a lot longer lifetime: for example I still use the same boilerplate I2C libraries that I wrote very many years ago as the basis for new projects, tweaked here and there as necessary. In the same timeframe there've been at least four vendor attempts.Furthermore, vendor libraries and particularly frameworks tend to be highly inefficient: they're either kitchen sink implementations, or they lack features... or both. But they're never efficient.Professional microcontroller development is about managing scarce resources: eg, cycle counting where necessary and concerning yourself about power budgets. Frameworks, peripheral libraries and Python won't help you much with those things when it comes to squeezing out the most from a microcontroller. Throwing more hardware at it won't help your power budget!

author: nctnico
author_rank: Super Contributor
timestamp: January 08, 2022, 01:14:31 am
content: Quote from: Howardlong on January 07, 2022, 11:37:50 pmThat is ony true if you are after ultra-low cost or ultra-low power. For most projects that isn't an issue and it is very nice to have some extra processing speed and space to work with in a microcontroller. Nowadays I'd definitely go with an ARM based processor with plenty of speed and memory. Especially if the goal is to get a project done instead of working around (unforeseen) limitations of a platform.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: January 08, 2022, 02:02:31 am
content: Quote from: SiliconWizard on January 07, 2022, 07:27:57 pmI've got a heating system controller that has suffered a little due to poor insect ingress protection. Needs 6 analog 0-5v inputs, four digital outputs. I believe the 2040 has 4 inputs and aren't they 3.3v?The simple fix would be to buy another Arduino and just upload the same code. And, of course, seal the case. But I too wouldn't mind the challenge of something else as long as it isn't such an enormous leap.

author: jonovid
author_rank: Super Contributor
timestamp: January 08, 2022, 03:16:42 am
content: has at a guessanything micro that can dock with a phone & has an app for all that DIY

author: IanB
author_rank: Super Contributor
timestamp: January 08, 2022, 03:18:01 am
content: Quote from: CyberGeek on January 07, 2022, 06:33:33 pmGiven that Arduino is not a microcontroller, but is rather a packaging together of a software environment and a standardized hardware platform, have you at least progressed to programming an Arduino board as "bare metal"?Because, IMHO, that would be the first step after "Arduino". You would be programming an Atmel or other microcontroller at low level, using an appropriate toolchain.This is especially attractive as the Arduino board is already giving you a convenient platform to work with, not inherently much different from a development kit you might obtain for other micros.

author: CJay
author_rank: Super Contributor
timestamp: January 08, 2022, 12:09:00 pm
content: Quote from: IanB on January 08, 2022, 03:18:01 amThat would be my next move if I were stuck in Arduino hell, transition to a real programming environment with debug facilities, the C/C++ skills learned from Arduino will transfer as well but it's quite a big step to give up the plethora of libraries in the Arduino environment.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: January 08, 2022, 12:16:32 pm
content: Starting with STM32 will be a good choice now.

author: eugene
author_rank: Frequent Contributor
timestamp: January 08, 2022, 03:08:51 pm
content: Be forewarned that the Arduino Uno and Mega are 5V devices. Their digital GPIO are 5V and their analog inputs are 0-5V. Almost anything more sophisticated will be 3.3V instead, so interfacing with external electronics will need to be reconsidered.Having said that, if you're just looking for a more powerful and flexible board that you can program via USB using the Arduino IDE, then look at the Teensy line. If you're looking to roll up your sleeves and get closer to the hardware, then consider a so-called development board, perhaps something from STMicro like this:https://www.digikey.com/en/products/detail/stmicroelectronics/STM32L4P5G-DK/11613090. Outside your declared budget of $15, but not an unreasonable amount of money.Or go toAdafruit.comand choose something of theirs. Adafruit offers a tremendous amount of support to beginners and hobbyists.

author: nali
author_rank: Frequent Contributor
timestamp: January 08, 2022, 03:44:04 pm
content: Quote from: rpiloverbd on January 08, 2022, 12:16:32 pmI'm just getting to grips with STM32 using a Nucleo-L412KB board. It's sub-£10 and compatible with Arduino Nano in terns of pinout.https://www.st.com/en/evaluation-tools/nucleo-l412kb.html

author: Howardlong
author_rank: Super Contributor
timestamp: January 08, 2022, 04:42:07 pm
content: Quote from: nctnico on January 08, 2022, 01:14:31 amI did mention that these were particularly prescient with low end microcontrollers.I agree with the concept of “getting the job done”, using the tools at hand.Even with higher end microcontrollers such as PIC32MZ, M4 and M7, concentrating on pinch points will be the difference between meeting specs and project cancellation. Unless you dig into C and occasionally assembly language, and put on your bare metal jacket, relying solely on someone else’s libraries, frameworks and bloat is rarely going to provide an optimum result. More often than not, you’ll certainly fail to meet the device’s banner specs as a result, often by quite a large margin.So when someone asks why your Python device won’t stream an ADC at 10Msps, despite the device’s banner specs declaring such functionality, we will know why.So in short I agree, but typically at the stage of a project when I get involved, I’m digging around redesigning interfaces and algorithms in C and occasionally assembly language as necessary for those times when the optimiser isn’t taking the bait.I’m just wary that the OP isn’t really going to learn much about microcontrollers if they’re writing solutions in Python and/or relying solely on mayfly lifespan hardware abstractions and frameworks. I’d go further: it’s rare that for simple peripherals there is any need for peripheral libraries or frameworks: more often than not IME they just get in the way, you have to understand the peripheral’s functionality anyway, using a HAL just gives you something more to learn with when you could’ve been writing code.Please don’t misunderstand me: the frameworks like Arduino are an incredible achievement, it’s really encouraged a huge amount of people into microcontroller tinkering. But I fear that going to Python in particular is a backwards step of the OP is aiming for a deeper understanding of microcontrollers: it’s about ten abstractions too far ;-)

author: Siwastaja
author_rank: Super Contributor
timestamp: January 08, 2022, 04:58:23 pm
content: #1 reason for avoiding numerous and large layers of frameworks and libraries is not performance, although that is sometimes important, too. Code writability, readability and maintainability are the actual reasons. You can do a surprisingly large project in just 2000 lines of code within five-ten .c files, so that the whole project is within grasp of a single developer, and another one can catch up quickly, and modifications do not require "paradigm changes" because of lack of arbitrary limitations added by "frameworks".For a beginner, this is even more important. A 100-megabyte SDK, where Hello World requires a 2000-line logging library, and LED blinker requires ten files with BSP generator programs, leads to the fact that the beginner has no idea about anything, can only run the existing example, and if everything happens to go well,mightbe able to modify some parts of the example.Hence, I second the suggestion: keep the Arduino so far; learn to program it bare metal. Basically, this means downloading and reading the AVR datasheet and following it. Because bare metal AVR is simple, it's a step of correct size for you: not too big at once, but not insignificant or completely without challenges, either. After that, you can pick any popular ARM Cortex-M0, M3 or M4 based microcontroller and keep going. But that doesn't need to happen right now.

author: emece67
author_rank: Frequent Contributor
timestamp: January 08, 2022, 05:19:57 pm
content: .

author: nctnico
author_rank: Super Contributor
timestamp: January 09, 2022, 02:24:35 am
content: Quote from: Howardlong on January 08, 2022, 04:42:07 pmI tend to disagree. What I see is that vendor libraries have come a long way in the last 20 years and currently many of them are frameworks you can use for commercial products. I've seen enough examples of people using vendor frameworks in succesful commercial products. IMHO going bare-metal or using a framework depends on your own preferences and existing framework(s) at your disposal. Nowadays you can't go around saying one way is better than the other. It greatly depends on costs versus benefit which is a too project and situation specific trade-off to make blanket statements about.QuoteBut still, writing software in C is not without pitfalls (pointers, index overflows, memory corruption, etc). Using Python can be a good way to get more productivity from a team of software engineers. Not so long ago people where argueing that assembly should be used for total control over a microcontroller. Nowadays those folks are silent. Next on the chopping block is C, followed by C++ in favour of a scripting language. It probably takes another 10 to 15 years but at that time standard microcontrollers run at 100s of MHz with several MBytes worth of flash. Look at NXP's RT1000 series for example.

author: ttt
author_rank: Regular Contributor
timestamp: January 09, 2022, 08:09:40 am
content: I second the RP2040 (Raspberry Pi Pico) suggestion.Based on your criteria I would not recommend the Teensy line of boards which might be another choice. The community around those is just too small and it is not clear to me that a project centered around one individual has a real future.I would not go for ESP based boards either. Espressif likes to tout their latest products and I am not sure how long real support for ESP8266s will be around for instance which not even that old. Some of the available ESPxx boards are also utter garbage.As for the RP2040:Quote from: CyberGeek on January 07, 2022, 06:33:33 pm- The official toolchain is open source, based on gcc.- Arduino IDE is supported if you can't live without it.- You can use Micropython if you prefer higher level languagesQuoteThe RaspberryPi foundation has a good track record when it comes to community support. Most other commercial vendors are not even in the same league here IMO.QuoteFrom the official specs:"Raspberry Pi guarantee availability of the Raspberry Pi Pico product until at least January 2028."Quote$4 should fit the bill.QuoteYou got it.QuoteGoing from an 8-bit chip to a Cortex-M0 architecture running at 133Mhz (more if you overclock them) fits the bill certainly. We are talking 10x+ performance improvement here.QuoteThere are tons of peripherals and that can be extended with the PIO.QuoteOnce you get into the Raspberry Pi Pico you'll be introduced to 32-bit ARM based MCUs. You can easily leverage that to go beyond that and learn for instance i.MX RT based systems.

author: bingo600
author_rank: Super Contributor
timestamp: January 09, 2022, 09:15:51 am
content: Do you seek better uC understanding/skills ?I would agree with the posters that suggests you keep the arduio hw, and start programming "Bare Metal" on the ATmega.Do you "just" seek a faster uC w. more Flash/Ram etc. , and are still happy with the "Arduino way of doing things"Then i'd suggest either :Teensy (Crazy fast)orSTM32https://www.stm32duino.com/STM32 "BlackPills F401/F411" are "Cheap" , the "BluePill" even cheaper (but prob. a clone mcu).The Raspi "mini" is lacking in timers etc. , and imho not suited for as much as the above(s)./Bingo

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 09, 2022, 06:32:30 pm
content: Quote from: Ed.Kloonk on January 08, 2022, 02:02:31 amIf the question is, how easy it would be to replace your Arduino-based solution (that I suppose is ATMEGA-based, because, as others have said, there are now many, many different MCUs and boards supported by the Arduino framework, and many of them are much more powerful, and many are also NOT 5V.)So yeah, the RP2040 has only 4 analog inputs. And of course, it's a 3.3V device, so you'd probably have to make modifications regarding all IOs you use. But maybe those would be trivial, we'd need to see the schematic. You may or may not need level shifters.For the analog inputs, ditto, we'd need to see your schematic. Possibly, using a resistive divider might be enough, depending on the output impedance of whatever is connected to the analog inputs, and the sampling rate. But for the number of inputs - nothing much you can do, except adding a small analog MUX. Something as common as a CD4066 might fit the bill. Or, you may alternatively use an external ADC with at least 6 inputs.But since the RP2040 is not (yet at least) supported by Arduino, on top of the hardware modifications, you would need to rewrite the whole firmware for a completely new and different target, so make sure this is what you are ready to do.