stm32 vs pic32  - Page 1
Forum section: electronics / general

author: Wolfram.Chrome
author_rank: Contributor
timestamp: January 26, 2016, 01:55:40 pm
content: I will start to learn digital electronics stuff,like mcu programming etc.....For me this adventure is like an investment for my future,because i want to learn to working on only 1 Microcontroller without switching over all those which already exist around.I want to choose one type of mcu,because im not happy if i must to learn more about 1 mcu like atmel etc etc etc....,i don't want to loose my time ......i want to take only 1 for all that possible kind of projects.However the question is :WHICH ONE ?

author: Philfreeze
author_rank: Regular Contributor
timestamp: January 26, 2016, 02:35:32 pm
content: - The ARM architecture is currently the giant on the market as far as I am aware of.- Additionally there are multiple companies producting ARM Cortex based chips (NXP-Freescale, ST, Atmel etc.)So I would go with ARM cortex to learn embedded development but I can't really recommend a specific family like STM32 or LPC because I don't have a lot of experience with them.I would wait for a second or third opinion just to be sure. (Maybe I am wrong)

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: January 26, 2016, 03:07:35 pm
content: My opinion would be to go for something that you will get up and running. If you know how to do basic things, like manipulate pins on the micro controller, you can usually find other chips to interface with other things.My suggestion would be to go for the MSP430 Launchpad from Texas Instruments. Support is great, and it is very cheap.Of course the Arduino and similar platforms makes it super-easy to get something going, but if you want to dive right in, the MSP430 would be my choice.I think it's more important being able to pick up a new micro controller and figure out how to use it, rather than knowing how to shoehorn a specific part into every project. Sometimes you only need 8bit with three pins, and sometimes you need 32bit ARM with 50 pins.Good luck!

author: nctnico
author_rank: Super Contributor
timestamp: January 26, 2016, 03:27:24 pm
content: Nearly a decade I looked at both ST and NXP ARM devices and choose to use the ones from NXP due to much more mature peripherals at that time. In the meanwhile I looked at ST several times but still didn't see compelling reasons to use ST's devices. One of the nice features of the NXP devices is the serial bootloader and some USB enabled devices can be programmed by just copying the firmware into the device like you are copying a file onto a USB stick.

author: bktemp
author_rank: Super Contributor
timestamp: January 26, 2016, 03:34:14 pm
content: I find PIC32 much easier than STM32 because I was already familiar with PIC24/dsPIC33 and most of the peripherals are identical or similar.STM32 is a total different beast: It has more and more powerful peripherals. If you need them they are great, but you have to read 1000-2000 pages of the reference manual (or at least the section for the peripheral, but it still can have hundreds of pages).I would not recommend STM32 or PIC32 as the first processor to learn, because there is so much you can make wrong.AVR (arduino) is probably better because it does all the low level stuff for you (if you want).If you know how to program a microcontroller it is quite easy to change to a different one.

author: zapta
author_rank: Super Contributor
timestamp: January 26, 2016, 03:39:27 pm
content: Quote from: nctnico on January 26, 2016, 03:27:24 pmNXP also has a free (up to 256k) IDE that is easy to install and runs on all three OSs. This was a key factor for me.OP, to standardize on 32bit processor I would choose ARM over PIC. You need to choose the vendor, level (M0, M3, etc) and actual IC. This of course depends on your preferences and what you want to do with it. For me the LPC11u35 was a good fit, small footprint, USB loader, free IDE and mbed compatible. Definitely not the only good ARM choice.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: January 26, 2016, 05:09:26 pm
content: Hmmm. Interesting question. Based purely on a popularity contest ARM is the way to go as it's currently the darling of at least a dozen companies making variants of the Cortex-M0/3/4/7. The PIC32, on the other hand, is a one-act play from Microchip.Narrowing the decision down to STM32 and PIC32 complicates things somewhat. STM32 is based on the ARM Cortex-M series, while PIC32 is based on MIPS32. Both of these are nice and viable 32-bit architectures, so there's really no reason to choose one or the other purely on the basis of the core. The core is only one part of a microcontroller, however, and both support roughly the same set of peripherals. In my opinion, the PIC32 peripherals are somewhat simpler and easier to understand than the equivalent STM32 peripherals, but that's a minor point.Development support is another matter. There are many more options with STM32 (and ARM in general) than there are for PIC32. I know of three development environments for PIC32: MPLAB X/XC32 by Microchip, mikroC by Mikroelektronika, and EmBitz. MPLAB X and EmBitz are free and mikroC is not (although at USD$300 it's not too pricey). There are many others for STM32, include some expensive commercial products (IAR and Keil), some medium priced commercial tools (Rowley CrossWorks and VisualGDB), and free tools (EmBitz, Atollic TrueStudio).STM32 has an advantage over PIC32 when it comes to hardware debuggers. Microchip has the $48 PICkit3, but it's slow and only usable with the PIC32 if you have lots of time on your hands. The next step up is the ICD-3, at $200, which is much faster than the PICkit3. ST has the ST-LINK/V2, which is only around $20, and it's faster than the $200 ICD-3.Bottom line: you could choose either STM32 or PIC32 and get along fine. Skills learned on the STM32 are more transferable to other manufacturer's parts based on the ARM Cortex-M, so in my opinion that's really the primary reason to go with that choice over the PIC32 (that, and the wider choice of development tools and cheaper hardware debuggers).

author: MT
author_rank: Super Contributor
timestamp: January 26, 2016, 06:01:28 pm
content: Quote from: Wolfram.Chrome on January 26, 2016, 01:55:40 pmNo matter what you chose that you areguaranteed!My "bare metal" experience are PIC32 is faster to get something real application like up and running (not a blinky led or wiggle leg) but beyond that STM is way more usable when you run into demanding applications, DAC's for instance or way better Timers but all depends on your application(note; i haven't dealt with PIC32 in couple of years). Now when MCHP bought Atmel and will get access to already made 300Mhz ARM MCU while later PIC32 seams to be a drag due to silicon bugs....well all this without even mention everything else that's terrible with PIC and ST and TI and NXP, etc they all contain a bad or two in their specific wayno matter what you chose, just be prepared for it!

author: dannyf
author_rank: Super Contributor
timestamp: January 26, 2016, 07:53:24 pm
content: The answer depends on why you want to learn.If you want to make a living out of this, go after any of the arm chips - much more marketable / fashionable.If you just want to learn for fun, any will do. Most arm chips have fairly advanced peripherals that can be difficult for a newbie. The exception here might be msp432. The hardware complexity has driven the oems to provide various libraries which can be difficult to learn.Pic32 in comparison has much simpler (or primitive, depending on your perspective) peripherals that a newbie can get up and running quickly.From the point of the cores, it makes zero difference to the programmer aa you are likely coding in a high level language like C.

author: Muxr
author_rank: Super Contributor
timestamp: January 26, 2016, 08:01:29 pm
content: Quote from: zapta on January 26, 2016, 03:39:27 pmI just decided to give NXP a try based on your post. STM32 has had more attractive small quantity small chip prices but NXP seems pretty close now, they used to cost more or my memory might be failing. I've been using STM32, but I really don't care for the CooCox toolchain. It's been occasionally crashing on me and it's pretty quirky, also it didn't exactly have full support for the part I was using. That I wouldn't mind just staying in OS X, since it's my OS of choice.Just ordered me a pair of Expresso dev boards for the part I am looking into using. Cheers!

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: January 26, 2016, 09:08:34 pm
content: Quote from: Muxr on January 26, 2016, 08:01:29 pmGive Rowley CrossWorks for ARM a try. It supports NXP, ST, TI, and most other ARM variants, is not based on Eclipse, and it has a native OS X version.

author: Muxr
author_rank: Super Contributor
timestamp: January 26, 2016, 09:13:24 pm
content: Quote from: Sal Ammoniac on January 26, 2016, 09:08:34 pmThanks, will check it out.

author: langwadt
author_rank: Super Contributor
timestamp: January 26, 2016, 11:30:13 pm
content: Quote from: nctnico on January 26, 2016, 03:27:24 pmST devices also have buildin serial/CAN/USB/I2C/SPI bootloader

author: nctnico
author_rank: Super Contributor
timestamp: January 27, 2016, 12:42:58 am
content: Quote from: langwadt on January 26, 2016, 11:30:13 pmPerhaps but (probably) only on more recent devices. NXP has serial (UART) bootloaders on all their ARM microcontrollers right from their earliest devices and kept the protocol the same!

author: Muxr
author_rank: Super Contributor
timestamp: January 27, 2016, 03:01:57 am
content: Quote from: nctnico on January 27, 2016, 12:42:58 amPerhaps off topic, but maybe you know. I just skimmed over the user manual for the NXP LPC 1125 (http://www.nxp.com/documents/user_manual/UM10398.pdf) part I plan on using in a project I've been working on. I saw no mention of the DMA data transfer. When I used a comparable STM32 Cortex M0 part, I remember having to setup DMA for faster SPI transfers. NXP seems to be using a FIFO register which appears to be much easier to use. Am I getting this right, or am I missing something?edit: actually nevermind I did some more research, it looks like the 1125 doesn't have DMA controllers, there are other parts that do, like the 1225. Need to get familiar with NXPs models and the selection of ARM MCUs.

author: zapta
author_rank: Super Contributor
timestamp: January 27, 2016, 04:28:22 am
content: Quote from: langwadt on January 26, 2016, 11:30:13 pmHow does the ST USB bootloader work, disk drive emulation and a simple file copy or does it require installed software on the host to load an image?

author: ve7xen
author_rank: Super Contributor
timestamp: January 27, 2016, 05:08:39 am
content: Quote from: zapta on January 27, 2016, 04:28:22 amIt's based on DFU which is a USB-IF standard but does require software on the host. The ST software isDfuSe.dfu-utilis cross-platform and open-source.Note that the USB bootloader is not included in all STM32 variants with a USB peripheral, and it's not that easy to figure out which include it.

author: janekm
author_rank: Unknown
timestamp: January 27, 2016, 05:34:24 am
content: One factor that can be interesting to consider is that ST is seriously price-dumping in China to mop up the low-cost market... So if you're planning to build anything for what really low cost is a factor that's attractive.

author: nctnico
author_rank: Super Contributor
timestamp: January 27, 2016, 10:39:53 am
content: Very few people end up working on really high volume products where the price difference between various parts matter. Looking at the price of a single part is a foolish thing to do and can land you in serious trouble. A cheap choice may lead to extra components and/or extra (software) engineering costs.

author: westfw
author_rank: Super Contributor
timestamp: January 27, 2016, 11:48:38 am
content: I'll mention that I think ARM and MIPS CPU cores are similar enough "philosophically" WRT their implementation in microcontrollers that whatever you learn on one will be helpful if you ever have to use the other.

author: dannyf
author_rank: Super Contributor
timestamp: January 27, 2016, 11:55:00 am
content: QuoteIt is fairly unusual for the lower-end parts like the M0 to have DMA - msp430s are some of the exceptions.It is very unusual for any part to use DMA exclusively for peripheral data transfer - so there is likely a spi data register somewhere there.

author: SteveyG
author_rank: Unknown
timestamp: January 27, 2016, 01:04:32 pm
content: Playing devils advocate here, what in all honesty do you even need a 32-bit MCU for? People using M0/3/4/7 for hobby use are generally barely going to use the capabilities of the device and waste a lot of time in the process. If you want to learn, it would make more sense to start with something straightfoward like an MSP430 (if you can deal with Code Composer) or an AVR or a PIC18/24 where the datasheets are much smaller and easier to understand for a newbie.We've had seriously complex medical systems with full colour graphics interfaces etc running on small 16-bit MCUs.

author: Molenaar
author_rank: Regular Contributor
timestamp: January 27, 2016, 02:50:01 pm
content: I'd look at the Hercules series from TI. Powerful MCUs, but it is easy to start development with HALCoGEN, which will generate actually useful code for initialization and setting up the peripherals. The TMS570LS1224 launchpad would be a good and cheap start.

author: Muxr
author_rank: Super Contributor
timestamp: January 27, 2016, 03:02:29 pm
content: Quote from: nctnico on January 27, 2016, 10:39:53 amFor one offs or a few boards here or there I agree but if you even make 100pcs of something, saving a few bucks here or there on a component adds up to $10+ in savings on each board. Why throw that money away if a different components does the job. I'd rather buy a piece of test equipment for that $1000 than give it to Maxim, Ti or someone.And sometimes it isn't about saving money either, it's about optimizing your design. For instance you save cost on supporting components so that you can include an expensive FPGA in the design, or an expensive display, so that you can meet your target price without compromising profit... as an example. You save cost where it doesn't matter so that you can splurge where it matters.At the end of the day this is my hobby, I do this for fun, price optimization is actually fun to me. Seeing how cheap I can make something is pretty entertaining. Also my recent purchases of Keithley 2015, Maynuo DC load and the RTM1054 oscilloscope were all funded by the products I sold.If I don't make it profitable, there is no point in producing it for general public. If all I am doing is making one offs for myself, then yeah I am not going to care about a few dollars price difference between two components.I should also elaborate. I do this on quality parts, I don't skimp reliability for the price advantage. For instance I always use Nichicon caps etc.. but microcontrollers from STM and NXP are comparable in quality, if one is cheaper than the other than it makes sense to go for the cheaper one. Right now they are comparable, but a year ago when I was looking at them, STM had an advantage.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: January 27, 2016, 04:56:02 pm
content: Quote from: SteveyG on January 27, 2016, 01:04:32 pm"Because it's there" -- George Herbert Mallory

author: MT
author_rank: Super Contributor
timestamp: January 27, 2016, 05:40:47 pm
content: Quote from: dannyf on January 27, 2016, 11:55:00 amReally? Even the TSOOP20 F031 have 5 ch DMA, so even F042, and F050 etc, etc basically all M0 have a DMA unit.

author: Muxr
author_rank: Super Contributor
timestamp: January 27, 2016, 05:45:14 pm
content: Quote from: SteveyG on January 27, 2016, 01:04:32 pmFor me the biggest strength of ARM is the choice of parts. Once you get over the initial hurdles of learning how to setup the clocks and configure different peripherals, the difference in ease of use is negligible. And actually just having more resources available (more performance) can allow for easier development time, less need for optimization which can make the code hard to read and maintain. A good bit of skills you learn on one vendor's ARM chip mostly translates to the other vendor's parts, which gives you a lot of choice and mobility.You have a plethora of choices between cheap $2 simple MCUs to high performance $20+ parts, there are multi core parts as well also FPGA/ARM hybrids like Zynq. So if you're going to invest the time and effort in learning an architecture for me ARM makes the most sense. Having multiple vendors is also a plus.Plus this extra performance for free doesn't hurt either.MSP430 does have the advantage of having some really sweet ultra low power parts, but ARM is ok for those applications too. I mean for personal one offs or test jigs I will whip out something quick on an Arduino, but if I am going to incorporate an MCU into a design I intend to sell, I will just include an ARM 32 bit MCU, it's cheap and capable and I have tons of choice.

author: uncle_bob
author_rank: Unknown
timestamp: January 27, 2016, 06:22:05 pm
content: HiThe big advantage of PIC's for the beginner is that some of the parts come in DIP packages. That makes them easier to deal with on a breadboard. The further you move up in the line, the less likely you are to have the "nice" packages.ARM has an advantage in terms of tools. This is *not* just about hardware anymore. It's about getting a tool chain up and running without a lot of hassle. There are a world of different ARM vendors out there. They all have this or that "free" (as in works on their parts) tools. Some are better than others. All the ones I have tried work pretty well.IF you are not going to be bread boarding, the ARM guys all have an ocean of low cost "demo boards" for you to play with. Most of them are pretty neat. They also come in enough flavors that finding a match to your needs is pretty easy. You may indeed find an M4 board that does what you need at essentially the same price as a simpler M0+ board.If the objective is to build a skill set, ARM is a much larger world to play in. If the objective is to get going fast, there are a lot fewer decisions on the PIC side. In both cases, the parts will cost you less than a dinner at the burger joint. In both cases you will invest a month or two of your time on this or that. Time (even hobby time) does count. Will you spend less time on the PIC or the ARM? That depends on what you are trying to do. Each project will be different.Bob

author: Muxr
author_rank: Super Contributor
timestamp: January 27, 2016, 06:26:15 pm
content: NXP has a few DIP parts in ARM flavors:http://www.mouser.com/Semiconductors/Embedded-Processors-Controllers/Microcontrollers-MCU/ARM-Microcontrollers-MCU/_/N-a85pc?P=1z0z63xBut you are right, for DIP and breadboarding, Pic makes a lot of sense.

author: 1994timmeh
author_rank: Contributor
timestamp: January 30, 2016, 11:19:58 am
content: I would suggest grabbing a Nucelo board! You can start with Mbed (online interface) and then move over to the toolchain when you've learnt a bit moreReally powerful processors and really good for general purpose stuff

author: uncle_bob
author_rank: Unknown
timestamp: January 30, 2016, 02:53:12 pm
content: HiThere are several thousand starter boards out there. What ever part you decide on, There's a board to support it. In terms of the original question (ST vs PIC) I think that ST has a bit of an edge in the "wow" side of things. Both outfits supply good starter boards and learning tools. Freescale (now NXP, but not quite the same) and TI also have pretty massive board and tool empires running around in the ARM world.What ever you go with, finding a board is *not* likely to be the biggest problem you have. I would spend FAR more time looking at the software tools and making sure they work than worrying about a board.Bob

author: janoc
author_rank: Super Contributor
timestamp: January 30, 2016, 07:31:06 pm
content: Quote from: uncle_bob on January 30, 2016, 02:53:12 pmWell, the good thing is that GCC + OpenOCD and a generic JTAG/SWD dongle will work with pretty much anything in the ARM world. If you don't want to use GCC or you don't want to spend time with setting up a generic IDE (heck even Visual Studio can be now used to do ARM work ...), then it makes sense to hunt for vendor solutions. However, I wouldn't put it in the first place - the vendor libraries are usually crap anyway and most of them will work with plain GCC too (several of the commercial IDEs/compilers are GCC based, so they have to support it).What is more important is how much support/examples/community is out there around the chip you want to work with and what sort of documentation (and its quality) you can get. The tooling is less important when you have a known-good fallback, even though it may not be so user friendly for a newbie. That's the big difference from vendors like Atmel or Microchip, where you don't have choice - you must go with the tooling the vendor provides, because nothing else works with the hardware.

author: uncle_bob
author_rank: Unknown
timestamp: January 30, 2016, 10:11:06 pm
content: Quote from: janoc on January 30, 2016, 07:31:06 pmHiThese days "tool chain" covers a lot more than GCC or do it yourself Eclipse. Things like "free" OS's and driver libraries are certainly part of what you need to look at as well.Bob

author: janoc
author_rank: Super Contributor
timestamp: January 31, 2016, 01:23:21 am
content: Quote from: uncle_bob on January 30, 2016, 10:11:06 pmCertainly. However, the common (= what a hobbyist is likely to use, pros have different criteria) stuff is not vendor dependent - FreeRTOS, ChibiOS and similar all support the common vendors. The driver libraries I was talking about before - they usually suck anyway and you often end up writing your own code, leaving those libraries only for a prototype or to get the basics off the ground and then replace them ASAP.I don't think many designers choose an MCU/vendor based on the driver libraries available ...

author: uncle_bob
author_rank: Unknown
timestamp: January 31, 2016, 01:31:03 am
content: HiI guess each of us has our own experiences. I've had friends wind up in deep trouble when the assumption that "the free tools will work" turned out to be incorrect for the processor they had chosen. I've never been dead in the water, but I certainly have spent a *lot* of time over the last 40 years yelling about support for this or that MCU in a tool set.To me, when recommending something to a person just starting out, having a wide range of stuff like drivers is indeed a big deal. It gets them "over the hump" pretty quick. A few months down the road it gives them a nice thing to re-write and be able to say "My system is now 235X faster".Bob