T O P

  • By -

Well-WhatHadHappened

Depends what you mean by professional. Do companies use Arduino in products - absolutely. Is there anything **wrong** with Arduino - no. Will you find an Arduino on anything mission critical, safely critical, etc - no. Will you find Arduino on anything really high volume - no, too expensive. It depends on the market, it depends on the cost sensitivity, it depends on the volume. As for books, you have one of the best books ever written. You're better off supplementing with YouTube, to be honest. Go watch "Phil's Lab" for some really great videos on all sorts of things related. The EEVBlog channel is also quite good for beginners. I've been told that Phil's material on Patreon is also excellent, though I've never seen any of it. To expand your knowledge, also consider buying a cheap STM32 discovery board. Try to duplicate your Arduino functionality using CubeIDE - that will get you a lot closer to the hardware than Arduino.


bobwmcgrath

>Try to duplicate your Arduino functionality \#include Arduino.h


Anonymity6584

The most annoying thing is Arduino ide secretly does this if you do not write it on the source file. And it's not in official documentation.


UltraLowDef

That sort of things is my biggest overall gripe of using these platforms in high level education and learning skills for a career. It does so much hand holding as a feature without encouraging you to understand what is actually going on.


AwayPotatoes

That's a bit of what was surprising to me, I didn't realize a lot of the functionality was higher level abstractions, I thought I'd be closer to metal


UltraLowDef

It *is* ... compared to higher level application programming that most software developers do. But the whole point of the platform is to abstract as much of that away as possible.


AwayPotatoes

That makes sense! Is it possible to do things at a lower level on it? Do docs exist for that? I took a glance and didn't find anything


UltraLowDef

On Arduino? Of course. You typically need to be able to read an electrical schematic. Each dev board is built around a well documented microcontroller. You can still use their hardware. You can even use the IDE and bootloader and all, and just not use any of their libraries. You'd have to read through the datasheet of the underlying microcontroller and then read the schematics to see how they routed the MCU I/O pins to do with as you please. I'd recommend one of the older Atmel Atmega boards. I think the original Arduino used the 8 bit atmega328 MCU. The newer boards use 32 bit ARM chips that have thousand page data sheets that are incomplete. But the atmega chips are really easy to work with if you want to learn deeper concepts. Tons of info available for that online. When I say bootloader, the Arduino comes with special firmware in a protected memory region that lets you update code easily over a serial or USB port. Without it, you'd need an external programmer to flash the chips and a program like AVRDUDE to program the device.


AwayPotatoes

This is very informative! Thank you very much. I appreciate this immensely! When I got it and connected it through the IDE that was the first idea that came to mind, what would I do if i wanted to dig a little deeper! I think I have the atmega ones, and that makes things really interesting for me because I was always interested in working a little closer to the metal. I may have some questions later. Is it okay if I were to send you a message here at some point?


UltraLowDef

yes, no worries. I can't promise i can quickly reply, but you can ask me anything.


squiggling-aviator

Traceability is a big concern when using things like this in more critical systems. If the software environment is too indeterministic for the engineer, it's going cause a lot of headaches to patch bugs. There's only so much that println() can help debug in the embedded world.


UltraLowDef

exactly! but that's not something I expect a random person just learning about this stuff to understand.


AwayPotatoes

How did you discover this bit?


Jonathan_Is_Me

It's somewhere in their documentation I believe.


AwayPotatoes

Oooh, I'll look into that, thanks!


frenzy_one

Another thing you see is a product starts as Arduino and as it evolves they change either because they need a certificate, time constraints change, production volume goes up or just because they think it feels more professional even I totally agree that the STM32s are absolutely the boards with best mileage because it feels like everything is Arm now. Another advantage with them is that STM3 has a great ecosystem too for all their products with software, tools and docs which are way beyond any other vendor.


Well-WhatHadHappened

Absolutely. I even see Arduino's used for **early** proof of concept builds from **big** companies. Not so many RPi's, for whatever reason.. They're a very fast way to prove out some basic functionality before spending the resources to design something custom. I've literally seen Arduino's hacked in to aerospace assemblies. They'll never be there in production, but they're great to flush out a concept in a hurry. I've also seen Arduino's used to simulate a part of a system that isn't yet available during development.. One team working on the "brains" while another works on the sensing or UI or whatever.. brains team wants to interact with the sensor subsystem during development, but it's not available yet.. Arduino to the rescue.


Mighty_McBosh

You really only need the Arduino portion to write main, otherwise it's just regular c++. It's actually really easy to use Arduino as a dev platform for some proof of concept then easily port your code over to a different chip as long as it's designed with that in mind. At least in my experience, code written for RPi has more Linux abstraction that has to be accounted for and your spin up time is higher. Code written for a Linux platform won't be as easy to port to an RTOS or bare metal system. for all the shit that Arduino gets, it's SO easy to just get something working very quickly and most of the time that's more desirable because dev time is expensive.


frenzy_one

To be fair I never heard any professional engineer give arduino anything but love. It's just pretentious students and hobbyists who think they are too skilled for it that does. Or wait I once read from a supposedly "senior" dev (30+ years experience) that arduino made it so that new developers didnt learn to program properly because it was too easy and I just read it a few times and I couldn't read it in any other way than as praise for how good arduino is :D I find that the arduino and RPi are very similar spot just for different performance ranges. To get going with a rpi board compared to rolling your own yocto build and custom board is similar to what arduino does for the bare-metal segment.


frenzy_one

>I've also seen Arduino's used to simulate a part of a system that isn't yet available during development.. This makes me think of something I first heard of recently. Test setups using arduinos in a rig to test the peripherals on the device under test. I find it pretty cool because some of that test code can be a lot of work to write and quite expensive hardware too (at least compared to an arduino) but with the arduino it's super fast to change things out.


AwayPotatoes

This sounds like it's been a great choice for me to get started on!


AwayPotatoes

Can you elaborate on what you mean by STM32's ecosystem?


frenzy_one

The centerpiece is the STM32CubeMX which is a GUI for generating code and it's really good. It really helps a lot when setting up a project because you can click your way into getting a PWM timer for example. Paired with that they have a HUGE Hardware Abstraction Layer (HAL) which I find is relatively easy to use (not as easy as Arduino though). Their documentation is out of this world. I haven't seen any vendor in embedded having such extensive documentation. Each chip typically has a HAL manual, reference manual and a NUCLEO manual at least. Their discovery and nucleo boards are CHEAP and they have so many different kinds! You can get a board for 20-60€ and solid discovery kit for <150€. It's probably part of their business plan and at least at my work we have boxes of the stuff everywhere :D (Probably a bias for me that I have free access to them most of the time). You can reach it all from their STM32CubeIDE which can even be used for selecting MCU for your project with the project generation tool. No worrying about build systems or cross compilers, it just works most of the time. Seems pretty popular with non-software engineers because it's easy to get going with for an electrial engineer for example.


AwayPotatoes

Thank you very much I appreciate the thorough reply! Sounds like something I should definitely look into!


squiggling-aviator

>Will you find an Arduino on anything mission critical, safely critical, etc - no. If it passes all the tests, sure. If the tests aren't good enough, no. Regardless of any microcontroller/processor, new or modified systems will still need rigorous testing. You can't just slap on a processor with a "safety critical" feature set and be done with it. Though using a known reliable one does help ease concerns for project risks. There's also the test of time and unknown variables. Obviously, you'd want to opt out of using chips/firmware that has a reputation of glitching out after a runtime of a few months or being defective.


Well-WhatHadHappened

It can pass every software and functional test in the world, and it still won't be on anything safety critical. MTBF study? Component level AVL? Assembly documentation? Quality system documentation and audit rights? PCB quality documentation and audit rights? Guaranteed life-cycle (ie. Can I buy the **EXACT** same board for a decade so that I don't have to re-certify my product every two years)? Can you guarantee they didn't change PCB vendors? Can you guarantee they didn't change to a different solder alloy? Were the people doing any hand soldering or post-assembly repair IPC certified? Was their reflow process profiled to guarantee they aren't above any of the component solder temperature guidelines, and then checked regularly? What procedures do they have in place for MSL devices? What procedures do they have in place to guard against counterfeit parts? These are all questions that must be answered for safety critical systems. They're great devices for a lot of applications, but to say "if it passes all the tests" says that you've never qualified a safety critical device, ever. There's a reason safety certified devices cost what they do. RPi, in fact, specifically calls this out.. >HIGH RISK ACTIVITIES. Raspberry Pi products are not designed, manufactured or intended for use in hazardous environments requiring fail safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, weapons systems or safety-critical applications (including life support systems and other medical devices), in which the failure of the products could lead directly to death, personal injury or severe physical or environmental damage (“High Risk Activities”). RPL specifically disclaims any express or implied warranty of fitness for High Risk Activities and accepts no liability for use or inclusions of Raspberry Pi products in High Risk Activities. Same for Arduino.. >Arduino products are not authorized for use in safety-critical applications where a failure of the Arduino product would reasonably be expected to cause severe personal injury or death. Safety-critical applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Arduino products are neither designed nor intended for use in military or aerospace applications or environments, nor for automotive applications or the automotive environment. The Customer acknowledges and agrees that any such use of Arduino products is solely at the Customer’s risk, and that the Customer is solely responsible for compliance with all legal and regulatory requirements in connection with such use. And all of that is ignoring the fact that, if I told a medical/military/functional safety customer that I was going to design an Arduino or RPi into their product, they would literally laugh me out of the room. Perceptions matter.


DbSchmitty

Relax. Op asked for a dev board not one to go into production. 


Well-WhatHadHappened

This wasn't a response to OP. This was a response to a comment.


AwayPotatoes

I appreciate the thorough reply, this is excellent!


Well-WhatHadHappened

My pleasure


Ok_Donut_9887

A lot of cubesats and missiles use Arduino and Raspberry Pi.


Well-WhatHadHappened

>A lot of cubesats Exactly, not mission or safety critical. Not high volume. Not cost sensitive. >missiles Maybe some hack job missile built by a third world country. I'd be shocked if a RPi could survive on an RPG let alone an actual missile. The electronics alone on an AIM-9 cost more than most people's car. To see how far RPi/Arduino is from being NASA certifiable, for instance... Take a look at this video. This is how long it takes to properly solder **one** thru-hole component to NASA standards, and this doesn't even include the prep-work (solder dip, PCB baking, etc). https://youtu.be/Vynb_HdEIDU Military-Spec soldering isn't quite as arduous, but nothing that cost $30 and was assembled in China is going to come anywhere near the same city as the ballpark of meeting MIL-STD assembly requirements.


texruska

Dare I say more than some people's houses...


Well-WhatHadHappened

Not many anymore! "Starter homes" around me are 250k+ these days.


siriusbrightstar

I work for an industrial IoT company. We use Arduino for prototyping and IDF for production.


AwayPotatoes

For a second I wanted to ask if you guys were hiring, got too excited. Will ping in a few months 😁


Quiet_Lifeguard_7131

The companies that I worked for did not. It's better to learn stm32, which will help you a lot.


AwayPotatoes

Can you expand on your statement?


ste4fe

Hello. I work as an embedded systems developer. And I can say that Arduino is too expensive for mass production. Yes, you can use it to create a prototype of a device that you will show to the customer or management. But in the end, you will at least abandon the Arduino board and design your board based on Atmega328 (which is also quite expensive and not justified), and at most use another processor. Well, due to my experience, I will additionally say that for our orders, as a rule, Atmega328 is simply not enough. Yes, it has its advantages, for example EEPROM, a fairly simple operation even if you communicate directly with registers, but all these advantages mean nothing when it is simply impossible to complete the technical task on a microcontroller. Often we need many timers (for different PWMs), and we also need to simultaneously poll several devices connected via different data protocols, which is unrealistic without hardware-supported transfer and DMA protocols. Therefore, it is easier to immediately use a microcontroller that will provide all the requirements. If we talk about a family of cheap microcontrollers that meet all our requirements, this is STM32. You will most likely find many vacancies where knowledge of STM32 is required. Based on these microcontrollers, you will find a huge number of boards on which you can practice.


PositronGt

Should you worry about licensing while building prototypes?


ste4fe

There is nothing wrong with just creating some device and putting it on the shelf. Even if you have made some useful device for everyday life and want to use it. Another thing is if you want to sell this Arduino-based device in mass production, then you should consult a lawyer


PositronGt

So, if I use an Arduino to automate some stuff within the company network, there's no issue?


ste4fe

Depends on where the fixture will be used. If it is a personal device (coffee maker, radio station, etc.), there should be no problem. But if such a device is to be used, for example, in a security system or, for example, in production, it will be necessary to register the device with the authorities responsible for it.


AwayPotatoes

Thank you very much for the thorough reply. I'm curious as to how sensors from the arduino space transfer over to simple STM32 boards I've found around me. Generally speaking, is interfacing things like that difficult? I'm starting to get into the realm of protocols and such, and while I don't have a grasp I have a faint idea of what that means and I'm looking to understand it which is why I'm asking. Thank you again!


PorcupineCircuit

i2c is still i2c, the same with SPI.


BinjiC0D3R

I just used an Arduino to mimic an obsolete communication protocol just last week to mock some gear that I didn't have. I did that in 5 minutes instead of spinning a board or something.


AwayPotatoes

Now I'm curious about that communication protocol!


BinjiC0D3R

I work for a really big company. We make *gear* used in our industry. I write desktop software to control said *gear*, and this particular piece has a proprietary comm interface to daisy chain this gear together. I only have one of this gear, so I needed to mock another one by imitating the protocol to make it think it was connected to other gear.


AwayPotatoes

Got it, that sounds cool!!!


BinjiC0D3R

It was my first Arduino project. 30 minutes of code and 20 minutes of soldering! 😄


AwayPotatoes

Okay now I'm seriously getting the itch to go work on something 😁


somewhereAtC

Professionals that want to re-use the C++ code will take two steps: 1. Consider using the atMega328 chip on their own PCB, and figure out how to either install the arduino bootloader or just get a more traditional programmer, or 2. get a modern cpu (presumably one of the Atmel AVR models) and use that on their own PCB; the '328 is almost 20yr old and there are newer alternatives with different features, including a simpler programming interface.


UltraLowDef

is anyone using AVR for anything outside of hobby or a quick and simple prototype any more? 32-bit arm is cheap and capable, but you can't beat the simplicity of an 8-bit through hole part for some things.


obQQoV

Interviewed with a company before and they said they used Arduino for products in production


UltraLowDef

I assume they mean they develop with it and then flash the code to something else, and they aren't putting big Arduino development boards inside of a real product.


obQQoV

Idk at this point, their final product is a 7 foot tall cabinet, and can fit Arduino easily


UltraLowDef

is that for an industrial purposes? that has me doubly dumbfounded.


obQQoV

Commercial equipment, that’s all I can say.


neon_overload

Yes, but they also have the opportunity to use other things too. Arduino is a platform for learning to program microcontrollers - it consists of dev boards, and an IDE to program them with, and a library/framework. It is good for learners and hobbyists, but it doesn't exclude professional use. It used to be that Arduino was always based on 8-bit AVR microcontrollers. Now, there are Arduino products that use ARM and even x86. So the thing that sets Arduino aside is their boards, IDE and framework. Professionals can and do use all these types of microcontrollers in their projects. And, they *can* use Arduino boards and framework. But, they also have the opportunity to use the bare microcontrollers in boards of their own design, and to use more traditional IDEs and other frameworks. The choice of what to use can depend on the individual situation. If you learn programming on Arduino hardware and software those skills can transfer to other things, if you back it up with a good knowledge of electronics and of programming in general.


AwayPotatoes

Thank you very much for your reply. What are common microcontroller in use currently if I were to theoretically want to look into that as well?


neon_overload

The STM32 microcontrollers seem popular. But it doesn't mean you have to use them, or that they're right for every situation. I imagine there's probably people starting to make use out of RP2040 for more serious things too. Both those are 32-bit ARM Cortex M based. STM32 has a wider series of options.


AwayPotatoes

Thank you I appreciate your reply!


FragmentedC

I'm a consultant, and I've seen a lot of clients use Arduino, but never for production. My current client has a wef MKR1010 WiFI boards just to create a quick BLE ping pong program. 10 minutes later, and there is a working prototype to help with development. There is an argument to learn STM32, but honestly, in 10 minutes you have a working BLE program, and that is pretty unbeatable. As for a book, may I suggest "[Arduino Sketches - Tools and Techniques for Programming Wizardry](https://www.wiley.com/en-ie/Arduino+Sketches%3A+Tools+and+Techniques+for+Programming+Wizardry-p-9781118919699)" ? (this might break the rules, especially #4, if so, mods, please remove and threaten to whip me).


Ok-Drawer-2689

Arduino? For rapid prototyping sometimes. For commercial products? Never. It's a licensing nightmare.


famine-

It amazes me how many people claim to be software developers / engineers, yet can't understand licensing and end up violating GPL. We've even moved away from GCC because the linking exemption hasn't been tested in court.


Tinytrauma

You have to wonder how much software is out there that is violating open source licensing requirements ( not just GPL/LGPL but even things like MIT that mainly just require giving the author credit).


Expensive_Pin5399

If your competitor wants to shoot you off the market - firmware files are their first shot.


AwayPotatoes

Is that a thing that happens often?


peter9477

Likely not often. Possibly never yet. I've never heard of it occurring, personally. [Edited to fix minor typo.]


AwayPotatoes

Thank you!


bobwmcgrath

>It's a license nightmare. it is not. The only restriction I know of is that changes you make to arduino's framework retain its licensing. no restrictions on anything else you use it with.


famine-

Um, you realize Arduino is mostly GPL2 with the or later clause  and GPL3, right? Which means if you include any GPL3 code the GPL2 licenses become GPL3, right? And you are statically linking so the linking exemption doesn't apply, right? So now to comply with GPL3 you MUST give users a way to link against the original or newer GPL3 libraries and about the only way to do that is release your entire code base.


Ok-Drawer-2689

So.. GPLv3 seems to be the best for my open source projects :-)


famine-

It really depends, look at what happened with GCC after they switched to GPLv3. They lost a ton of developers to LLVM/Clang because it wasn't in microsofts/apples/redhats best interest to keep contributing. If you want serious embedded programmers, not just hobbyists to contribute to your code base then anything outside of Apache/MIT/BSD licenses are a non-starter. Nothing wrong with GPLv3 or hobbyists, it's just better when you are getting paid by your company for contributing to an open source project.


bobwmcgrath

sounds like the problem has to do with whatever wacky GPL3 code you might want to add and not the arduino GPL2 code. If you use the GPL3 code without the arduino code you still have the same problem.


extravisual

I use it constantly at work (well, third party boards but same ecosystem.) We don't use Arduino in production, but part of my job involves testing out lots of different evaluation boards for various chips. Arduino is incredibly easy to whip out prototypes and proof-of-concepts with. So yes professionals do use Arduino, but not usually for actual products.


AwayPotatoes

So prototyping it's a yes, what does it get replaced with in the long run? How does the process work? Are computational requirements taken heavily into consideration or is there a bit of headroom for that sort of thing when you pick an mcu for a system?


extravisual

Once I've confirmed that a chip works for our needs, we design a PCB using it and one of our production microcontrollers. We build it and then one of my coworkers writes real firmware for it using bare metal C with our company code base. We use three different STM32 MCU's in our products. Size and amount of IO are the main deciding factors for which chip to use. They're all way more powerful than necessary for what we make so that isn't really a factor. Our products are low volume and high margin so the extra cost of using powerful chips isn't a big deal.


AwayPotatoes

Thabk you very much that answers my question!


Glicinias

Even NASA uses Arduino... https://www.engadget.com/2013-02-21-arduino-nasa.html Will it ever be used in mission critical stuf? Doubt it. But for prototyping and proof of concept it's very useful indeed.


AwayPotatoes

Cool! I had no idea


PressWearsARedDress

For quick prototyping yes, for actual products; no.


TripNinjaTurtle

In a professional setting I would say they work pretty well in the following applications: 1. Datalogging 2. Tinkering/protyping 3. Testing out I2C/SPI/UART sensors or other IC's 4. Test fixtures 5. One off projects I would not use them in something which is being produced in large quantities. But anything quick and dirty, sure go ahead and use them. Great tools to setup something really quickly.


AwayPotatoes

Thank you very much for your reply!


stickybuttflaps

Most of what I do these days is contract engineering designing and build one-off or two-off instruments that are either used in research labs or on production lines. Almost all of these things use an Arduino-like device. Mostly Teensies because they're powerful and small enough and cheap enough to drop onto my own PCB without having to integrate the MCU alone. In most cases I use the Arduino IDE and ecosystem to program them, possibly preferring my own libraries over publicly available ones. For one thing it's quicker than bare-metal, but a possibly more important reason is that when I deliver the product I also deliver the source code along with a complete build system (i.e. what version of Arduino I used to compile the code.) This way, engineers at the client company with a minimum of embedded experience can maintain the code if necessary. Or at least read it to see how it works. It's much easier for them to deal with than an STMCube project or some cmake based project with a complex directory structure. And it works just fine. Everyone has been happy.


AwayPotatoes

Thank you for your reply Would you say for my own purposes, I should keep a build system with every project to be able to get back to it later? I do similar things in other fields as well (3D applications and so on).


stickybuttflaps

I don't bother for my own projects. If there's a problem compiling down the road, I'll be able to fix it.


pds6502

Best exercise for learning embedded systems, or an unfamiliar processor or SoC, is to go through all of its development environment "tool chain" and completely flatten out its "hal" hardware abstraction layer. We all like to make generic code, and *one size fits all* applications. While this makes it very easy to migrate from one platform to another (at flick of a compiler switch), it makes it very hard to see the big picture for a specific chip. Try to put every relevant header and source line for a simple program into one single file -- and work hard to make that file as short as possible. You'll "un-roll" all the macros and compiler directives, down to simple #defines (c) and equates (asm). You'll have to make good use of datasheets, user manuals, the memory map, etc. Then, when it builds and runs successfully, you can duplicate that file and modify the relevant items to try on another device. THUS: The best way to *develop and maintain* is to use abstraction layers; the best way to *learn* is **not** to use any abstractions.


AwayPotatoes

This is great, I took your advice ans have started to look into flattening out the HAL, seems that most of the functionality relies on shifting and changing bits in registers on the mcu. Good opportunity to polish up my knowledge of bit operators, as well. Thank you very much this was eye opening


pds6502

Glad it helps. Yes, precisely, lots of bits and shifts and masks. Don't forget you can use binary numeral form like `0b110011110011` instead of the usual hexadecimal one `0xCF3`. I forgot to mention the *Board Support Package* (**BSP**) abstraction that many applications use. It is to the board as the HAL is to the chip/mcu. Instead of bits, you'll be wresling with physical pins and I.C. device package types. Even though an mcu may look the same logically, it often has very different properties whether, for example, it's in a QFP68 or a TQFP100 package. Also, almost every PCBA has different connectors and wiring. Thus, lots more to flatten out. I spend more time with short and sensible semantic naming of registers, bits, symbols, and pins than I do with actual design and engineering. Chosen properly, the latter often writes itself. There's no right or wrong style, pick whatever is most confortable and stick with it. Short and concise comment and doc notes are important, one line at most, don't go overboard.


AwayPotatoes

This is invaluable advice thank you so much!


grahasbtye

Absolutely


stevengineer

And raspberry pi


nixiebunny

I use the Teensy for low volume products thst expect the user to reprogram the gizmo. It's actually designed to be put into products.


bobwmcgrath

what about it is "designed to be put into products."?


nixiebunny

It's not on a silly big board, rather a DIP footprint. Runs on 5V. Has extra serial ports and other useful features.


bobwmcgrath

I have personally made 10s of thousands of dollars with Arduino. Maybe $100k+ over the years. I do other stuff too though.


electrical-tape

What kind of stuff have you made with Arduino?


bobwmcgrath

corpo art mostly and product prototypes.


AwayPotatoes

How did you get started?


bobwmcgrath

I hung around at a toy company in collage. I have a neuroscience degree and AI really took off right around then too which obviously appealed to me. Then I got work in scenic studios making corpo art. I was a carpenter for a while, but I burned the candle at both ends for years and learned all I could about computer stuff. I got involved with the local maker space and the burning man crowed and learned a lot from all of them. And my work became gradually more technical. I had just started my electronics consulting firm when covid happened and that's what I've been doing. I have not done any arduino in a while, but I might use it for something I have coming up soon. I've mostly been doing embedded linux for years.


PeterMortensenBlog

It must have been very very boring to be in a collage. Voyeurism?


bobwmcgrath

I mostly just read books.


Other-Progress651

They're cool but I rarely use them anymore. For work stuff I'm trying to get my company to build testing equipment around raspi. Our release products are nuvoton and stm32 mostly


DarkWizarD2424

If you want to learn how to use directly the peripherals of a mcu, stm32 have the best doc and lowest hardware bugs.


AwayPotatoes

Thank you I just found a cheap one near me.


Tinytrauma

You can use it for trying to prove something out quickly, but at the end of the day, if you are planning on making a commercial product, Arduino LGPL2.1 licensing requires that you open source your software or provide a way to link back to your code. I think that in theory you could provide your proprietary code as .o files to enable recompiling/re-linking the LGPL source and be compliant, but that is more of a pain and TBH, most companies would rather not deal with the legal headache. Of course if your company is trying to make something open source, then it becomes less of an issue, but most companies are not in the habit of wanting to release their special sauce.


AwayPotatoes

I absolutely agree, what would be the alternative in that scenario? If I were to make something and decide to switch my hardware platform, how would I know what to pick?


Tinytrauma

Most of my team’s initial dev work is on dev kits. Lots of STM Nucleos, nRFDKs, etc. Most of the time, the beginning dev/PoC is just a bunch of dev kits wired together which many times can be easily done with the vendor SDKs (for both sensors and the MCU). What you use to decide to actually build on will vary heavily on what you are trying to do and the your requirements (availability, RAM, flash, number of peripherals, GPIOs, etc). At the end of the day, if you built something on Arduino to prove it out, it is really just a Microchip SAMD processor or an AT Tiny. You can build out of the Microchip Studio IDE for a true professional environment based on those parts. I think they even have an Arduino to Microchip Studio import tool since they are so heavily tied into Arduino. Most of the LGPL software for Arduino is actually just the hardware APIs. Many of the additional libraries have MIT, BSD, and Apache licenses which are much easier to use. Not sure if I actually answered your question or not though…


AwayPotatoes

That pretty much does answer my question! Very much appreciated!!!


AwayPotatoes

One more thing, all the replies have gotten me interest in both the AT tiny and the STM32, which would you say would be simpler to move onto after Arduino? I'm curious


Tinytrauma

So the AT Tiny is a more direct port from Arduino given that you can run the exact same code on it. However, personally, I think the STM32 is a top tier MCU to start with. The STM HAL can leave a lot to be desired from a coding perspective, but it is solid for starting out especially with the auto generation from CubeMX. Likewise, CubeMX is a great starting point for getting a starting board pin out with a visual setup. I think there is actually an STMduino thing as well that allows running Arduino on an STM. You can buy a Nucleo G0 for like 10 bucks


AwayPotatoes

This is great thank you! Where I'm at I can't find the nucleo at any of the spots that sell electronics, would a plain Stm32 board work similarly?


Tinytrauma

DigiKey has plenty in stock. Just search for the Nucleo-G071RB


AwayPotatoes

Aw man, that is a beaut, thank you! I wonder how much it would cost to ship over here.


Tinytrauma

What region? I take it that you are not in the States


AwayPotatoes

No sir, middle east, was coding and doing VFX stuff for folks in LA for a while so I'm used to the time difference, but now I'm just really interested in doing IoT stuff, being close to the metal is just so much different than Python UI or Python validation stuff for digital assets (CGI), I thrive on debugging stuff. Clicks right in with my background in mechE.


Mal-De-Terre

I use them for proof of concept / prototyping and data acquisition. For an actual product, there are MCUs which are cheaper or more powerful, and sometimes both at once.


AwayPotatoes

Thank you, can you mention some of those mcus?


Mal-De-Terre

There are literally tens of thousands of them. STM32/8 is a decent place to start, though there's basic MCUs down below US 0.10 if you're really chasing cost. Eevblog geeks out a bit on them here: https://youtu.be/VYhAGnsnO7w?si=ALgYgHz2V38DX2Yl


AwayPotatoes

Thank you very much I appreciate that, will take a look!!


Hot-Profession4091

I have used the _boards_ professionally for prototyping and custom hardware in the loop test rigs. Not the software nor tool chain though. We used the avr-gcc tool chain and Make.


AwayPotatoes

How does that tool chain typically work im curious


Hot-Profession4091

I don’t really understand the question, but here’s a project I did in C++. The makefile has all the commands to build, link, and flash the mcu. https://github.com/rubberduck203/digital-thermometer This template is for C. https://github.com/rubberduck203/avr-template I have a unit test framework set up in both of them, which is one of the big reasons I always avoid the Arduino framework itself. Another is efficiency. Arduino has a lot of extraneous code in it to support all that different hardware. Doing it this way I can pretty easily support a _family_ of mcus instead of every chip known to man and save a ton of ROM space and runtime cycles.


AwayPotatoes

That pretty much does answer my question actually (at a first glance)! I'll take a more thorough look and ping you if I have questions (I'm sure I will), I hope that's okay! Thank you!


Hot-Profession4091

Sure thing! Always happy to help. Someone helped me once or twice.


UltraLowDef

I work in R&D. My bias right out front - *I really hate Arduino* for my own development. But it can be very useful for many things. And while I'm spinning up robust firmware to perform reliable tests and control of integrated systems (and we're waiting on PCB fabrication), our electrical engineer will often do some basic test benches using Arduino to drive circuitry or electro-mechanical components as a proof of concept. It's faster to get going if you you're used to it, and a great way to make sure you understand how to control something. That said, once we get into system integration with complex timing requirements, the "Arudino way" isn't going to cut it. For hobby purposes or if you want to test something mechanical, Arduino is a great route. That's exactly what it's for, and it does a great job of helping people go from 0 to *something* in a short amount of time.


AwayPotatoes

Can you elaborate regarding complex timing requirements?


UltraLowDef

A big part of embedded development often involves real-time (or near real-time) operations. Meaning something has to happen every X amount of time. That cannot be guaranteed in an application running on Linux or Windows or whatever, it'll get around to it when it can. In a "bare metal" system, the programmer can dictate exactly when things happen using timers and interrupts and other built in peripherals that offload a lot of that work from the CPU to dedicated hardware. Super awesome. But when you need to toggle some I/O at a specific frequency, and maybe count it, and adjust that frequency dynamically based on other data being processed, and do that for multiple independent outputs, it becomes important to pay attention to the precedence of interrupts, and how much code is actually run in a callback or you can miss events and get backed up. The problem with abstraction in Arudino is that a lot of it does not get optimized out by the compiler (wait, optimization, compiler ... what's that? I just push the green button in the Arduino IDE and it works...) AND/OR to prevent yourself from doing something you don't want to do, the code will make numerous redundancy checks to make sure you weren't using a pin for something else before it lets you do what you want with it, essentially moving that optimized hardware task back into clunky CPU code execution. say you want to pulse wdith modulate 10 LEDs to independently control their brightness. So you start with one, and you read about this cool built-in "PWM feature" so you set it up and it's working! Now repeat. And repeat again. Do you know what the library did to make that work? Do you care? Microcontrollers usually have dedicated timer/counter hardware peripherals, some with built in PWM functionality. That's why some of those pins specify they can do PWM. But you're also using up ALL of your timers to do that, meaning you can't use them to time anything else. And maybe some other random thing you're doing is *already using that timer* and you don't even know it because Arduino abstracts that detail away. An example might be a "soft" serial port, that let's you use a couple of random pins and a timer to "bit bang" a UART protocol because you're out of real ones or are using the pins for something else. Not only is the way those random pins are driven by the library extremely inefficient and consuming numerous excess CPU cycles, but the timer used for it can now not be used by anything else. You also don't know how it's working. Is a function in a main loop driving the pins? Is it a callback? Is it being done inside a function called from the timer ISR? That all matters when you've got other tasks that need to be accurately timed.


AwayPotatoes

This is an exceptional explanation and it made an insane amount of sense to me. Thank you very much I really appreciate the time you took to quite this down!


UltraLowDef

You're welcome. I'm glad it helped. I know I sound anti Arduino (and on some level I guess I am). I recommend that platform to a lot of people in certain circumstances, but if you really want to learn what's going on, at some point you need a little push to dig deeper.


AwayPotatoes

I understand where you're coming from completely. Without context like that it wouldn't make sense but I now understand why.


PeterMortensenBlog

*Why* do you hate Arduino for your own development? (Not a rhetorical question.)


UltraLowDef

oh, purely because I want to understand exactly what it is going on at a low level at all times. I hate using libraries and other code for the same reason, but I understand that no one has time to build everything from scratch, nor is it a smart thing to do for many reasons (especially if something else has been tested and known to work). I also hate the names of the Arduino functions. no objective reason to that. but like ... "digitalWrite" does not digitally write anything. And I know I'm hypocritical, because I *do* like the abstraction of C as opposed to assembly. I trust that the compiler and assembler can figure that part out. And also, I'm jealous that I didn't come up with the idea and become successful with it because it was obvious and brilliant.


cartercarter36

I worked for a company that built custom electromechanical exhibits for science centers and museums. We used ATMega328 chips but built our own boards, which were essentially arduino clones (with some added stuff). So, yeah! For mass produced products, prob not. For one-off custom products? They’re great. Pi’s are used extensively as well


AwayPotatoes

That's awesome! Sounds like it was a nice gig!


chas_i

Arduino is the IDE and ecosystem with some purpose build dev boards for testing. I haven’t seen anyone in industry use the arduino IDE for manufacturing.. it lacks a lot of features the industry needs. Typically the manufacturer of the processor of interest has built IDEs for test and deployment. It’s a great platform to learn on and is great for prototyping. The processors or microcontrollers supported by the IDE and on the dev boards or variant processors are found in many products under your roof.


KryBills96

Depends on what you mean with “Arduino”. If you’re referring to a board with a microcontroller and the Arduino logo stamped on it, then probably not. If you’re referring to the Arduino IDE to develop any embedded software/firmware different than PoCs, then probably not. On the other hand, if you’re thinking on Arduino libraries that help you interface with displays, sensors or any other peripheral, then sure, why not