Live data from Hacker News

How to pick a microcontroller

sureshjoshi.com

21–30 of 100 posts

Re: How to pick a microcontroller

#21

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 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 real world, if you work with battery-powered devices, you never have the comfort of busy waiting for your UART/I2C transmission to finish, or calling analogRead() and getting immediate results (because ADC takes time and you want to do it asynchronously).

It's my pet peeve: I'm very happy that Arduino has been such a success, but I think too few people progress beyond that, and many believe this is how one programs embedded devices.

As for RPI, it's neither a production device, nor a learning tool for embedded programming. The complexity involved means there is no way a beginner can understand everything that's going on.

Re: How to pick a microcontroller

#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 monster M4 chips with 1M flash and every peripheral one can imagine. They not only share some peripherals, but you use the same SDK, documentation formats are the same, etc.

This is a huge time saver and lets you use the right chip for each project, instead of sticking the same expensive microcontroller everywhere, or using ones from different manufacturers.

Re: How to pick a microcontroller

#23

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

Do you want to understand in detail what's happening? => Arduino UNO

I wonder what your definition of "understand in detail what's happening" is if you recommend an Arduino for that.

It doesn't have to get as far as https://www.youtube.com/watch?v=UJHeDvr_doM (something that I recommend every should try at least once if they claim to know how things really work) but I think reading the datasheet and using the bare MCU with Asm is a good start, things which those staying within the limits of the Arduino ecosystem wouldn't be doing.

Along the same lines as that, there's also https://www.youtube.com/watch?v=8ZYMrcHm91s for those who claim to understand I2C.

Re: How to pick a microcontroller

#24
Generally solid advice (although its more like "how to pick a micro-controller for your design you're trying to keep as cheap as possible.") and one of the areas where I quibble is the use of "generator" tools to generate I/O code. The STCube application is easy to use for beginners but easily uses twice as much flash as actual user written code. That isn't a problem if your app is small and the flash is large but puts you at a disadvantage if you are competing with people who know how to write that code.

My philosophy has been to develop an understanding of the peripheral fairly deeply, write a 'driver' for it and a bunch of documentation that will remind me of the quirks when I come back to it, and then put that in a library. The benefit is 'easy code' (just use the library) that is more efficient and smaller than generated code, and a quick spin up document if I need to dive in and do more complex work with the peripheral.

Re: How to pick a microcontroller

#25

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.)

The Teensy boards are fabulous. I'm so impressed by what Paul Stoffgren has done. He must be some kind of 100x developer. And there are some power users of his boards, who have contributed libraries as well. It's worth noting that while you can ease your way into programming with the functions available within the Arduino IDE, there are libraries for many of the special functions of the chips, and all of the special…

Having worked on college labs with Paul 100x is about right. We just kinda looked in wonder at his projects... and he sold us the parts for ours... A real serving individual actually.

Re: How to pick a microcontroller

#26
post #21

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 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…

>I disagree.

You don't seem to actually disagree.

You said: >Sure, if you never programmed a small device, by all means, start with an Arduino.

And the OP said advice "for real beginners", i.e., people who have never programmed a small device. I didn't read anything that hinted that the OP was suggesting people never advance beyond Arduino.

Again your disagreeing with things the OP never said.

You: >As for RPI, it's neither a production device, nor a learning tool for embedded programming.

OP: >you really just want a small computer running Linux but with GPIO-Pins?=> Raspberry PI

Re: How to pick a microcontroller

#27
post #12

Earlier quoted context omitted.

I'll append with: Do you need wifi: Wemos D1 mini Do you need bluetooth low energy: light blue bean

Light blue bean is $30. ESP is production ready. But doesn't have bluetooth (esp32 is not ready for prime time yet). What are other considerations? Wemos D1 mini or NodeMCU :).

"esp32 is not ready for prime time yet"

There are some rough edges, but its already very useable, especially since the new silicon came out. Got anything specific in mind?

Re: How to pick a microcontroller

#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 aren't particularly BOM cost sensitive and the headroom + foolproof firmware updating are fantastic (as the article says).

Re: How to pick a microcontroller

#29
post #12

Earlier quoted context omitted.

I'll append with: Do you need wifi: Wemos D1 mini Do you need bluetooth low energy: light blue bean

Light blue bean is $30. ESP is production ready. But doesn't have bluetooth (esp32 is not ready for prime time yet). What are other considerations? Wemos D1 mini or NodeMCU :).

For BLE, but no Wifi, nRF51/52 chips seem like a good fit; bonus is that they're low power,

Re: How to pick a microcontroller

#30

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

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.)

I'll have to look into those. Being able to start with the Arduino IDE is a big plus for beginners.
Post reply on HN