3 ms·
What's really amazing is that for less than $5 nowadays you can have a 1GHz+ quad core ARM Cortex-a53 with FPU and NEON support. I mean, sure, your entire devic
by 0xbear 9y ago
What's really amazing is that for less than $5 nowadays you can have a 1GHz+ quad core ARM Cortex-a53 with FPU and NEON support. I mean, sure, your entire device will be more than $5, and it'll be kinda power hungry at 3W or so running full tilt, but that's a pretty beefy chip for the price of a venti Starbucks latte, capable of running full Linux, with GPU, media encode/decode, etc, etc.
- hwh 9y agoIt is all a question of use case. This reply comes up all the time when I talk about how I use microcontrollers and what I use them for. For myself, microcontrollers offer me maximum control with minimum overhead. No OS, or maybe just some RTOS that does not really "boot" except for copying initial values for variables from Flash into RAM, being done in a fraction of a second. Switch it on, off it goes. Interfacing with SRAM and Flash without a driver. You can do MCU based PCB designs. It gets harder when it comes to the mentioned Cortex-A. It will be harder to sample, say, 40 pieces of them. You're very much supposed (and better off) to buy boards like OrangePi or similar. ESP designs, especially ESP32, are somewhat in between. Started off as a little documented blackbox with a RTOS interface it is now a much better (but absolutely not on par with Cortex-M designs) documented platform. However, part of it is still a proprietary code blob. They are beefy beasts, however, and when you need just that - well, it's a no-brainer. I just wish they were documented like STM32s plus ARM manuals and had a little more toolchain support. The price tag keeps me from complaining any louder. When you don't really have hard constraints and are fine with a 5 second bootup, chose whatever fits your bill. When exact timing is an issue (and you don't want to go bare metal on the Cortex-A), when fast bootup is an issue, well - better look at MCUs.
- 0xbear 9y agoNot gonna argue with that. I do use MCUs myself where appropriate. I like that they’re more hardware than software: flash the thing once and it will work every time from there on out. Very few moving parts, everything is very simple, power consumption is measured in milliwatts. But it still blows my mind that the equivalent (a vast superset, if you consider the GPU and specialized coprocessors) of my workstation from the late 90s now costs less than $5.
- dragontamer 9y ago> $5 nowadays you can have a 1GHz+ quad core ARM Cortex-a53 with FPU and NEON support. And probably no realtime clock, or well-documented ADC / DAC. Sometimes, all you gotta do is: 1. Measure a voltage from something (external temperature sensor: such as a Thermistor: a resistor whose resistance changes based on the temperature. Apply a constant current to a Thermistor, and you'll get voltage that varies with temperature) 2. Change the voltage somewhere else. (IE: ramp a motor up or down based on the temperature). 3. Do this from ~500 to 10,000 updates per second (ie: 500Hz to 10kHz / An update every 2ms to every 100 us). Don't be fooled by CPU specs. They're actually rather unimportant in the microcontroller world. Good features to have are like... integrated OpAmps, ADCs, DACs, Timers, and other features that allow you to do job #1 and #2 better. Even an Arduino/ATMega runs at 20MHz, giving you 2000-cyles per 100-microseconds. And that's why Arduinos are so popular, because they have all the ADCs / Timers needed to do the job, and 20MHz is way faster than what most people need. A more "premium" chip would have OpAmps, which will offer finer voltage control and more customization for the hardware engineer. I guarantee you: if you're doing hardware (aka: reading voltages and setting voltages), you will NEED a bunch of OpAmps on the board somewhere. So chips that come with integrated OpAmps can really cut down on external parts. Most of these cheap parts go up to 100MHz (ie: 10,000 cycles per 100-microseconds), but really don't have a need to go beyond that. Besides, higher MHz means more power usage... and a lot of these uCs are designed to run on button-batteries for literally months (assuming you get the right amount of sleep). So power-efficiency severely trumps processor speed in their typical use case. -------------------- Anyway, consider this. If you have a 1GHz chip but your ADC converter only runs at 50kHz, then you practically can't do more than 50k updates per second. Because at best, your system is only able to read the voltage level once every 50kHz. It takes a bit of time for voltages to settle down and make a decent measurement. I'd imagine that for most of these chips and systems, they're limited by peripherals and not by CPU power.
- LeifCarrotson 9y ago> or well-documented ADC / DAC. Oh, they're well-documented alright, over these 4000 pages of PDFs from our various portals and manuals and peripheral standards and ARM standards and SDK code and...probably a few other places. So thoroughly documented you could never finish reading it all before the chip is obsolete!