Live data from Hacker News

How to pick a microcontroller

sureshjoshi.com

51–60 of 100 posts

Re: How to pick a microcontroller

#51
Couple of thoughts after skimming the article. Consider weighing the importance of being able to upgrade or change uC. Don't choose a controller made by only one manufacturer (unless there is a level of certainty or confidence in their continued production/support and profitability). It would be unfortunate for example, if you used an atmega microcontroller and they went out of business, or changed their strategy and abandoned a platform, requiring you to switch to an alternative and rewrite some or all of your code. Having a codebase that can be made to run on different platforms easily would be ideal.

If there is a good chance, after a small order, you realize from feedback you are missing some crucial features and need to make changes, changes which require more it's higher or more precise clock, or whatever, make sure that the jump to the next size chip doesn't abandon or make a drastic jump in price or available volume. If you plan to manufacturer your product for a long time, ensure that you are confident in the availability of quantities at similar price for however long you expect to require it. Always be wary of jumping on board anything brand new. The Intel Edison/Curie for example based on the Quark ended up having an unfixable segfault, and was virtually abandoned shortly after it's release.

Re: How to pick a microcontroller

#52
post #39

Earlier quoted context omitted.

Paul Stoffregen's Teensy boards are the way to go. The hardware and the software are excellent. Heaps of power thanks to the ARM Cortex M4 and you still get the Arduino IDE. Can't recommend them enough, wish I had of moved to them far sooner. Everybody I've given one to has loved them, and the USB support is also very welcome. (As far as price goes, they're development boards and worth every cent for beginners.)

One of the things I like about this choice is one does not need an IDE, at least not with the 2.0. One can do non-graphical (systems) programming on an underpowered computer with no graphics. I statically compile the loader. On BSD at least, no 3rd party libs are needed. Then all I need is avr-gcc. I can do everything from the command line. No closed source tools. No requisite graphics layer (e.g., Windows OS). No la…

Any of the Cortex-M* series are also generally a good choice, for example the STM32* series. All of these are supported in mainline gcc, and have open source support libraries provided by the vendor or via libopencm3. Be a bit careful, as some vendors like to use proprietary licenses for their headers, but in most cases there is at least one open source alternative.

And of course the RISC-V HiFive1, though it's still very new and in sampling quantities.

Re: How to pick a microcontroller

#53
post #43

Earlier quoted context omitted.

You can actually do a soft transition from the (opaque) Arduino programming style to a programming style closer to hardware. After all, Arduino programs are just C++ and you can plug in your own functions and assembler and you can even compile and upload your own ASM/C/C++ program written from scratch and compiled with the gnu-avr-toolchain to the UNO. After you have done all of that it might be a good idea to start…

Isn't it better to start with the mbed though(if you intend for a commercial product, at least at kickstarter/~20K-units level) ? The quality of the libraries is higher(written by professionals), you have a wider selection of supported mcu's if you'd need to port, some mcu's support the mbed, easy to-use low-power api(an event driven framework that automatically puts the mcu to sleep when it isn't needed), ARM has pu…

Not really, I generally find vendor libraries to be middling in quality, I think the core Arduino libraries are actually far more battle tested (if much less featureful). If you don't need more than the Arduino provides, it's probably not worth the extra complexity.

The Atmega8 (and entire series of attiny/atmegas) is totally suitable for commercial applications - just stick the chip directly on your PCB. AVRs are pretty ubiquitous in consumer products.

Re: How to pick a microcontroller

#54

A quicker guide for real beginners: Do you want to understand in detail what's happening? => Arduino UNO Is the UNO too small/slow? => Arduino Due Still too small or you really just want a small computer running Linux but with GPIO-Pins? => Raspberry PI

I would say that if you are looking at getting started with embedded electronics from an electrical engineering/professional stand pint and looking to put things into production then don't start with Arduino and certainly don't view an RPi as a viable embedded solution. A PicKit 2 and a 16F series Microchip microcontroller would be a much better starting point just to get up and running without feeling overwhelmed.

I agree with not starting with the RPi (to avoid the complexities of the Linux kernel), but I started with the PIC and SX series (before Arduino was a thing) and wouldn't recommend it anymore. If you want to learn an assembly language and twiddle registers then maybe you'd like the PIC, but I don't think it's more "professional" - virtually everyone uses C if at all possible at this point, and the AVR (or bigger PICs) are just as "production-ready" as the old PIC16F series. And you can still twiddle AVR registers with C if you so desire.

Re: How to pick a microcontroller

#56
post #38

Earlier quoted context omitted.

A more productive way to make this point is to simply ask what the terms mean. UART is a programmable serial interface; it usually refers to the kind of serial you speak to peripherals in the outside world, as opposed to something like SPI, which is serial spoken to components on the same board. BOM is "bill of materials". It's the catalog and price of all the components needed to ship an actual product. If your chip…

Its all readily googlable, certainly. My point was that its poor practice when writing a piece aimed at introducing people to a subject; if they have to go to google every few lines to see what something means, that distracts attention from what the article is actually trying to convey. For that matter, they could just as easily google for a different article.

The author should have used this shameless plug of mine: https://skorokithakis.github.io/expounder/

Re: How to pick a microcontroller

#57
post #28
post #22

One more thing to consider: if your time is limited and you have to design/build lots of different devices, stick to more extensive product lines. As an example the NXP Kinetis, while having its share of warts and issues, is a huge product line with hundreds of chips, sharing a similar architecture. This means that you can use a chip that fits requirements well, ranging from tiny simple M0+ devices all the way to mon…

I switched from STM32 to the Kinetis family two years ago and I've been super happy with the change. The free IDE is actually pretty solid and support has been adequate. Now that Freescale has been doubly gobbled up (first by NXP and then NXP by Qualcomm) this may go downhill a bit, but the user forums are decent. Edit: I'm also using an M4 with dual bank flash almost everywhere. The projects I'm doing these days are…

Interesting -- could you write about your impressions? How do peripherals compare? I think you get 32-bit timers on the STM32? And I heard that most other peripherals are newer/better than the 8-bit peripherals that NXP/Freescale adapts to the Kinetis chips -- what do you think?

Re: How to pick a microcontroller

#58
post #21

Earlier quoted context omitted.

I disagree. Everything you listed a) can't be used for products, b) doesn't let you make progress beyond "oh look, I lit up an LED!". Sure, if you never programmed a small device, by all means, start with an Arduino. But after you do light up that LED, please learn more. Go bare metal, learn about interrupts, state machines, entering sleep states -- without those things you'll stay forever in the toy world. In the re…

As the other poster stated, you don't really disagree, just misunderstand. You can actually do everything you need in the Arduino IDE and then leave the IDE, compile and upload your own program written from scratch to the UNO. All that while staying compatible to the dozens of hardware extensions out there. The "Arduino" part is not the destination, it's three quarters of the path to the destination and that path is…

No, I do not misunderstand -- I design products, as in things which are produced. Arduino is not for making products.

Re: How to pick a microcontroller

#59
post #38

Earlier quoted context omitted.

A more productive way to make this point is to simply ask what the terms mean. UART is a programmable serial interface; it usually refers to the kind of serial you speak to peripherals in the outside world, as opposed to something like SPI, which is serial spoken to components on the same board. BOM is "bill of materials". It's the catalog and price of all the components needed to ship an actual product. If your chip…

Its all readily googlable, certainly. My point was that its poor practice when writing a piece aimed at introducing people to a subject; if they have to go to google every few lines to see what something means, that distracts attention from what the article is actually trying to convey. For that matter, they could just as easily google for a different article.

Your confusion stems from what kind of beginner the author means. You read it as "total beginner to anything vaguely related to microcontroller programmer". I assume the authors means it as "has programmed stuff with microcontrollers before but never made a hardware design from scratch yet". After all, picking a microcontroller is a design/architecture choice more than a programming choice.

Re: How to pick a microcontroller

#60

A quicker guide for real beginners: Do you want to understand in detail what's happening? => Arduino UNO Is the UNO too small/slow? => Arduino Due Still too small or you really just want a small computer running Linux but with GPIO-Pins? => Raspberry PI

There is also the Particle Photon which is a really nice little ARM board with built in WiFi. The library is more or less the same as Arduino, but not quite identical. It's still ARM C underneath so you can interleave your own code if you want to. It costs around $20.

The system is designed to work with their cloud interface, but everything is open source and you can run offline if you need to. What's particularly neat about Particle is that if you decide that you want to make a product, they've got extensive guides on how to do it.

Post reply on HN