STM32 alternatives - Page 1
Forum section: electronics / general

author: Kalin
author_rank: Regular Contributor
timestamp: December 31, 2018, 01:46:23 am
content: I have done a couple of projects, mostly hobby level stuff, last one being a 5x5x5 LED cube to teach myself how to program mcu's. I have used an stm32f103 board for them with attolic true studio. I taught myself to use the SPL and and what it is doing at a register level which has been helpful for troubleshooting glitches and my mistakes in coding.What I have noticed is that I am nowhere near using these chips at capacity, so that led me down a rabbit hole of other MCU's and part families. I am interested in PIC microcontrollers but it seems like there are 5million different parts in 1000 different families. Is there any way to know what parts are useful and is it that difficult to learn coming from programming arm in c?ThanksSent from my SM-G965W using Tapatalk

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 02:09:59 am
content: Moving away from ARM is a strange move. So what if you don't use them fully? They are still mostly cheaper and easier to use than more crippled alternatives.

author: Kalin
author_rank: Regular Contributor
timestamp: December 31, 2018, 03:03:16 am
content: I think I phrased poorly. Perhaps it would be better to ask if it would be valuable to add another line to my toolkit. I see that there are some very cheap pic microcontrollers in very small packages that the STM32 lines don't come in. Is it worth learning pic for that reason or are there other arm Lin's that would be a better choiceSent from my SM-G965W using Tapatalk

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 03:13:37 am
content: I would definitely stick with ARMs unless your applications have very high volumes where PICs or other MCUs may make sense. Or you are space-limited, and want small 6- or 8-pin package.With mainstream ARMs 14-pins SOIC or TSSOP would be the minimum package size. I don't think anyone makes smaller parts.

author: eliocor
author_rank: Unknown
timestamp: December 31, 2018, 03:35:13 am
content: In the next future there will be available 8/20 pin ARM:https://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-mainstream-mcus/stm32g0-series/stm32g0x1.html?querycriteria=productId=LN2048

author: NorthGuy
author_rank: Super Contributor
timestamp: December 31, 2018, 04:11:00 am
content: Quote from: Kalin on December 31, 2018, 03:03:16 amYou don't learn PIC or ARM. You learn principles. Then you can apply them to anything, even to the things which don't exist yet.It is good to be aware what's available. It is good to try different things.

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 04:25:30 am
content: Quote from: NorthGuy on December 31, 2018, 04:11:00 amWhile it is true, there is no practical sense to spend a lot of time on outdated technology.If you feel like learning something that does not exist - play with RISC-V or something like that.

author: NorthGuy
author_rank: Super Contributor
timestamp: December 31, 2018, 04:48:07 am
content: Quote from: ataradov on December 31, 2018, 04:25:30 amExactly. Technologies come and go, but the principles remain. If history is any indication, everything you see around will be outdated 10 years from now.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 31, 2018, 05:48:24 am
content: Quote from: Kalin on December 31, 2018, 01:46:23 amC is available for most MCUs so there is not much change there, mainly the peripherals differ, and the documents differ too.If you wanted to expand a CV, knowing more than one vendor helps, and if you also know more than one core, that is a bonus.As to what parts areuseful, that also depends on what you intend to use them forIn some designs, wide Vcc matters, and STM32 are poor there, so someone might select an Infineon XMC1000 series, or Nuvoton NUC series, if they needed wide Vcc.Or, as you mentioned already, package can matter, and 8 bit MCUs have more choices in smaller-end packages than 32b ones.eg If all you need is a watchdog / system checker operation, who needs 32b for that ?

author: westfw
author_rank: Super Contributor
timestamp: December 31, 2018, 06:36:03 am
content: Peripherals may be significantly different between the STM32F103 and an ARM chip from some other vendor. In fact, peripherals can vary between ARM chips from a single vendor (IIRC, ST is somewhat better than average about sharing peripherals. But a SAM3X (Arduino Due) and a SAMD21 (Arduino Zero) are quite dissimilar. (and a "big" ARM, like a Raspberry Pi or Beaglebone, is another beast entirely.)

author: Bud
author_rank: Super Contributor
timestamp: December 31, 2018, 06:42:44 am
content: Quote from: NorthGuy on December 31, 2018, 04:11:00 am...which means you need to learn PIC or ARM

author: Bud
author_rank: Super Contributor
timestamp: December 31, 2018, 06:46:59 am
content: Quote from: ataradov on December 31, 2018, 03:13:37 amLow pin count PICs are very handy for simple tasks such as initializing a PLL or reading a quadrature encoder.

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 06:50:59 am
content: Quote from: Bud on December 31, 2018, 06:46:59 amQuite likely.My go to device is still SAM D11 in SOIC-14 package. I buy them in quantity, where the price is less than $1 and use them everywhere. Not having to switch toolchains totally worth it.This will likely to change if you are shipping 10k+ units/year. I doubt it makes any difference below that.SAM D11 can be replaced by cheaper D10 or D09 if you don't need USB. I just use D11 because I use them everywhere and the price difference does not matter that much in my case.

author: filssavi
author_rank: Frequent Contributor
timestamp: December 31, 2018, 08:58:00 am
content: As far as ARM go I suggest NXP(ex freescale) kinetis lineup, I think it is far superior to st one since the various MCU families (K V M etc) are actually targeted at real world applications, for example the kinetis V line is targeted at power conversion/motor control so it has a ton of pwm/timers, a lot of quadrature decoders, multiple ADC’s for simultaneous samplingThe K line is more a general purpose line, than you have the M line with better ADC’s, integrated PGAs better reference etc.With st instead they just throw more useless communication peripherals at it, the ADC is mostly the same in the whole lineup, they are limited to only one or two decent timers (the advanced timers, the basic ones are almost useless for everything but the simplest interrupt generation tasks) and so on, basically I feel that with them you are paying for silicon that will go unused

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 09:15:54 am
content: Quote from: blueskull on December 31, 2018, 09:10:29 amThat is still not a reason to actively learn it if you are just starting and not heavily optimizing for cost.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: December 31, 2018, 09:37:05 am
content: Since dev boards etc are so cheap, and the programmer is built in, there is no real downside to trying every MCU under the sun for at least one project, or just an evaluation. You end up with a box full of little boards but that still doesn't take up much space. I used to use PIC, like the classic 16F84 which was popular with hobbyists before Arduino, then found AVRs nicer to program with C/C++. With Cortex you've got everything from M0 to M7, and there are A series boards which are quite affordable (i.e. <$100, rather than $500 like some pro boards).I think the main thing about learning new MCUs, is that you learn how to find and solve their little quirks, like on an AM4379 with PDK v1.0.4, SPI 0 needs a small delay before putting data into the FIFO otherwise you never get a TX empty interrupt... or that on MC56F8345 linked 16-bit counters in timer capture mode occasionally latch a wrong value.But either way,https://jaycarlson.net/microcontrollers/is a fantastic place to start. Personally, I concentrate on ARM MCUs because that is most useful to me professionally, but it's really useful to be aware of what is out there.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: December 31, 2018, 09:39:09 am
content: Quote from: ataradov on December 31, 2018, 06:50:59 amDo you get an employee discount?

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 09:40:47 am
content: Quote from: donotdespisethesnake on December 31, 2018, 09:39:09 amNope. I just buy stuff from Digi-Key as everyone else.Even if I could get some sort of discount, I would not. I like to avoid conflict of interests.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: December 31, 2018, 10:06:20 am
content: Quote from: NorthGuy on December 31, 2018, 04:48:07 amExcept that the original 1987 BBC Basic for the original ARM CPU in the Archimedes... still runs fine on a Raspberry Pi (after 31 years). I've seen Sophie Wilson (she's the author of both) say that in a video on youtube.

author: mikerj
author_rank: Super Contributor
timestamp: December 31, 2018, 10:23:08 am
content: Quote from: ataradov on December 31, 2018, 03:13:37 amIf you can deal with wafer level packaged devices then there is the Maxim MAX32660 (1.6mmx1.6mm 16 pin) and the Kinetis KL03 (2.0mmx1.6mm 20 pin).

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 10:26:28 am
content: Quote from: mikerj on December 31, 2018, 10:23:08 amMost manufacturers will have WLCSP packages. But I assume general public will not be dealing with them. They are a level above BGA, and general public is not dealing with BGAs all that well.

author: nick_d
author_rank: Regular Contributor
timestamp: December 31, 2018, 11:29:40 am
content: Another vote for the Silicon Labs Sleepy Bee EFM8. From what my client said they are the cheapest MCU he could find (at least with the fairly basic capabilities he needed which was basically a few LEDs and buttons for the user interface and control of a smart battery charger), and they use much less power than ARM. While PICs and AVRs also fit this niche, they are more expensive (AVR more than PIC). As to PIC having a bewildering array of different options, that is more of an advantage than a disadvantage. They're all pretty similar to program, although be aware that PIC12xxx have a different architecture than PIC14xxx and different again PIC18xxx and so on. Otherwise the difference is only in the pin counts, memory and on-board peripherals, so it is immaterial which one you learn on. You can pretty much breadboard your design with any Sleepy Bee, PIC, AVR or ARM MCU in the target family and then when you lay out your PCB make the final choice of which part to specify (hopefully you will know by then how much code and data space you need, how many pins and which on-board peripherals). Having said that, this is only important for large quantity. For one-offs, do whatever is easiest. And beware premature optimization: stick to the easiest and most powerful chip (likely an ARM) unless there's a reason!cheers, Nick

author: cv007
author_rank: Frequent Contributor
timestamp: December 31, 2018, 01:01:02 pm
content: QuoteJust go to the parametric search on their website-https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=30048select Peripheral Pin Select- Yesyou are now looking at the 'newer' with many more features/memory/flashchoose your pin count- whatever you think you need (<=20 pin is a good start)there are still many choices, and you will not necessarily know what features you need, so just pick oneget a $20 curiosity board, replace the included mcu with one of your choice- up to 20 pins (although nothing wrong with the included mcu)https://www.microchip.com/DevelopmentTools/ProductDetails/DM164137download/installed MPLABX and XC8 and you are good to go.You are out $20 if my advice is bad.here is some C code for a pic16f15325 as an example-https://github.com/cv007/SNaPmateeverything is pretty simple in these chipsThe downside to these 8bit chips is they are 8 bits. The upside is they are simple to use, and have some nice peripherals.

author: NorthGuy
author_rank: Super Contributor
timestamp: December 31, 2018, 02:33:56 pm
content: Quote from: Bud on December 31, 2018, 06:42:44 am...which means you need to learn PIC or ARMNo. You need to learn principles, not peculiarities. You know that Indian story about the elephant:"A group of blind men heard that a strange animal, called an elephant, had been brought to the town, but none of them were aware of its shape and form. Out of curiosity, they said: "We must inspect and know it by touch, of which we are capable". So, they sought it out, and when they found it they groped about it. In the case of the first person, whose hand landed on the trunk, said "This being is like a thick snake". For another one whose hand reached its ear, it seemed like a kind of fan. As for another person, whose hand was upon its leg, said, the elephant is a pillar like a tree-trunk. The blind man who placed his hand upon its side said, "elephant is a wall". Another who felt its tail, described it as a rope. The last felt its tusk, stating the elephant is that which is hard, smooth and like a spear." (copied and pasted from Wikipedia)You need to make sure you see the whole elephant. And for that, you need diversity. You need to try ARMandPICand...<edit>More citation from Wikipedia:"And so these men of IndostanDisputed loud and long,Each in his own opinionExceeding stiff and strong,Though each was partly in the rightAnd all were in the wrong!"

author: NorthGuy
author_rank: Super Contributor
timestamp: December 31, 2018, 02:40:59 pm
content: Quote from: ataradov on December 31, 2018, 09:40:47 amTryhttp://www.microchipdirect.com- it's most likely cheaper than DigiKey, especially in quantities.

author: Bud
author_rank: Super Contributor
timestamp: December 31, 2018, 02:49:53 pm
content: Well, principles do not magically transform into specific applications. A day will come when you need to implement them on a particular technological platform, and to do that you have to learn the platform.

author: NorthGuy
author_rank: Super Contributor
timestamp: December 31, 2018, 03:07:20 pm
content: Quote from: Bud on December 31, 2018, 02:49:53 pmNot magically, but they make it easy to move into any platform, even for a short period such as a duration of a project.If, instead, you tie yourself to a specific platform, it'll be very hard to move on. There are many people who bought bunch of PIC16F84 15 years ago, it was their "goto" chip, they were very happy with it, but now it's very hard for them to move on, even to newer PIC16s which are not really dissimilar. ataradov does the same with his SAM D3 chips and risks falling into a similar position 15 years from now.

author: Yansi
author_rank: Super Contributor
timestamp: December 31, 2018, 04:19:55 pm
content: Quote from: Bud on December 31, 2018, 06:46:59 amUse STM8 micro for that. Cheap, and very good peripberal set VERY similar to what you find on STM32 family. For anyone knowing how to STM32, this is an obvious choice.

author: rhodges
author_rank: Frequent Contributor
timestamp: December 31, 2018, 06:14:03 pm
content: Quote from: Yansi on December 31, 2018, 04:19:55 pmI like STM8. Anyone who is getting started, I invite to look at my public libraries for various devices:https://github.com/unfrozen/stm8_libs/wikihttp://www.hodges.org/rh/stm8/index.htmlThese are built with the open source SDCC (Small Device C Compiler).

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 08:27:00 pm
content: Quote from: NorthGuy on December 31, 2018, 02:40:59 pmI work for Microchip, so I'm aware of MicrochipDirect. I buy 100-200 pcs at a time, and it is not cheaper in my case. Especially when you factor in shipping.With DigiKey I add MCUs to other orders, I rarely have to buy them purposefully.The key to buying with DigiKey is to wait for low prices. Sometimes they need to clear their inventory, and the prices go down by a lot (I assume down to their purchasing price). A couple months ago they were cleaning out old Atmel inventory and a whole bunch of SAM D devices were discounted like 50%. I've got a lot of DAM D21s in TQFP32 package for less than 50 cents.

author: james_s
author_rank: Super Contributor
timestamp: December 31, 2018, 08:47:16 pm
content: I still like the 8 bit AVRs, I find them much simpler to use than ARM so where they are adequate you could look into that line, the PIC is another popular one, now that Microchip has acquired Atmel both lines come from the same source. Since C is so standardized these days it's relatively easy to move from one platform to another, at least across similar classes of stuff. I'd say play around with the software toolchain for several different microcontroller families and pick one that you like. It can be quite educational porting code from one platform to another, you can end up more proficient with both. You might play around with some of the very tiny low pin count 8 bitters and see what you can do with one, they can be deceptively powerful.

author: fchk
author_rank: Frequent Contributor
timestamp: December 31, 2018, 10:19:06 pm
content: Most people think of an ancient 8 bit architecture when hearing PIC. They simply don't know that PIC is so much more. There is PIC24/dsPIC, which is a bit like AVR but 16 bit databus and with much more capable peripherials and much faster, and there is PIC32, which is 32 bit MIPS. It is basically the same instruction set and architecture that was used in expensive DEC Unix workstations in the early 90's, just shrunk to the size of a 4mm*4mm QFN package and with twice the speed. (the DECstation 3000 only ran at 20 or 25 MHz, but you get 50MHz at least - top of the line is about 200-300MHz).The peripherials are very similar across the architectures, so just use parametric search for the right combination of peripherials. Both PIC24 and PIC32/MIPS are very C friendly.

author: westfw
author_rank: Super Contributor
timestamp: December 31, 2018, 10:58:09 pm
content: QuoteI didn't know that digikey did that (though I've taken advantage of Newark's "closeouts")Does Digikey have a landing page for their "deals", or a search term?

author: ataradov
author_rank: Super Contributor
timestamp: December 31, 2018, 11:08:01 pm
content: Quote from: westfw on December 31, 2018, 10:58:09 pmI don't think so. They just drop the prices when they need to flush the inventory. Those D21 in various packages were sitting at low prices for almost a week before all were gone.This is the exact parts I've gothttps://www.digikey.com/product-detail/en/microchip-technology/ATSAMD21E15A-AUT/1611-ATSAMD21E15A-AUTCT-ND/6832769. They are listed as obsolete and a price is $1.85. Well, I've got a 100 of them at 40.5 cents.All "A" versions were declared obsolete.

author: emece67
author_rank: Frequent Contributor
timestamp: January 01, 2019, 12:17:26 pm
content: .

author: thieringpeti
author_rank: Contributor
timestamp: January 01, 2019, 01:08:57 pm
content: HI!I've never used PIC's, but AVR's and STM32's. I think PIC's were a bit outdated architecture, so I don't recommend learning it without a noticable reason. For 8-bit applications, I recommend AVR's or 8051-based MCU families, like the Silicon Labs C8051Fxxx family.STM32 is a very universal family. It can be easily programmed with lots of compliers, both open source and commercial. If you want to try something different, choose a widely available ARM MCU, like NXP's LPC family 32-bit ARM MCU's. These are very similar to STM32's, and many of the development software also supports them.And keep in mind, these MCU's can be extremely cheap. Only the chinese internal-market parts (e.g. Padauk 3-cents MCU) can be cheaper than a low-end AVR, PIC or STM32.

author: Howardlong
author_rank: Super Contributor
timestamp: January 01, 2019, 03:09:51 pm
content: I’m not sure of the viability of the 3c microcontrollers, unless you’re making super high volume and super low cost designs, or for a passing academic interest. OTP is a big reason to avoid for low to medium volume. I haven’t done any OTP stuff for about fifteen years, in fact I don’t think I know where my eeprom eraser is anymore for those expensive ceramic windowed versions of older OTP devices.I’m also not sure that you should discount PIC16 just because it’s perceived to be an old architecture. I’d hardly say that the 8051 you’re recommending is new on the block!Since most people nowadays write predominently in C and not assembly language, much of the underlying nonsense like bank switching is not on the programmer’s radar over 99% of the time. There have been many tweeks to the archtecture over time to improve things particularly for high level language implementation and debugging.In the end the choice of device is down to many factors, including its features and performance, and availability of skills on the device itself and the toolchains. For example, I haven’t done Silabs 8051 for about 12 years, so it’d be low on my list. I have recently done plenty of NXP and TI M0 and M4F though, some AVR 8 and 32 bit, as well as having a pretty deep experience of the entire PIC range. Undoubtedly that biases my choices.

author: nctnico
author_rank: Super Contributor
timestamp: January 01, 2019, 05:24:15 pm
content: Quote from: Kalin on December 31, 2018, 03:03:16 amIMHO TI's MSP430 line is good to have. I use them every now and then if I need something really low power.If you want to stick with ARM then the LPC1000 series from NXP is interesting as well. Compared to ST's ARMs the microcontrollers from NXP's LPC series use the same peripherals. This means you can re-use low level code from one project to another.

author: Karel
author_rank: Super Contributor
timestamp: January 01, 2019, 06:11:09 pm
content: Quote from: nctnico on January 01, 2019, 05:24:15 pmHow do they compare to the STM32l451xx models?STM claims that they consume 84uA/MHz.The STM32l452xx models can be used with an external smps and consume 36uA/MHz.Edit: The above mentioned currents are measured with peripheral clocks disabled.Worst case, if you enable all clocks for all peripherals, another 100uA/MHz is added. In practice it will be approx. 50uA/MHz.

author: Kalin
author_rank: Regular Contributor
timestamp: January 01, 2019, 06:34:02 pm
content: Lot's of good info here. It seems like the consensus is to only use the older 8-bitters if you need the low cost or tiny package size. Thanks for everyone who pointed out the 16 bit options, something I had never really looked into. I have an msp430 dev board around somewhere but was never able to get it to work. The TI IDE was pretty confusing and I have to admit I gave up after only a few minutes of trying since I got the board pretty cheap. I think I was trying to use Energia or something but never tried their CCS IDE.

author: Peabody
author_rank: Super Contributor
timestamp: January 01, 2019, 06:55:20 pm
content: Quote from: Kalin on January 01, 2019, 06:34:02 pmI like the MSP430s a lot. I think 16 bits is the Goldilocks size for microcontrollers, particularly if you ever code in assembler, which I do fairly often. And they are von Neumann architecture, which is convenient. While they were at the beginning of the really-low-power movement, I think the others have pretty much caught up. As for IDEs, CCS is just far too grand for what I do. I mainly just use a command line assembler. But I just used Energia for the first time, and it's pretty nifty. It's an almost direct port of the Arduino IDE for MSP430 and other TI parts. Seems to work well, and like Arduino, it's basically just GCC. The main downside of TI stuff is the cost. They are relatively expensive for what you get.They also have MSP432, which is low-power ARM, but I've never tried any of those.

author: james_s
author_rank: Super Contributor
timestamp: January 01, 2019, 07:34:26 pm
content: I think people often focus too much on something being "old" and therefor inferior. Pencils are old, wheels and levers are old, sometimes they're still a good tool for the job. If you have a simple task that is easily done by an 8 bit microcontroller it doesn't matter how old the architecture is, it's still viable if the part is affordable. For reasons that may not be entirely rational, it bothers me to throw a ton of silicon at a very simple problem even when the monetary cost is not all that much higher. The more complex the part, the more opportunity there is for bugs to creep in. It would be silly to use a 32 bit ARM if all you wanted to do is blink an LED.

author: nctnico
author_rank: Super Contributor
timestamp: January 01, 2019, 07:39:13 pm
content: Quote from: Karel on January 01, 2019, 06:11:09 pmThe MSP430 can run from a watch crystal and get into single digit uA territory while doing something meaningful. What shouldn't be overlooked is time from wake-up to doing something meaningful.

author: james_s
author_rank: Super Contributor
timestamp: January 01, 2019, 07:42:53 pm
content: I sat down to play with a cheap MSP430 board I got and after spending a couple hours trying to get the bloated, sluggish IDE and plugins installed, seeing cryptic errors that said to check a log but failing to mention which of numerous logs to check, I gave up, uninstalled everything, set it on the shelf and went back to the AVR.With any programmable device, try out the software used to develop for it because that is where many seem to fall short and often you are fairly stuck with whatever toolchain is provided.

author: nctnico
author_rank: Super Contributor
timestamp: January 01, 2019, 07:57:26 pm
content: I always used MSP-GCC for MSP430. Olimex has a cheap programmer for MSP430 if you have a device which doesn't have the serial bootloader.

author: Yansi
author_rank: Super Contributor
timestamp: January 01, 2019, 11:53:50 pm
content: Quote from: fchk on December 31, 2018, 10:19:06 pm16bits MCUs - no thanks really. That was a step in a wrong direction. It is a kind of catdog.Nowdays, there is not much reason to consider anything less than 32bits, except when really pushing every cent spent or dealing with ultra simple tasks. 32bit MCUs are not expensive. The price is really similar, some times even 32bits may come cheaper to do a task, due to technology improvements over the outdated junk some 8bits are filled with (yes, I am talking to you, microchip).

author: ogden
author_rank: Super Contributor
timestamp: January 02, 2019, 12:12:29 am
content: Quote from: Yansi on January 01, 2019, 11:53:50 pmI totally agree here. One exception would be already mentioned mass-production where every BOM cent counts. Other exception is market that may require product which is targeted at specific audience/microcontoller. As an example - shields for Arduino.If someone who already knows stm32 is asking me what's next, I would suggest Cypress Psoc 5 LP. I suggest to not only read leaflet, but get CY8CKIT-059 and play with it's digital and especially analog blocks/peripherals. This is not just another ARM uC, this is way more than that.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 02, 2019, 02:25:15 am
content: QuoteAgreed, but how about a GPL'd fast tethered Forth for that MSP430 ? All you need is a Tiva Connected Launchpad, which also programs the MSP430 via JTAG ...http://hightechdoc.net/mecrisp-across/_build/html/index.html

author: NorthGuy
author_rank: Super Contributor
timestamp: January 02, 2019, 03:08:10 am
content: Quote from: Yansi on January 01, 2019, 11:53:50 pmI don't think the number of bits is an important selection criteria - rather you select the MCU by the set of periphery (and its speed), number of pins, shape, perhaps power consumption, etc. Even for the people who use assembler, the number of bits isn't that important - rather they would seek a specific architecture. For people who write in C, the number of bits doesn't make any difference whatsoever. Even if it did, the majority of C writers try to be platform independent, so they write to the standard (such as C99) and try to avoid thinking of MCU peculiarities. Moreover, the majority of C/C++ writers don't even have enough skills to evaluate how a particular CPU architecture would affect their code.

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2019, 03:12:01 am
content: Quote from: NorthGuy on January 02, 2019, 03:08:10 amIt just so happens that you get more and better of everything with 32-bit MCUs. So looking first at 32-bit devices is a good selection strategy.And just not having to think whether to use uint8_t or uint16_t for your loop variable is very nice. Even with C/C++ if you care about performance of your code, you have to think about underlying device.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 02, 2019, 03:54:30 am
content: Quote from: ataradov on January 02, 2019, 03:12:01 amI haven't noticed this. There's a huge variety of 32-bit devices (and 8-bit and 16-bit as well).32-bit devices which try to be cheap are simply pathetic - they hardly have any periphery at all.32-bit devices which try to be powerful tends to have lots of stuff, but you only need what you need. If you need 6 ADC channels, it doesn't matter if your MCU has 10 of 100 - you only need 6. You will rather be concerned about ensuring the desired sampling pattern ad speed with your ADC, so you have to look at peculiarities. "More of everything" may be harmful as well. The side effect of "more of everything" is usually too many pins and too expensive.There are good compromises in the middle of these two extremes, you can find them in any varieties (8-bit, 16-bit, 32-bit). Sometimes, you get lots of MCUs meeting your criteria. Then you can pick what you like. Sometimes you hardly can find one. If it happens to be 8-bit, who cares. If it happens to be 32-bit, likewise.There are certainly cases when you need to think of underlying architecture. Such as, if you really need lots of floating point calculations, you probably will get something with FPU (and it will be 32-bit), and not PIC16 (which would be plain stupid). But if you don't, who cares. There's no premium for having unused stuff.

author: james_s
author_rank: Super Contributor
timestamp: January 02, 2019, 05:56:23 am
content: Quote from: nctnico on January 01, 2019, 07:57:26 pmI may pull it out again some day and give it a try, but for now I dug out a ATMEGA8 I had in my stash and had my project working in less time than I spent trying to get the TI software installed.

author: ogden
author_rank: Super Contributor
timestamp: January 02, 2019, 08:04:32 am
content: Quote from: NorthGuy on January 02, 2019, 03:54:30 amSuch statements requires examples, otherwise they are just that - statements not backed by facts.QuoteDo you know why powerful 32-bit microcontrollers have seemingly too many peripherals? - Just because they can. When you see die layout of such microcontroller, all you see is FLASH, RAM and CPU. Unless they are complex peripherals like Ethernet and USB, they take small corner yet there are gazillion of timers, serials, GPIO's and so on:https://upload.wikimedia.org/wikipedia/commons/8/89/STM32F103VGT6-HD.jpg

author: hans
author_rank: Super Contributor
timestamp: January 02, 2019, 09:26:19 am
content: It's a cliche , but keeping an open mind is the best thing.Some manufacturers will claim to have an 8-bit part with better power consumption than any MCU on the market, but who cares. In battery devices it's often the energy consumption that matters, especially with DMA and modern power saving features that make duty cycling of the CPU time possible, and aboveall finer granularity power management can make tightly bounded energy analysis non-trivial.I think one of the strong points on many 32-bit ARM parts is that they are made on a more modern technology. This helps with active power consumption, and if the manufacturer made an effort to create a custom cell library, can also yield satisfactory results in static power consumption. For example, Microchip released the ATtiny3217 in 2018. That part consumes 5mA typ at 15MHz. Meanwhile you can get a STM32L0 that consumes <3mA at 16MHz. Add to that the more capable CPU architecture, and I would be pretty confident in choosing a 32-bit ARM part for an energy constrained application.You can also have "too much" memory, by the way. You'll sometimes see granularity options for SRAM retention in sleep to reduce static power consumption, which may be somewhat elevated depending on the process technology.Some MCUs are unique, for example some PICs have 2 SPI peripherals in a 20-pin package. If you need it, then you choose that part.Another example: I was disturbed to find out the ATSAM V parts only have 2 dedicated SPIs (although some USARTs can be used as SPI-compatible), even with 144 pin packages. Then again that ATSAM V part has an integrated USB2.0HS phy, which is a solid reason to choose it over other MCUs.Although I only needed 2 SPIs (so 2 for 2 is "sufficient"), it does mean that the flexibility of the part is reduced. It puts a constraint on the board layout, where I absolutely must use a seemingly scattered arrangement of pins on the device at 40MHz+.

author: knapik
author_rank: Regular Contributor
timestamp: January 02, 2019, 10:51:29 am
content: How does STM32 specifically compare with other 32 bit ARM microcontrollers offerings from NXP, Atmel, Silicon Labs and so forth?

author: NorthGuy
author_rank: Super Contributor
timestamp: January 02, 2019, 03:43:07 pm
content: Quote from: ogden on January 02, 2019, 08:04:32 amJust go to DigiKey and find the cheapest 32-bit MCU.Today, at quantity of 100, this happened to be SAM D10:https://www.digikey.com/product-detail/en/microchip-technology/ATSAMD10D13A-MNT/1611-ATSAMD10D13A-MNTCT-ND8K flash, 4K RAM, 2 timers, 3 serials, ADC, 2 comparators, DAC, RTCVery good for the price actually. But does this look like "more of everything"?Skipping all similar Microchip products, the next contender is Cypress PSOC:https://www.digikey.com/product-detail/en/cypress-semiconductor-corp/CY8C4013SXI-400/CY8C4013SXI-400-ND8K flash, 2K RAM, TCPWM, I2CMay be the next one will give us "more of everything"? It is LPC802, approaching $1 already:https://www.digikey.com/product-detail/en/nxp-usa-inc/LPC802M001JDH16FP/568-13819-ND16K flash, 2K RAM, 2 x USART, I2C, SPIAnd I could continue several pages down with similar results until I come to the place where 32-bit MCUs start getting "more of everything".It's either cheap or powerful, but not both at the same time.

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2019, 05:22:23 pm
content: Quote from: NorthGuy on January 02, 2019, 03:43:07 pmThere are 3 timers in SAM D10, one of them is called TCC, which has a bunch of advanced features (motor control stuff), but Digi-Key does not count it in its search.Sorry, I though you put those devices as examples of a good thing.So what are the comparable 8-bit devices in the same price range you consider? You obviously can't compare cheap with expensive. But in the same general segment, 32-bit devices will almost always win.

author: emece67
author_rank: Frequent Contributor
timestamp: January 02, 2019, 05:31:17 pm
content: .

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2019, 05:38:22 pm
content: Quote from: emece67 on January 02, 2019, 05:31:17 pmEven for hobby projects, you need to be aware of the price difference. Otherwise you will just get used to solving all the tasks using the most expensive parts, making your skills less useful in a real world.

author: oilburner
author_rank: Contributor
timestamp: January 02, 2019, 06:27:30 pm
content: Quote from: donotdespisethesnake on December 31, 2018, 09:37:05 amWow, thanks for the link, some really good low cost micro controller stuff there!

author: nctnico
author_rank: Super Contributor
timestamp: January 02, 2019, 06:31:02 pm
content: Quote from: ataradov on January 02, 2019, 05:38:22 pmNot true. Only very few get to work in an environment where cost cutting is really critical. The most common mistake is that people only look at the cost of a component and not what it can do for you. Cheap components often means dealing with bugs and bad documentation. That ends up eating more time more quickly then you'd think. Messing around with a silicon bug for one week can easely cost 2000 to 3000 euros in wages and other costs. If the price difference between a good and a crappy controller is 2 euros then you'd need to sell at least 1000 units to break even again. Most designers will probably work on industrial automation and telecom projects. This kind of equipment doesn't sell in large badges.Also there tends to be feature creep. If you use a microcontroller which has some memory and CPU cycles left you can add new features quickly. This will help your employer and it will help the client.

author: nctnico
author_rank: Super Contributor
timestamp: January 02, 2019, 06:36:48 pm
content: Quote from: knapik on January 02, 2019, 10:51:29 amAtmel is on my blacklist. I've been bitten once too many by a nasty surprise in their devices (they oversell the features in their datasheets). I can't comment on the Silabs devices.ST microcontrollers are all over the place with different peripherals and you need a JTAG dongle to program them (especially the older ones). Newer ones have a serial bootloader but that has issues too. Fortunately I got paid my hourly rate when I had to deal with these.The NXP LPC series has served me well for over a decade already. Not the cheapest but solid performance, very few silicon bugs, easy to use peripherals and good documentation.All in all I would try to avoid the devices which try to compete on price. Too many silicon bugs and poor documentation.

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2019, 06:37:13 pm
content: Quote from: nctnico on January 02, 2019, 06:31:02 pmI'm not talking about hard optimizations and using the obscure parts. But there must be a general understanding of an actual performance required for a certain task.I unfortunately see that all the time - people use crazy Linux-based solutions for simplest tasks that a Cortex-M0+ can handle just fine.I'm not saying you should try to consider 3 cent Chinese MCUs, not at all.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 02, 2019, 06:48:14 pm
content: Quote from: ataradov on January 02, 2019, 05:22:23 pmI looked at the datasheet. I could have overlooked something of course.Quote from: ataradov on January 02, 2019, 05:22:23 pmI actually was surprised that these devices are so inexpensive. Looks like they got quite a bit cheaper since Microchip took over. Looks like Microchip is having a huge SAM sale going. May be I should buy some.Quote from: ataradov on January 02, 2019, 05:22:23 pmAbout the same. For 48 cents which the SAM was quoted for, you can get Busy Bee:https://www.digikey.com/product-detail/en/silicon-labs/EFM8BB10F8G-A-QFN20/336-3164-5-ND8K flash, 512 RAM, 4 timers, 3 PWM/PCA, ADC, 2 comparators, UART, SPI, I2C/SMBus, CRCor PIC12F1572:3.5K flash, 256 RAM, 4 timers, 3 PWM, UART, ADC, comparator, DAC, CWG

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2019, 06:52:10 pm
content: Quote from: NorthGuy on January 02, 2019, 06:48:14 pmOk, I guess it depends on the requirements, so abstract comparisons are not useful. In that specific case, I was not looking at anything without USB device peripheral. But that is just my requirement.

author: nctnico
author_rank: Super Contributor
timestamp: January 02, 2019, 06:52:55 pm
content: Quote from: ataradov on January 02, 2019, 06:37:13 pmThen we are on the same page hereIMHO a good skill to have is to not only have a good idea about the cost of the hardware but to also have a good idea about the amount of time something will take to implement.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 02, 2019, 06:55:01 pm
content: Quote from: ataradov on January 02, 2019, 06:52:10 pmOf course. That's exactly what I'm saying. You select the chip for your requirements. And the number of bits is not very important selection criteria (most of the time anyway).

author: westfw
author_rank: Super Contributor
timestamp: January 03, 2019, 10:32:39 am
content: QuoteWell, compared to the typical 8bit processor in the same price range, or with the same amount of flash, it has significantly more RAM, more Serials (well, actually more flexible "serials"), more timers (don't forget the SysTick Timer in the ARM core, the "RTC" is a simple timer, and the TCC that Ataradov already mentioned), and a DAC... so that's doing pretty good.OTOH, 8k of flash doesn't go that far on an ARM, especially if you're using any of the "common" libraries :-((ASF (Atmels chip library) is bloated. Newlib is pretty bloated. the floating point is generic libgcc code that is bloated. Peripheral manipulation is inflated by lack of "immediate" addressing modes in the CM0 instruction set. Bleh!) (https://github.com/WestfW/SAMD10-experiments)

author: Howardlong
author_rank: Super Contributor
timestamp: January 03, 2019, 04:15:57 pm
content: Quote from: ataradov on January 02, 2019, 03:12:01 amI've always been rather disappointed with the real world power consumption of 32 bit processors in button cell or energy harvesting type applications when compared to 8 bitters, even the supposed ultra low power ones don't really come particularly close in practical scenarios.

author: ataradov
author_rank: Super Contributor
timestamp: January 03, 2019, 04:27:00 pm
content: Quote from: Howardlong on January 03, 2019, 04:15:57 pmI have not used low power modes on non-Atmel devices, since my personal projects rarely need this. But I do have a lot of exposure into Atmel parts, and power consumption generally lower or at least very close on low power devices. And the variety of sleep options is better.Another thing is that with 8-bit devices I have always struggled to achieve numbers mentioned in the datasheet in real life. No such thing on the 32-bit devices. I think over time competition forced companies to apply creative measurement techniques. And transition into the 32-bit world provided a "reset" for that race.

author: ogden
author_rank: Super Contributor
timestamp: January 05, 2019, 12:12:16 pm
content: Quote from: NorthGuy on January 02, 2019, 03:43:07 pmThank you for pointing out. Did not know that you can get such a well-packet ARM for 0.5$, do not agree to you that this "hardly have any periphery at all". I am curious - could you please show me 8-bitter having price better than 0.5$ @100, peripherals better than: 2+1 timers, 3 serials,12 bit ADC and 2 comparators and 10 bit DAC?

author: james_s
author_rank: Super Contributor
timestamp: January 05, 2019, 05:27:29 pm
content: You're probably not gonna find an 8 bitter with that selection of features, if you're doing something that requires 12 bit ADCs and DACs you're probably going to want a more powerful CPU, 8 bit is for simpler tasks where all that extra stuff would be a waste.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 05, 2019, 06:34:50 pm
content: Quote from: ogden on January 05, 2019, 12:12:16 pmThis is probably an anomaly. Microchip put SAMs on huge sale. Very surprising. To me at least. Whether they're going to keep it that way or just getting rid of inventory is unknown. Does anyone know what were the prices on these SAMs a year ago?If you skip SAM in my post, you'll see two other examples which are more expensive than SAM and have hardly any periphery.

author: ataradov
author_rank: Super Contributor
timestamp: January 05, 2019, 07:13:50 pm
content: Quote from: NorthGuy on January 05, 2019, 06:34:50 pmThey were basically the same. The prices on common SAM device hardly changed since acquisition. The problem is availability. Even the part in the link is a Non-Stock part.The cheapest SAM D11 you can actually get immediately is just under $1.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 05, 2019, 10:01:12 pm
content: Quote from: ataradov on January 05, 2019, 07:13:50 pmI remember I looked at PIC32MM when Microchip had just released it, it was the cheapest meaningful 32-bit MCU. It was under $1 too. Perhaps around two years ago I guess. I guess I totally overlooked cheap SAMs. I need to look at them more attentively.

author: james_s
author_rank: Super Contributor
timestamp: January 05, 2019, 10:28:05 pm
content: Quote from: NorthGuy on January 05, 2019, 06:34:50 pmI'd be surprised if they're not phasing them out, since buying Atmel, Microchip has an unnecessarily large range of different architectures, it's probably in their best interest to consolidate to some degree.I tried using a SAM a couple different times and I was never able to get the USB bootloader to work to let me load the firmware. Finally just gave up.

author: westfw
author_rank: Super Contributor
timestamp: January 06, 2019, 08:05:18 am
content: QuoteActually, I think they're priced where they are supposed to be.There were some complaints a couple of years ago (before the acquisition) when Atmel raised the prices of the SAMD10/11 beyond what customers had been "promised." (can't find the thread, though. :-( )

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2019, 09:08:43 am
content: Quote from: NorthGuy on January 05, 2019, 06:34:50 pmOk. So you admit that your argument is kinda invalidated by first chip in the list. Then last one - Cypress Psoc 4. I strongly disagree that uC withreconfigurable peripheral and analog blockshave lack of peripheralsHow about fact that you can create unique peripherals having no equivalents in any other microcontroller? - You just make what you want, not pick microcontroller with periphery you need.

author: westfw
author_rank: Super Contributor
timestamp: January 06, 2019, 11:02:27 am
content: QuoteOnly some of the PSOC4s have the reconfigurable peripherals. The low-end PSOC4000 don't have any programmable digital at all, and only do I2C for serial. As you get to the 4100 and 4200 series, things get more interesting (but also more expensive.)

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2019, 11:38:35 am
content: Quote from: westfw on January 06, 2019, 11:02:27 amThank you for clarifying. I find such psoc w/o actual psoc features useless, especially considering it's MSRP. In this case NorthGuy argument is very strong and I do agree.

author: josip
author_rank: Regular Contributor
timestamp: January 06, 2019, 12:43:03 pm
content: Quote from: Karel on January 01, 2019, 06:11:09 pmhttps://forum.43oh.com/topic/3416-stm32l-vs-msp430f5-whats-left-for-msp430/BTW, I know MSP430 very well, and for some simple low cost task covered by 2xx flash series, there are OK. But I switched from MSP430F5xx (performance) USB devices to M0+, that offer much more for the same price. I don't see any point in MSP432today, because there are plenty of others M4 devices from different vendors that offer much more, for half of the MSP432 price. And I don't understand today, direction (regarding micro-controllers) where TI is going.Unfortunately, selection criteria for micro-controllers on digikey / mouser ... is not enough, and significant time must be spend to find the right one.

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2019, 01:30:08 pm
content: Quote from: josip on January 06, 2019, 12:43:03 pmMsp432 seemed like gap filler from the very beginning, clearly not intended to fight for overcrowded low-end ARM MCU segment. Maybe it was push from some big customer to offer msp430 peripherals with ARM core. Maybe they prepared to move their wireless MCU's to ARM using such half-step? After all they are very strong in performance ARM and special function ARM segment, not to mention DSP and realtime MCU's. Msp430 still have it's market share as well.My two cents: hobbyists that are TI fans shall ignore msp432 and either continue to use msp430 or try something like Tiva C series ARM for higher than msp430 performace solutions. For those like me who are not fan of any mfg, I suggest.. you guessed right - stm32 (or maybe Psoc 5LP).

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 06, 2019, 05:22:41 pm
content: The MSP432, like its older brother MSP430, was targetting very low power. Back then, with their 48MHz max clock freq. on a Cortex M4 core, it was obvious they were designed for the very low power, 32-bit MCU market.Back when TI was working on it, it actually did make sense. There were not many ARM-based MCUs on the market that could beat the MSP432 in terms of power consumption, and they also wanted to leverage the MSP430's success. Unfortunately for TI, competitive very low power ARM MCUs began to appear on the market pretty much at the same time. They later introduced a couple of new MSP432 variants with embedded ethernet controllers that can run at up to 120MHz, so they are probably trying to catch up and not let the MSP432 line die.I evaluated it a couple years ago. The dev boards were insanely cheap. The MCU was pretty decent. Very low power indeed, and TI's "peripheral library" was much less bloated that STM's HAL AFAIR, and easier to understand, so you could get something up and running in no time.I eventually selected the STM32L4 line instead for various reasons (availability, much more capable, more device options, lower power for some, etc)That said, for people using MSP430 MCUs, I wouldn't reject the MSP432 altogether. It's significantly more powerful, is ARM-based and will probably be familiar regarding its peripheral set. For those using the MSP430 for its low power characteristics, the MSP432 is a very reasonable "upgrade". Of course for those just familiar with the MSP430 by accident and not caring about low power, the MSP432 would probably not make much sense.As to the MCU/wireless SOCs, TI already has the CC line with Cortex-M3 cores and 2.4GHz RF cores, such as the CC2640. They combine very low power and decent performance, and are pretty cheap.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: January 08, 2019, 10:00:53 pm
content: Quote from: nctnico on January 02, 2019, 06:36:48 pmI've had a similar experience with the Infineon XMC4000-series. Not the cheapest, but well-thought-out peripherals and low bug counts. The documentation is mostly good quality, although it's a little rough in spots as I suspect the originals were written in German and translated into English.

author: udok
author_rank: Regular Contributor
timestamp: January 10, 2019, 09:12:00 am
content: I did some work with the newest MSP432 last month.It is not cheap, but perhaps it is the only Arm M4 part with an integrated Ethernet Phy!The eval board comes with good documentation and it is rather easy to setup a simple web server.Performance is not bad, i achieved about 9 MByte/second with an echo server test on the100 MBit Ethernet.

author: josip
author_rank: Regular Contributor
timestamp: January 10, 2019, 09:27:10 am
content: Quote from: udok on January 10, 2019, 09:12:00 amThis is Tiva series that has nothing in common with MSP430, except the name.And it was only M4 with Ethernet, 5 years ago. Not today.

author: udok
author_rank: Regular Contributor
timestamp: January 11, 2019, 11:08:26 am
content: The part i was talking about is the SimpleLink MSP43E401Y / MSP432E411Y.This is an Arm M4F with Ethernet Phy and USB 2.0 (but without Phy).

author: josip
author_rank: Regular Contributor
timestamp: January 11, 2019, 11:38:58 am
content: Quote from: udok on January 11, 2019, 11:08:26 amYes, I know, and this part with min 3V VDD lost any connection with MSP430 family. It is renamed Tiva.