Is Arduino "crap"? - Page 1
Forum section: electronics / general

author: SteveThackery
author_rank: Super Contributor
timestamp: September 02, 2024, 10:39:12 am
content: In this thread:https://www.eevblog.com/forum/chat/project-isolation-social-islanding/@JPorticisaid,QuoteI've never made a product using Arduino, but I have made plenty of hobby "contraptions". At the moment I don't see what would prevent them from being sold as products. I'm aware that a lot of the work in setting up the microcontroller is already done for you, and lots of functionality is provided by the vast array of libraries. In that regard using Arduino is easy, but what about that makes it "crap" for real products?I also developed a couple of "contraptions" using ARM mBed, and once again a fair bit of the work is done for you in the form of libraries. Is this not a good thing when developing a product? One would think it is wasteful to reinvent the wheel when the work has already been done.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 02, 2024, 11:02:46 am
content: Depends on the quality of the work already been done.Some of the Arduino libraries can be considered sub optimal depending on your needs and experience level.I myself only use it for quick testing of goodies bought from Aliexpress, and then yes, very handy that the work has already been done for you.For my actual embedded projects I'm a bare metal person. I do sometimes re-use other peoples libraries, but only if the source is available, or if it is way to complex to write it up yourself in a reasonable time frame. I rather debug my own errors, than someone else their errors.

author: ArdWar
author_rank: Frequent Contributor
timestamp: September 02, 2024, 11:27:21 am
content: Is it crap? No, not really.Does it tend to teach bad programming habit? Yes, unfortunately.

author: brucehoult
author_rank: Super Contributor
timestamp: September 02, 2024, 11:42:57 am
content: Well, let's go through the things that make up "Arduino" one by one:- AVR. Perfectly fine 8 bit microcontroller, better than PIC or 8051 in many ways. Not crap. 32 bit Arm and RISC-V are also available.- Arduino branded boards. They're fine, as are clones of them. For a product you'll want soldered connections to GPIOs not Dupont jumpers, but a soldered shield plugged into the Dupont connectors can be fine. Not crap.- Arduino core libraries. They're optimised to make the most common functionality portable across many different chips, rather than for speed. In many applications it's perfectly fine fordigitalWrite(n)to take a couple of µs to figure out what port and bit logical pinnis, every time. It's not like they're buggy or anything. Maybe not what you need in all applications, but it's easy to bypass the libraries and program the bits important to you bare metal. Not crap.- 3rd party libraries. Can be crap. Or not. Exercise due caution.- Arduino IDE. Not the best editor or IDE in the world, but serves its purpose. It's easy to use an external editor if you want. I use emacs. Dead easy to install Board Support Packages, including appropriate toolchains. VSCode+PlatformIO is a much better editor and IDE, still easy to set up. Maybe not your cup of tea, but not crap.

author: DiTBho
author_rank: Super Contributor
timestamp: September 02, 2024, 11:43:08 am
content: I can say "not well engineered"

author: coppice
author_rank: Super Contributor
timestamp: September 02, 2024, 11:48:54 am
content: This sounds like an issue related to a recent exchange about doxygen on this forum, where people were decrying the tool because a lot of people abuse it. Something easy to get started with attracts a lot of people to put together half baked things with it. Sometimes as they learn, sometimes because they are talentless, and sometimes because they are bodgers. That isn't actually a reflection on arduino itself. People have abused every tool ever developed.

author: m k
author_rank: Super Contributor
timestamp: September 02, 2024, 11:50:34 am
content: It's for a purpose.Out of its scope it's 'crap' quite fast.An example.Reading pins one by one and treating the result as one.That's not hardware, but is it Arduino.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 02, 2024, 11:54:19 am
content: Quote from: ArdWar on September 02, 2024, 11:27:21 amCould you expand on that a little?

author: SteveThackery
author_rank: Super Contributor
timestamp: September 02, 2024, 11:55:52 am
content: Quote from: m k on September 02, 2024, 11:50:34 amSounds interesting, but I'm afraid I haven't understood what you're saying. Could you explain it in easier steps?

author: brucehoult
author_rank: Super Contributor
timestamp: September 02, 2024, 12:01:45 pm
content: Quote from: DiTBho on September 02, 2024, 11:43:08 amI would say "engineered with priorities different to yours".

author: m k
author_rank: Super Contributor
timestamp: September 02, 2024, 12:02:39 pm
content: Quote from: SteveThackery on September 02, 2024, 11:55:52 amThere is time between every read.

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 02, 2024, 12:04:06 pm
content: I have used Arduino a lot at several different jobs in automated test setups. It's popular for the same reason that Windows is commonly used at work even though it's technically inferior to alternatives - a lot more know how to use it.Quote from: brucehoult on September 02, 2024, 11:42:57 amI recall that as of recent years, it has been optimized at compile time to be just as fast as a direct register write.

author: bookaboo
author_rank: Frequent Contributor
timestamp: September 02, 2024, 12:32:47 pm
content: Like a lot of people I don't use Arduino for production, as quite often there are limitations in the how it abstracts. For example on ESP32 it's all well and good until there's an ESPIDF feature that's not implemented , or some bug that's fixed by a later version of the framework (beyond whatever Arduino is currently on). I assume other frameworks are similar.The other thing that would make me hesitant to use it on production is the commercial termshttps://support.arduino.cc/hc/en-us/articles/4415094490770-Licensing-for-products-based-on-ArduinoI've nothing against these terms, it just could have commercial implications in the future if the project is successful.That said, I haven't technically had any major issues with it. Most of the libs are straightforward to read and understand. For test jigs, quick proof of concepts, one offs etc it's actually often the best option.So to anyone with a one line put down on Arduino, it would be helpful to everyone else if you could expand in technical detail what the issue is? It may or may not be relevant for everyone else.

author: tooki
author_rank: Super Contributor
timestamp: September 02, 2024, 12:43:15 pm
content: I think a lot of people who disparage Arduino a) are naturally gifted programmers, b) have long since forgotten what it’s like to be a beginner, and/or c) fall into the “hazing” mindset of “I had to suffer as a beginner, and thus so should you”.The Arduino libraries have some limitations, but if — or rather when — you run into one, then you can learn how to get around it by doing totally normal MCU programming. One of the biggest misconceptions, I think, is that people think Arduino stops you from doing bare metal programming if you want. It won’t.I do sorta understand one objection that Arduino opponents have: the possibility of getting used to using certain poor design patterns in coding, like polling in loops and using delays instead of using interrupts and non-blocking timers/counters. But then again, one can learn those anti-patterns with bare metal programming too. On the other hand, I have very little sympathy for the argument that using prebaked functions is bad. I mean, what do experienced programmers do all the time, early on in their projects? Write abstraction libraries.

author: tom66
author_rank: Super Contributor
timestamp: September 02, 2024, 12:59:04 pm
content: No.The biggest issue with Arduino is that it encourages what I would term "cargo cult programming", where people just Google / ChatGPT a solution and don't fully understand why it works because the culture around Arduino seems to encourage this.It's a perfectly okay platform for beginners to learn to program on microcontrollers and even implement some useful things - e.g. we have a couple of simple test jigs where an Arduino is part of the solution because we can have that working in a couple of days with a junior engineer.

author: ArdWar
author_rank: Frequent Contributor
timestamp: September 02, 2024, 01:07:42 pm
content: I don't actually dislike the environment. The abstraction is actually good. The complete avoidance of pointers black magic helps *a lot*. The seemingly inefficient style of code is not inherently bad, a lot of RTOS does that too. It maybe irks baremetal purists, but who really cares with today's MCU (ironically it's a bigger problem with UNO lol).My "bad habit" comment was actually a bit simpler than that. It gives distorted expectation. Everything is public, and everything looks like how you write C but suddenly member function out of nowhere. It often ends up with confusion when they need to write actual C or C++ since they often expect it to be "just like.ino".

author: madires
author_rank: Super Contributor
timestamp: September 02, 2024, 01:09:03 pm
content: Quote from: SteveThackery on September 02, 2024, 10:39:12 amArduino is great as a starting point to become familiar with MCUs and for tinkering around. As already mentioned, the convenience of the Arduino environment can cause issues when you need things to be fast or you want to use hardware features already in use by the Arduino framework. At some point you'll have to drop the Arduino framework to make full use of the MCU. For example, I'm involved in an ATmega based OSHW projekt which goes to the maximum what the MCU is able to do, and it runs also fine on classic Arduino hardware. Some people ported the software to the Arduino framework and had to drop a lot of features because the framework takes resources away. Another point is full control over everything. When you have something time critical and use the Arduino framework, you have to pray that they don't change or optimize the related functions in the next release which would screw up your timing. Without the framework, this can't happen.

author: brucehoult
author_rank: Super Contributor
timestamp: September 02, 2024, 01:09:42 pm
content: Quote from: tom66 on September 02, 2024, 12:59:04 pmAlso a huge problem with Python, JavaScript/Node, and basically anything at all that is popular.

author: madires
author_rank: Super Contributor
timestamp: September 02, 2024, 01:18:00 pm
content: Quote from: tooki on September 02, 2024, 12:43:15 pmDo you mean the hardware, the framework, or both?

author: JPortici
author_rank: Super Contributor
timestamp: September 02, 2024, 02:06:11 pm
content: Quote from: brucehoult on September 02, 2024, 01:09:42 pmThank you both for understanding why the whole thing failed as a learning tool.we all use python or some scripting language because it's useful, and hopefully don't abuse it.we all build contraptions and proof of concepts, that may be potentially seriously hazardous or just things that work with a lab power supply, and tongue at the right angle.Think of something connected to mains, water pipes, your car's electrical system, ebikes batteries... how many projects come to mind?Or browse a local facebook group on DIY smart homes, just to refer to the original thread, the shit some people do because they have no training on safety hazards makes me think how lucky we are in general.

author: tooki
author_rank: Super Contributor
timestamp: September 02, 2024, 02:26:32 pm
content: Quote from: madires on September 02, 2024, 01:18:00 pmBoth! The anti-Arduino people forget that you can use any combination of the framework, boards, and IDE (though using the Arduino boards with another framework is rare, it is doable). The only thing you absolutely cannot do -- which doesn't matter because nobody would want to do this -- is to use the Arduino IDE without the framework.

author: m k
author_rank: Super Contributor
timestamp: September 02, 2024, 02:41:22 pm
content: Quote from: madires on September 02, 2024, 01:18:00 pmCan you separate them and keep the name?I seem to think that this board is part of it.But I also seem to avoid DIP versions.

author: DiTBho
author_rank: Super Contributor
timestamp: September 02, 2024, 02:49:00 pm
content: Quote from: JPortici on September 02, 2024, 02:06:11 pmPython is a plague, and I also find it in software like Dia, where, to turn the pixels of a symbol 90 degrees, let's realize how much Python is abused: instead of a module written in C/C++, you find yet another Python dump, which to do what it has to do wastes 10 times the resources needed.Arduino makes it no better, and people make it as their default bad habit.Plus, libraries are too often written so poorly that people make it as their further default bad habit.

author: brucehoult
author_rank: Super Contributor
timestamp: September 02, 2024, 02:53:09 pm
content: Quote from: DiTBho on September 02, 2024, 02:49:00 pmYou wouldn't believe how much the internet has gone downhill since they let all those point-and-drool AOL people in. The WWW was a mistake -- should have stuck to gopher and nntp.Letting non-landowners vote was a huge mistake, as was stopping teaching exclusively in Latin in the universities.

author: tggzzz
author_rank: Super Contributor
timestamp: September 02, 2024, 03:57:30 pm
content: Q: Is Arduino crap? A: mu.Is a car crap? Yes, repeat no.Is a boat crap? Yes, repeat no.Just like cars and boats, Arduino is good/bad depending on whether it is fit for the current purpose.For quick and dirty one-off hacks and proof-of-principle exercises, Arduino isoneperfectly reasonably tool to consider.For production purposes, I'd be more reluctant to use an Arduino for many reasons. However avoiding using an Arduino for production doesn't mean something else will be better. Sturgeon's Law applies.

author: madires
author_rank: Super Contributor
timestamp: September 02, 2024, 04:00:02 pm
content: Quote from: tooki on September 02, 2024, 02:26:32 pmBut one has to pay attention to some important details. For example, when you want to go bare metal with the Arduino framework on a classic ATmega based board you need to know that the framework uses Timer0, i.e. you can't use Timer0 in your program.

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 02, 2024, 04:05:43 pm
content: The Arduino environment does not direct developers towards sound software engineering practices, and instead tries to hide some of the complexity by using its own preprocessor. The code itself is C++, or C when using SDCC instead of GCC, for example for CH55x microcontrollers.The same approach to PHP scripting for web pages and services lead to infamousMagic Quotes. Their purpose was to pre-escape inputs from web forms, so that if the programmer neglected to properly sanitize their inputs, it should lessen problems interfacing to databases. Some still look back at them fondly, and think it was a good idea, but it definitely was unsound engineering. You don't hide security sensitive details from the developers by heuristically trying to do it for them, you educate the developers; or you deal with the insecure mess you helped create.Just like with PHP, that does not mean one cannot do useful and good stuff in the Arduino environment. It's just that the environment won't help with that, and may occasionally hinder you with it (Arduino's custom preprocessor). PlatformIO is more configurable, so you trade the ease of configuration in Arduino environment, for a perfectly neutral development environment using standard toolchains.What this means for each developer, varies a lot. I know of pretty good code written in/for the Arduino environment, but many libraries are crappily written. One of my favourite good examples are theTeensy coresused in PJRC's Teensy microcontrollers. They're pretty solid, and make development fast, because of the easy integration to the Arduino IDE.Typical problems you see are library conflicts (two libraries don't work when both are used, even though either one works fine when used alone), plain bugs (especially when using the library even slightly differently than the author did), and missing implementations. MCU registers might not be set up properly, simply because the default values work for the original use case for the library. An example is the PWM frequency on some common AVR: as the same timer is used for multiple purposes, including millisecond and PWM generation, changing the PWM frequency means you need to modify the core for that board (or create your own variant of the original core).Thus, as usual, it is a balance of things. The important bit is all of it being open source, so if you know or learnhow, you can always adjust it or create your own work flow and use your own toolchains. That also means that whatever you intend to use, you need to check, so learning how to determine if code looks acceptable or problematic is a necessary skill. Personally, I also recommend understanding the legal requirements of various licenses, and what they entail in practice. If you can afford it, hire a copyright licensing lawyer to explain the main ones to you, although you can find pretty good understandable explanations at various FOSS/OSHW-related organizations' websites too if you cannot/don't want to.

author: madires
author_rank: Super Contributor
timestamp: September 02, 2024, 04:08:56 pm
content: Quote from: m k on September 02, 2024, 02:41:22 pmIn my eyes, it's a modular system. Boards plus framework plus IDE. You can use the boards also without the other parts. The ATmega based boards can be programmed via the Arduino bootloader or directly via the ISP header (avrdude supports both methods).

author: langwadt
author_rank: Super Contributor
timestamp: September 02, 2024, 04:11:22 pm
content: Quote from: brucehoult on September 02, 2024, 11:42:57 amdoes it have a real debugger now or is it still like going back to the 80's?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 02, 2024, 06:49:11 pm
content: Quote from: langwadt on September 02, 2024, 04:11:22 pmDebugging is possible in the second version of the IDE, but you still need hardware that supports it.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 02, 2024, 08:01:59 pm
content: Quote from: pcprogrammer on September 02, 2024, 06:49:11 pmOr you can use VisualMicro, which supports debugging on all Arduinos. (Not hardware debugging, obviously.)https://www.visualmicro.com

author: Smokey
author_rank: Super Contributor
timestamp: September 02, 2024, 10:39:50 pm
content: Reluctantly, having more experience with this exact question than I ever wanted to have, I can say... yes.Specifically, Arduino for commercial products is "crap".There are a few main problems in my opinion:1) Real debugging (JTAG, SWD, etc) is a second class citizen.printf() debugging is the norm. So . god . damn . much . UART . traffic... dirty..2) Hardware support favors obscure inexpensive Chinese parts.The Arduino world has conditioned "Makers" to love chips you can only get from aliexpress and have no English data sheet. A ton of libraries are written around this type of part. This is a nightmare for an actual commercial product.3) The tools are terrible for large projects.The native Arduino editor is a joke. Stuff like platform.io is an unnecessary abstraction layer above the IC manufacturer toolset that adds little useful functionality and is itself a work in progress with stuff that doesn't work well and therefore gets in the way.4) The libraries are incredibly inefficient.They were never designed to be performant. Who needs performance to flash an LED. For the stuff with an RTOS, insistence on using RTOS timers and queues for stuff that should be interrupts makes the minimum timestep like 1ms and screws determinism.5) The libraries were never designed to work well with anything other than the small single purpose they were designed for.Imagine the problems of "thread safe" code, but scale that to everything. Actually taking control of interrupts breaks things in strange ways. Adding too many Arduino libraries to the same code breaks things in strange ways. Change the default hardware allocation breaks stuff in strange ways because all the required registers were not explicitly configured.6) Bug Fixes/Support is incredibly painful.Yes, it's open source... and yes if I want something I can just write it myself.. but that's not very "Arduino". The reality is that you are pulling some library someone else wrote. Lots of the libraries look like they were put together in a weekend by some art student "maker". Lots of the libraries are abandoned. Others are maintained by some random dude who has little time to deal with it and has no concept of long term stability and not introducing breaking changes. So you are forced to fork a branch and now you need to sync/maintain that yourself if you need any fixes. Fun for a dude in his basement. Nightmare for a product.The "contraption" label is spot on. Anyone can make a simple thing that works some of the time. Arduino stuff is great for making a simple thing that works some of the time. Now go make 10000 of a complex thing that need to work all the time. Incredibly tall mountain to climb when the base of it starts at the Arduino elevation level.

author: coppice
author_rank: Super Contributor
timestamp: September 02, 2024, 10:47:48 pm
content: The real problem is Arduino is two decades old. It got something interesting started as an affordable price, and accepted a lot of limitations to achieve that. Now a similar amount will be much more powerful hardware. Arduino's time should be passing, but nobody is stepping up to offer the next great alternative. They are just running stuff originally targeted at tiny chips on much bigger ones.

author: coppercone2
author_rank: Super Contributor
timestamp: September 02, 2024, 10:48:36 pm
content: it bearly works, they explain it like its a infinitely modular system but I had it crash 100% of the time with 1 extension card installed, just to separate something out a little bit. it will screw you if you make a promise that you can get something done. 1 inch tall spacer.again with the 'premium' brands

author: PlainName
author_rank: Super Contributor
timestamp: September 02, 2024, 11:15:15 pm
content: Quote from: tom66 on September 02, 2024, 12:59:04 pmWhy is that a problem? Sure, if one wishes to do proper engineering then it's not the best route, but if they don't care and just want it to do something, so what?I'm not a plumber, so when we have problems with out pipes I might use Google to pull up a video and then hack a likely solution. I don't want to become a plumber, I just want to avoid paying a proper one to fix a simple problem. Is that cargo cult plumbing?Sometimes the Googled solution defeats me and then we get the local plumber in. He does a grand job, and I'm not sure how this situation is different to an Arduino cargo culter failing to solve their issue and getting someone with a clue in to do it (actually, most likely buying something of Amazon).It's horrible to us because we care , and we have pride (as do I when I fail to do plumbing, actually), but the Arduino cut'n'paster isn't, at that point, wanting to be an engineer any more than a Wreckfest player actually wants to go out smashing up cars. Maybe they will get hooked and then have to relearn some stuff, but until then surely it's only a problem for us looking at them.

author: nctnico
author_rank: Super Contributor
timestamp: September 02, 2024, 11:18:26 pm
content: Actually, software is the least of the problem when using boards from the Arduino eco-system. None of the boards & addons are designed to have any meaningfull signal integrity and/or resilience against external influences. Mostly due to lack of sufficient ground pins and ground points on the mounting holes. So using an Arduino module and a few shield boards is likely going to bite you when you try to build a commercial product. Try to get it through EMC and work reliable in the real world...If you look around you'll find plenty of examples of people who can't get their contraption to work due to the crappy hardware design alone. Driving motors and solenoids are good ingredients for an Ardisaster.

author: Smokey
author_rank: Super Contributor
timestamp: September 02, 2024, 11:23:18 pm
content: Quote from: PlainName on September 02, 2024, 11:15:15 pm... you will only find the solution to trivial or common problems that way. If you have a trivial or common problem then its great. I've had chatGPT do trivial and common things for me since it's been out. (It's actually pretty good at simple GUI layout for quick test type interfaces that would otherwise take a while to do all the boilerplate).Problem is when you have to deviate from trivial or common. Only way to establish the skills is to practice.

author: PlainName
author_rank: Super Contributor
timestamp: September 02, 2024, 11:33:42 pm
content: Quote from: Smokey on September 02, 2024, 11:23:18 pmYou're assuming the culterwantsto progress from trivial or common. Maybe they will have a go and if it turns to shit they'll just buy a commercial solution (or forget about it). As I noted, that's only bad for us when we look at it and think how we would do it, but for them it does the biz (until it doesn't, and then they will likely try something else or give up).Theydon't see it as a problem, so why must we on their behalf?

author: xrunner
author_rank: Super Contributor
timestamp: September 03, 2024, 12:41:57 am
content: Quote from: nctnico on September 02, 2024, 11:18:26 pmYes I agree with this. "Arduino" - the board with the microcontroller (whichever board with the chip you choose to use) I've found is OK for what it is. Haven't really had problems with the "Arduino" board. But the "Arduino" shield boards are many times of poor quality workmanship.If it's a popular sensor board you will find a lot of libraries that purport to make your life easier using the sensor. If you find a good library for the sensor that can be true ... and if you start off with a poor library then it can be false. Then you keep trying libraries written by others until you find a good one.

author: Smokey
author_rank: Super Contributor
timestamp: September 03, 2024, 01:52:42 am
content: Quote from: PlainName on September 02, 2024, 11:33:42 pmI'm not assuming anything about anyone. I said it's great if you can easily find a solution to your common or trivial problem.The OP question was about Arduino in a product. Unfortunately, if you are intending to make a product and you stop at "well google didn't immediately show me a cookbook receipt on how to do this, so I guess I'll quit" then you are going to have a hard time getting to market.

author: ArdWar
author_rank: Frequent Contributor
timestamp: September 03, 2024, 02:12:51 am
content: Quote from: nctnico on September 02, 2024, 11:18:26 pmNow that you mention it. I still yet to figure out how am I supposed to mount Arduino Mega without grinding down some of the headers or shorting some pads/traces.

author: BrianHG
author_rank: Super Contributor
timestamp: September 03, 2024, 02:47:38 am
content: I don't know if you could call it crap, but if Arduino is all you ever learn about programming MCUs, then you will limit your chances of contracts or employment in an industry using MCUs compared to those who have gone the extra mile to learn about bare metal core chip functions as well as other MCUs and their EDA environments.If you want to begin playing an learning about MCUs, Arduino is fine. If you want employment in the firmware industry for MCUs, yes you can start with Arduino, but within ~6 months, begin to expand your horizons a step at a time... You never know if you will be hired to re-code existing hardware where you will be either stuck with a third party MCU, or something needs to operate at peak speed or efficiency, or use special hardware on the Atmel MCUs and if all you know is top level Arduino, you might not meet the cut.Learning how to build your own PCBs, basic electronics, EMC and protect sensitive IO pins as well as how to troubleshoot your own or third party PCBs with a scope will also be a must if you are entering the MCU development industry.

author: DiTBho
author_rank: Super Contributor
timestamp: September 03, 2024, 03:59:54 am
content: Quote from: Smokey on September 02, 2024, 10:39:50 pm100% agreeBanzi said "with Arduino you have the power at your fingertips, you can even create interfaces for spaceships and [...]blablabla[...], of course, you only need printf to make them debug"And with similar "social performance", you don't know how much Massimo Banzi has profited by openly saying "please, buy original Arduino boards and not clones, Arduino boards are made in Italy and this helps the Italian economy", when those boards, sold much more expensive than clones, were made with the same parts and in the same places where clones are built.And when it was discovered how things really worked with that "made in Italy", the price difference was justified with "eh, but we are still OpenSource, because we have to live".Many stories of that "company" are disgusting, starting from its beginning, Banzi stole the idea from one of his student as well as intel did with Federico Faggin's 4004, a company that tells a lot of bullshit to the public always exploiting the "goodness" that revolves around educational and OpenSource.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 06:29:56 am
content: The way I see it is that when you contemplate on making a commercial product you might start with "Arduino" hardware to make a prototype to test the feasibility of the basic idea. Maybe even use the development platform to write up the software for these tests, but if high performance is part of the functionality it might already be needed to go bare metal. (Even though the Arduino environment is basically bare metal. It is not as if there is a real OS involved.)After proof of concept you will work out a proper hardware design that cuts down cost and can pass certification. When that is done you might reuse the Arduino software, but it is more likely that you go the path of doing a proper job. (Might also be needed to pass certification.)Unless of course you are just out for a fast buck and don't give shit about the quality of your product. Better make sure you can't be sewed then.

author: PlainName
author_rank: Super Contributor
timestamp: September 03, 2024, 06:31:49 am
content: QuoteOK, re-reading the original I can see how that might be. I was arguing on the basis of the Arduinoasa product rather than the Arduinoina product. Difficult to see which way the thread was going, particularly if that aspect was missed originally

author: PlainName
author_rank: Super Contributor
timestamp: September 03, 2024, 06:44:48 am
content: The Arduino is pretty old, and although I wouldn't refuse to use something merely because it doesn't have JTAG debugging (are we bare metal developers or what?) it's quite long in the tooth. When it came out it was pretty neatfor that time, given what was around.Nowadays the Arduino equivalent would surely be the RPi - it has the same entry-level aim, the masses of third-party software, and you can Google for how to do stuff without actually learning what you're doing. It even gets embedded in actual products. So is the RPi crap?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 07:00:09 am
content: Quote from: PlainName on September 03, 2024, 06:44:48 amIt depends on what you consider to be Arduino hardware. The original ones using the Atmel mega328P MCU can be called old. Even the bluepill with a STM32F103 is old, but the newer stuff with ESP32 or Risc-V or Cortex-M4 MCU's are not old. Maybe not real Arduino hardware, but they can be used within the Arduino environment.So what is needed here is a more specific question that defines what is meant with "Arduino" in the original title.Is it the development environment (IDE), the framework, the hardware or a combination of it all.

author: PlainName
author_rank: Super Contributor
timestamp: September 03, 2024, 07:03:34 am
content: QuoteYes, good point.

author: Ice-Tea
author_rank: Super Contributor
timestamp: September 03, 2024, 07:19:25 am
content: Aside from the SW side and the actual Arduino HW, it's kinda bad that there's a general notion you can just toss together a dozen breadboard plugins of varying quality and pedigree, get it to work and call it a "product". It's not a product. It's a technology demonstrator.

author: Smokey
author_rank: Super Contributor
timestamp: September 03, 2024, 07:23:36 am
content: Eric Bogatin has a talk somewhere where he mentions the original Arduino PCB was so bad from a grounding/EMI standpoint that he uses it as an example of a measurably terrible PCB layout in his classes and has his pcb-design students re-lay it out with actual good design guidelines as an exercise.Quote from: pcprogrammer on September 03, 2024, 07:00:09 amMy 6 point rant was mostly about (recent experience with) Arduino on ESP32. I've never actually used any "real" Arduino hardware, so I was just talking about the framework/tools and libraries. You would be a crazy person to try to make a real product based around dev boards you bought from Sparkfun anyway.

author: nctnico
author_rank: Super Contributor
timestamp: September 03, 2024, 08:18:15 am
content: Quote from: Nominal Animal on September 02, 2024, 04:05:43 pmUsing C++ could be a good thing. Less use of pointers. Recently I came across a piece of C code like this:struct t_information *make_information(int parameter){struct t_information *ret_val;retval->data = parameter * 100;return ret_val;}This is from a commercial product likely sold in 10k to 100k quantities a year. Maybe some people shouldn't do programming.

author: Andy Chee
author_rank: Super Contributor
timestamp: September 03, 2024, 08:45:24 am
content: Ok I'm a C dummy, so I don't actually know why that code snippet is "wrong". And what does "proper" alternative code look like?On the other hand, I consider myself relatively proficient in hardware, and regard the Arduino platform analogous to breadboarding prototypes. I would not necessarily release a commercial product in breadboard format, even if transferred to one of these PCBs:

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 09:03:48 am
content: Quote from: nctnico on September 03, 2024, 08:18:15 amQuote from: Andy Chee on September 03, 2024, 08:45:24 amI'm neither a real expert on C but think it is simple. Using a structure to return a single value in itself is bad, but declaring it within your function and then return a pointer to it is very bad. Unless it is automatically marked by the compiler as static it won't exist any more after the return of the function.Code:int make_information(int parameter){int ret_val;retval = parameter * 100;return ret_val;}The above is what it should have been. Simply returning the input times 100.A bit more optimized line wise.Code:int make_information(int parameter){return(parameter * 100);}Quote from: Andy Chee on September 03, 2024, 08:45:24 amI rememberthis one. A voltage reference product that was made onbreadboard PCB.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 09:11:37 am
content: Quote from: Andy Chee on September 03, 2024, 08:45:24 amThat's the very question I had!

author: Brumby
author_rank: Unknown
timestamp: September 03, 2024, 09:15:09 am
content: Ingredients:1x Bespoke request from a member who saw a previous project I showed here1x Generic 20 milligram electronic scale1x Arduino Nano compatible board (whichjustsqueezes into the scale body)1x First attempt at writing interrupt driven software, which was written in the Arduino IDEResult:Got it working and produced 2 more.There are dozens of choices I could have made differently and perhaps I should have. I cringe at the crudity of it all - but it works well enough.Does this qualify for this dicussion?

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 09:18:14 am
content: Quote from: coppice on September 02, 2024, 10:47:48 pmHow about the Pi Pico?Mind you, I would not want to program in Python - running an interpreted language on a microcontroller feels wrong, but I don't know how easy it would be to program the Pico in C or C++.

author: PlainName
author_rank: Super Contributor
timestamp: September 03, 2024, 09:21:17 am
content: Quotestruct t_information *ret_val;Creates a pointer to the struct, but there are two problems: first, there is no actual struct, only this pointer to one. So assigning a variable to the non-existent struct member is going to write to random memory. If you're lucky it will be address 0 and trigger an abort.Second, suppose you realise the pointer wasn't meant here and you really wanted to do:struct t_information ret_val;At the end of the function a pointer to that is returned, which would be OK (and the way to do it) except that the struct is on the stack, so would be lost on function return.[edit: missed word]

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 09:24:07 am
content: Quote from: Brumby on September 03, 2024, 09:15:09 amThat is after market product update. Only when you seriously consider making a new product out of it the question is how you would approach that.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 09:25:57 am
content: Quote from: SteveThackery on September 03, 2024, 09:18:14 amJust as hard as any of the other MCU boards you can find. It requires reading the datasheet and the reference manual and then it depends on your skill set.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 09:27:20 am
content: Quote from: PlainName on September 03, 2024, 09:21:17 amDamned missed the declared as a pointer.That indeed makes it even worse.

author: Brumby
author_rank: Unknown
timestamp: September 03, 2024, 09:30:20 am
content: Are we taking hardware here ... or software?There are several ways to generate an executable (and the discussions on coding practice are, quite literally, boundless) but, as I see it, these don't represent thedefinitionof Arduino.

author: artag
author_rank: Super Contributor
timestamp: September 03, 2024, 09:52:06 am
content: Quote from: nctnico on September 03, 2024, 08:18:15 amI don't think the right way to reduce bugs is to take all the useful features out of languages. You'll end up with BASIC. Which I guess has it's uses, but we've already got it so we don't need another one.The whole problem of inexperienced programmers using languages they don't understand is a social / managerial problem, not a technical one. Don't try to fix it with a technical solution.

author: nctnico
author_rank: Super Contributor
timestamp: September 03, 2024, 09:55:13 am
content: Quote from: pcprogrammer on September 03, 2024, 09:03:48 amYou are getting tripped up by the simplification of the example. There are more fields returned. It is all about the non-initialised pointer which points to a random memory location. And this random piece of memory is then overwritten with the values. The problem with these kind of coding errors is that they can go unnoticed for a very long time and when they do cause issues, they are extremely hard to debug. The compiler threw a warning on this one so it was easy to spot when going through the warnings.A simple fix is making retval a static variable for the function.Code:struct t_information *make_information(int parameter){static struct t_information ret_val;retval.data = parameter * 100;return &ret_val;}But this isn't thread safe. And still it would be better to declare a variable with the t_information type and pass it to the function. In C++ you can pass variables by reference which is easier and less error prone compared to using pointers.This piece of code comes from a project I inherited. Customer has too many problems with it so they demanded the source code so they have full control over fixing bugs. One of the issues is that the product the code is running on, is crashing every now and then. It also underlines why I'm so adamant on writing simple code and avoid using pointers in C because they are so poorly understood by many.

author: PlainName
author_rank: Super Contributor
timestamp: September 03, 2024, 10:11:50 am
content: Quote from: nctnico on September 03, 2024, 09:55:13 amHate to nitpick but that would fail too: it requires the 'static' keyword to be static, so this version would be on the stack (and dropped on return).(It could be fixed in a couple of ways; offhand, without knowing anything about this code other than this, I would probably create the struct elsewhere and pass in a pointer to it. Reason being that this function just seems to be a struct manipulator but doesn't seem to do anything that would warrant being a struct creator - a creator should ensure all members are set appropriately, for instance. I appreciate that it's an example of bad code written by someone else; just commenting on it generally!)

author: nctnico
author_rank: Super Contributor
timestamp: September 03, 2024, 10:16:22 am
content: Quote from: PlainName on September 03, 2024, 10:11:50 amI wasn't finished typing..

author: Rerouter
author_rank: Super Contributor
timestamp: September 03, 2024, 10:19:11 am
content: I'm probably coming from a weird angleThe IDE is simple enough to have an apprentice program a hundred devices without too much difficulty, (Using an ICSP device)Its verbose enough to make clear that it worked or not.With any device, you need to inspect the code it will be running and test it aswell as what your writingI do have devices still out in the field that are based on an AVR chip running the arduino code, but usually never the bootloaderI will say the libraries are where you will find some of the weirder choices, I remade the 1-wire emulation code as the original wanted like 35KB of RAMmy own implementation was 200 Bytes,ATtiny is still a favorite series of mine, but I've yet to play with the 1 wire programming style chips

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 10:52:39 am
content: Quote from: pcprogrammer on September 03, 2024, 09:25:57 amI've been reading the 'C' SDK user manual for the Pico. It describes a comprehensive set of libraries, and it looks like they are all written by the company, which helps me feel confident about their quality. According to the documentation it shouldn't normally be necessary to manipulate registers, etc, directly, although you can do so.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 11:01:03 am
content: Quote from: nctnico on September 03, 2024, 09:55:13 amWithout the definition of the structure there is no way of knowing what is being passed, but with the example you gave either it being a pointer or the actual structure (without the static) the other members of the structure will be random data. (Or set to zero)And like PlainName pointed out it won't exist anymore after the function returns, unless it is marked static. The stack gets written over fairly fast. On the other hand with it being a pointer the data would still be somewhere in the memory but at an undefined location. Not necessarily at address zero if I'm not mistaken. There used to be a difference in this between release and debug builds.Anyway we all agree on it being bad programming and can cause problems that are indeed very hard to find and debug.That is why I liked writing in assembler in the good old days. You always knew where the data is placed and how it is handled.With more modern assembly languages like ARM it is more of a pain though.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 11:10:50 am
content: Quote from: SteveThackery on September 03, 2024, 10:52:39 amCorrect, but that is more what bare metal programming is about. Manipulating registers and peripherals. Sure you can use the manufacturers SDK, but for me the challenge is to do everything yourself. I know, I'm weird that way. But when shit hits the fan you can only blame yourself for f-ing it up.Programming any MCU with basic C/C++ means starting at the reset vector. Within the manufactures SDK that often is taken care of with some assembly, but it can be done with pure C. I'm not a user of C++. Know a bit about it and have used it, but prefer C, and on embedded I often do without the extras. Just plain C, no libraries, not even the standard ones. Less room for errors.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 11:39:05 am
content: Quote from: pcprogrammer on September 03, 2024, 11:10:50 amThanks - a very thought-provoking reply. I don't object in principle to bare metal programming, but I do like to be able to use the libraries as well, so I can choose.Also, like you, I prefer programming in C rather than C++. I'm not sure object oriented adds that much in the microcontroller world; in all my experience I've never needed to create more than one object of a particular class, so what's the point? The key principles of encapsulation can be done well enough in C.I've just started a new thread exploring the "where next after Arduino?" question, because it is logically separate from this thread, which is about Arduino's suitability for real products.

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 03, 2024, 11:40:38 am
content: (That is another reason I like Teensy microcontrollers (see4.0,4.1): the proprietary bootloader is on a separate chip, so the main MCU is completely under your own control, if you want to do bare metal programming. So, you can do Arduino+Teensyduino development, or bare metal, whatever fancy hits you. The only limitation is that attaching a debugger is not very feasible, as the JTAG/SWD pins directly connect to the bootloader chip. The upside is that unless you damage the board (electrically or physically), you can always reprogram it with the Teensy Loader. PJRC is even willing to sell youpreprogrammed bootloader chips, if you want to do a DIY board compatible with Teensies; many have.)

author: langwadt
author_rank: Super Contributor
timestamp: September 03, 2024, 01:03:49 pm
content: Quote from: pcprogrammer on September 03, 2024, 11:10:50 amon a Cortex-M you can, I don't think it is always possible

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 03, 2024, 01:26:20 pm
content: Quote from: langwadt on September 03, 2024, 01:03:49 pmThe amount of assembly needed is often only a few lines to a dozen lines or so, though: setting up the stack and such, nothing complicated or weird. With GCC and Clang-based toolchain, you can even compile the assembly sources using the same frontend (gccorclang) with same compiler options, because they invoke the toolchain assembler for.sfiles (preprocessed assembly sources) and.Sfiles (assembly sources that need preprocessing via toolchaincpp). Or you can invoke the assembler directly (typicallyasin these toolchains) in your build machinery; I useMakefiles, others prefercmake. Even IDEs tend to use one or the other "behind the scenes". So, it's not an issue in real life, at least with these toolchains.It's the black-box/magic register setup without comments, explanations, or any documentation, that one might see in an SDK that is annoying. That stuff can easily be done in C after setting up the stack, especially if you know what and why it is being done. (Others have told me that manufacturers' and vendors' SDKs don't have much of that nowadays, but I haven't checked.)

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 03, 2024, 03:14:17 pm
content: Quote from: langwadt on September 03, 2024, 01:03:49 pmDepends on a couple of things. A way to setup a vector table holding the reset and interrupt information of the processor and the need for special actions in peripherals like memory management units. The latter can be tricky and require dedicated assembly instructions to make it happen. But it is also possible to embed these in to your C code with the use of the "__asm__" statement. How to do this and with which statement depends on the compiler and conventions used in it.Even if some assembly is needed, this makes it even more bare metal.

author: tooki
author_rank: Super Contributor
timestamp: September 03, 2024, 05:33:17 pm
content: Quote from: Andy Chee on September 03, 2024, 08:45:24 amWell that'd also be spectacularly expensive to do, given the large amount of labor needed to wire a circuit on protoboard. That is the whole point of a PCB, after all: the wiring is already done.

author: tooki
author_rank: Super Contributor
timestamp: September 03, 2024, 05:44:32 pm
content: Quote from: SteveThackery on September 03, 2024, 09:18:14 amEasy: you can do it with Arduino (which on the Pico is a lightweight wrapper over the mbed RTOS). (Yes, I know that mbed is being discontinued. I have no idea what the future holds for the Rpi Pico in this regard.)There is also thePico's own C/C++ SDK.

author: paulca
author_rank: Super Contributor
timestamp: September 03, 2024, 05:48:01 pm
content: In context of my personal issue, spawning the referenced OP...Arduino is a "one size fits all" eco-system specifically created to "make stuff easy, approachable". Arduino did not create the micro-controller, nor did they create firmware, nor did they invent C++ coding. What they did was provide an "eco-system" where they "stipulated and provided" a more "End to end" solution. "Turn Key". They hide all the fiddly details in framework code, wrap even more into a very hand-holding build process, so beginners (and practicalists alike) didn't need to think about them to "get their stuff done".I think if you argue in favour of that as "a" learning eco-system, I personally wouldn't side against you.Where the problem comes is when you exist outside that eco-system. When you look 'directly' into bare-metal MCUs, 32bit MCUs, MCUs with teeth and MCUs with balls that you start to speak in a different language to them. You are no longer working in the subset of functionality or the nomelcature of the eco-system, you are working with the vast expanse of all possibilities without any artificial framework limitations."I'm having an issue with bidirectional UART interrupts, I can't work out if its.... X or its... Y. Datasheet is confusing, help.""Why not just call Serial.Write()"?"Yea, yea, everyone just calls Serial.Write() dude. Why you slagging?""Yea, get 'em. He's slagging Serial.Write(), obviously doesn't know what he'd talking about. Who needs bidirectional anyway, nobody uses that because Arduino never supported it so it can't be done."At least on forums like this Arduino fan boys that extreme will be put in their place.It seems as though the "home automation" sector has, unfortunately fallen to the HomeAssistant fanboys. Discussions on "Home Automation without Home Assistant" are just not possible frankly. It's like MCU discussions ceased and everyone moved to arduino and anyone who didn't was called a hieratic and stoned. (I exagerate).

author: nctnico
author_rank: Super Contributor
timestamp: September 03, 2024, 06:19:54 pm
content: Quote from: paulca on September 03, 2024, 05:48:01 pmNot so long ago there where very heated discussions on whether microcontrollers should be programmed in assembly instead of C. Purists would program in assembly!Nowadays you can see similar discussions emerging where it comes to C versus C++ and Python.

author: Kjelt
author_rank: Super Contributor
timestamp: September 03, 2024, 06:34:17 pm
content: Arduino brings embedded microcontroller projects to laymen and starters and those who want to test something quick and dirty.But that is and was valuable for many people who otherwise never started.Think about artists and juniors who once touched by the arduino world go on and perhaps start studying EE, robotics, informatics, mechatronics and the likes.When I was young you had Fisher Technic a plastick version of Mecano did anyone say that is not professional you can not make a product with that flimsy stuff ?While I always thought Arduino was toys for kids, I was surprised that on another cnc milling forum someone without programming skills made a very well designed lubrication device in a matter of days. It works great based on Arduino.So I think differently now, it has its purpose and its target audience. I even got some new form of Arduino myself, ESP32 with ESPHome and although I designed the hardware surrounding it and made it robust, the core is an Olimex ESP Ethernet board. And it works 24/7 for over a year now, the software took 1 day copy paste and test.Had I made it myself from scratch with an Arm STM32, my best guess it would have taken me weeks to do the interfacing and still use prewritten LWIP or something similar and not sure if it woukd have been better.So new mantra, grab the hardware and infrastructure that fits your need and although it might be more fun and satisfaction, doing everything yourself from scratch will not guarantee better results. Or is anyone of you still making their own pcbs ?

author: janoc
author_rank: Super Contributor
timestamp: September 03, 2024, 06:42:23 pm
content: Quote from: bookaboo on September 02, 2024, 12:32:47 pmPretty much the same terms and obligations as when using any other libraries. You need to review licenses and comply with them. It is not like anyone has sneaked that up on you.And most people don't use Arduino boards for production (that would be very expensive) - which is where you need to deal with trademarks, etc.

author: paulca
author_rank: Super Contributor
timestamp: September 03, 2024, 06:42:42 pm
content: Quote from: nctnico on September 03, 2024, 06:19:54 pmInteresting opposition argument. But I think it just highlights the difficulty with analogies being stretched.I feel a better dichotomy would be in terms of "Product" vs. "DIY". "Ready meal" versus, "Home made". "Made to a budget" versus "No expense capped".Home Assistant is a product. People configure and use the product to automate things. I am fine with it being "a defacto standard", just like Lotus was once the defactor standard for Spreadsheets. However I am working with Spreadsheets and wether it's Lotus, Microsoft or SunMicros product, it's still a spreadsheet. Stretching the analogy a bit still, if you want to avoid "tool orientated design", your best bet is to use a "generic" model of a spreadsheet, decided your requirements and then gap analysis it against each of those products to find the one which meets the most of your needs. It's just that right now, everyone and their dog is using Home Assistant (Lotus).Another idiom? It's like in the UK people refer, to this day, to a vacuum cleaner as "The hoover". Hoover is a brand.It feels like nobody is doing "Home automation", they are all doing "Home assistanting".A lot of this is tongue in cheek and we are way off topic.On stretching analogies still...It's like young people who never learnt to drive. They take public transport everywhere and if that won't work they phone a friend. However they will insist that you should take the bus. When you ask for directions or how to get from A to B in your car, all discussions end up in a flame war about why you need to drive to get there. It's hard for those who didn't learn to drive and don't own a car to understand you.

author: tooki
author_rank: Super Contributor
timestamp: September 03, 2024, 07:05:45 pm
content: Quote from: paulca on September 03, 2024, 05:48:01 pm"Artificial framework limitations" sounds like a pejorative, making it sound like the frameworkdeliberatelystops you from doing things you could do otherwise. It doesn't. Nothing stops you from writing lower-level code into your Arduino sketches. (The consequence is that you lose easy portability to another MCU.)The limitations of the Arduino frameworks aren't there as artificial roadblocks, they are consequences of a) designing a product originally intended for artists*, not electronics nerds, and b) portability across MCU families, so a "lowest common denominator" base functionality.But for all the complaints people have about the "limitations" of the Arduino framework, they either don't know, or deliberately ignore, that is is for all intents and purposes a set of lightweight libraries on top of ordinary C/C++, and that ordinary C/C++ code works, including directly reading and writing MCU registers if you want to (on most of the MCUs at least, including Atmel and STM32; others, like ESP32 and Rpi Pico, instead implement the Arduino framework as a lightweight layer over a RTOS, but you can call their specific calls to do all the stuff the Arduino framework won't).I say this as someone who isn't a particularly gifted programmer: Working my way through the Arduino framework, starting with the classic "Blink", all the way to writing my own peripheral support libraries for external doodads, for Arduino on ESP32 in PlatformIO, was a great way to "graduate" to then programming in manufacturer IDEs like MPLAB X (for a PIC16 in a piece of measurement gear I built that has been in operation for well over a year now, where it is used to keep track of well over a million $ worth of liquid xenon; that project required me to manage special timers to capture the period-modulated output of the front-end measurement ICs) and STM32CubeIDE. For me, learning bit by bit was better than being thrown in the deep end. (Like in class, where we did STM32 in Keil, where I remember a bunch of us running into trouble programming the MCUs due to some checkbox whose function is as opaque to me now as it was back then. The teacher knew STM32 enough to understand it, but it's one of those things that can completely ruin a novice's day because there's not a snowball's chance in hell you'd ever be able to solve the issue on your own, you'd eventually just quit in frustration and throw the dev board in the trash.) By being able to solve problems that are at the edge of my understanding (as opposed to problems so far beyond my level of knowledge that there is no chance of identifying the solution), I was able to learn on my own, since the problems were not insurmountable. I learn more that way than by having someone else spoon-feed me a solution I don't actually understand.*The Arduino people didn't actually invent the Arduino "language" (i.e. the framework), they forked an existing OSS project called Wiring, which in turn was a fork and extension of a platform called Processing, which was expressly developed for artists.

author: paulca
author_rank: Super Contributor
timestamp: September 03, 2024, 07:31:11 pm
content: Quote from: tooki on September 03, 2024, 07:05:45 pmAgreed. Remove the "artificial". There are limitations within the eco-system. Editing/patching/working around and writing low level code outside the framework, would not, in my simple mind be "within the eco system"That goes, across the board for frameworks. Frameworks are usecase specific. They are intended to facilitate, accelerate and regulate development. They are about reusing tested code rather than writing some new bugs. No framework works for all use cases. If you want a framework that is broad and wide and featured enough to cover every single use case you would basically just have written the C language.It doesn't stop people trying though. I personally have seen a dozen database ingestion frameworks fall flat on their face everytime they "succeed". By succeeding they have created a framework/automation, that is actually MORE complex and MORE time consuming to use than doing it yourself manually with low level tools.To make them useful frameworks MUST be opinionated. They must be limiting. Or they will just end up as complicated as teh problem they were trying to simplify."Framework" comes from the construction and architecture industry. It almost literally refers to the core structure of the building. In a sky scraper it's the steal beam structure. Once it's in place, it's job is to facilitate the rest of the construction it is there to support. In such a building it might be a specific framework, based on a prior, based on a prior etc. It might only get used once, in one project. A framework for a house, the basic structure for a 2 story domestic house with a dozen options, could be used to build 1000 houses rapidly.While these frameworks have flexibility in them, just like building frameworks once they are decided it's pretty much fixed and everything else that comes after it has to comply.Getting in under, around, or over the framework to avoid it's limitations are always "At your own project risk." They happen in construction, they happen in software. I have never once used a framework that didn't limit me or get in the way some of the time.You makes your choices, you lie in the bed you made.

author: farrisee1
author_rank: Newbie
timestamp: September 03, 2024, 07:54:42 pm
content: Arduino are for people who don't care or need to know about the underlying technical details. It's pretty much rapid prototyping or proof of concept use. For real products, it cannot be used. You can't place an Arduino board into a product and sell it. The Arduino IDE lacks advanced features which are not needed for the non-technical user.

author: SteveThackery
author_rank: Super Contributor
timestamp: September 03, 2024, 08:17:45 pm
content: Quote from: farrisee1 on September 03, 2024, 07:54:42 pmThat seems like a sweeping statement. There is nothing fundamentally stopping you from using Arduino as the heart of a commercial product. OK, it might be rather expensive, but that's a commercial obstacle, not a fundamental one.You can still make pretty impressive products, despite lacking the advanced features you mentioned. After all, people made sophisticated products without any microcontroller at all, if you go back far enough. I used to do repairs on a dot matrix printer by Trend that was implemented entirely in 4000- and 7400-series logic (plus the power electronics for the printhead itself).

author: Kjelt
author_rank: Super Contributor
timestamp: September 03, 2024, 09:00:27 pm
content: Quote from: farrisee1 on September 03, 2024, 07:54:42 pmAlmost twenty years ago I had to program 4 bit uCs with 1024 bytes of ROM and 32 bytes of RAM from a chinese toymanufacturer to be put in a european high tech companies mass product because the BOM for the whole pcb was $0.36I wish I had an Atmel uC thenBTW they sold millions and the company made millions.

author: nctnico
author_rank: Super Contributor
timestamp: September 03, 2024, 09:08:55 pm
content: Quote from: Kjelt on September 03, 2024, 09:00:27 pmBut you likely put those on a properly designed PCB made to pass EMC testing and to have some protection against nastiness from the outside. An Arduino in the form of a board (aka processor module) lacks all that.

author: Kjelt
author_rank: Super Contributor
timestamp: September 04, 2024, 07:27:03 am
content: Quote from: nctnico on September 03, 2024, 09:08:55 pmAgreed, I see/saw the scope of the discussion as "Arduino programming environment" rather than some chinese low $ pcbs.In that sense the STM nucleo boards are also too big and probably due to a lack of decent groundplanes and non multilayer not very EMC compliant to put in any product.But if you redesign an Arduino board from scratch would you agree it could pass EMC testing?

author: Rerouter
author_rank: Super Contributor
timestamp: September 04, 2024, 08:49:44 am
content: Quote from: farrisee1 on September 03, 2024, 07:54:42 pmThe Emotimo TB3 actually was an ATMega2560 + a motor driver board, so they have happened, though they are not that common in the raw form

author: brucehoult
author_rank: Super Contributor
timestamp: September 04, 2024, 09:03:01 am
content: Quote from: Rerouter on September 04, 2024, 08:49:44 amA dozen years ago, pretty much all home made or kit 3D printers used an Arduino Mega. Certainly mine did. 16 MHz 8 bit 8 KB RAM and plenty of CPU power to interpret G-code and fling 4 or 5 stepper motors around and run PWM PIDs for the print bed and hot end, and a status display too.

author: tom66
author_rank: Super Contributor
timestamp: September 04, 2024, 09:39:19 am
content: Quote from: farrisee1 on September 03, 2024, 07:54:42 pmThis is obviously wrong. Many early-generation 3D printers which were sold commercially were based on off-the-shelf Arduino boards. They often used the same pinout when they moved to dedicated PCBs.edit: brucehoult beat me to it.

author: paulca
author_rank: Super Contributor
timestamp: September 04, 2024, 10:33:30 am
content: https://www.ebay.co.uk/itm/224403664159

author: ledtester
author_rank: Super Contributor
timestamp: September 04, 2024, 11:27:40 am
content: Quote from: Smokey on September 03, 2024, 07:23:36 amHere it is at the 46:45 mark:Eric Bogatin on Breaking Bad Habits in PCB Design - AltiumLive Keynotehttps://youtu.be/DIMIzKRmync?t=46m45s

author: coppice
author_rank: Super Contributor
timestamp: September 04, 2024, 11:31:38 am
content: Quote from: Smokey on September 03, 2024, 07:23:36 amThis is normal. In the low speed MCU world very few PCBs are laid out well until the designer faces the discipline of getting their project through a suite of EMI/EMC tests.

author: nctnico
author_rank: Super Contributor
timestamp: September 04, 2024, 11:32:12 am
content: Quote from: Kjelt on September 04, 2024, 07:27:03 amOfcourse. As I wrote earlier: software is least of the problem of the Arduino ecosystem

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 04, 2024, 12:53:42 pm
content: Quote from: coppice on September 04, 2024, 11:31:38 amAs a non-EE hobbyist, having designed some simple PCBs myself, I can confirm. The sheer joy of having something that works outshadows any concerns about design failures or inefficiencies. It is pretty obvious many Arduino-related PCBs weren't designed by a professional.Many Arduino hardware designs are and will be made by non-EE hobbyists, so identifying their downsides and better designs (to us hobbyists) is very important and useful.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2024, 01:29:39 pm
content: Quote from: farrisee1 on September 03, 2024, 07:54:42 pmOr, as I have explained already, as a great way for beginners to get started and work their way towards "adult" solutions.Quote from: farrisee1 on September 03, 2024, 07:54:42 pmWell, clearly you can do that, even if it's a fairly expensive way to do things.On the other hand, we have no idea how many commercial products have a microcontroller on a custom PCB that is running Arduino code.Quote from: farrisee1 on September 03, 2024, 07:54:42 pmThis is the only part of your statement that is absolutely true.But as we've pointed out, you don't have to use the Arduino IDE. PlatformIO is an extremely common alternative, and there are others, like Visual Micro. And indeed, graduating from the Arduino IDE to a more powerful one is a step that tons of people make, as they outgrow the Arduino IDE. (I know that the more complex Arduino projects I did would have been a lot more work if I'd done them in Arduino IDE instead of PlatformIO.)