Switching to 32-bit MCU from 8-bit "by default" - Page 1
Forum section: electronics / general

author: cyberfish
author_rank: Regular Contributor
timestamp: June 11, 2011, 12:00:31 am
content: I realized that in most of my projects that don't have an FPGA, I need some sort of a microcontroller.In most of those situations, the MCU used doesn't really matter. It would just need to do some timing, and toggle some pins. Anything will work.I have always been using AVRs and PICs for those. I have built perhaps 10-20 AVR/PIC-based projects, as that's what I go to "by default", if there are not really any requirements.But more and more, I'm realizing that I'm just giving myself a hard time, compared to, for example, just using a Cortex-M3 based MCU.My biggest complaint for 8-bit micros is the lack of (good) tools. PIC doesn't have good free development tools - MPLAB has restrictions for the free version (and doesn't run on Linux), and SDCC is just too buggy. AVR is a little better thanks to avr-gcc, but debugging requires very expensive tools, and only has primitive hardware support (correct me if I'm wrong, as I haven't been able to afford JTAG ICE). 8051 is in similar situation.On the other hand, Cortex-M3 has many high quality open source tools - GCC, OpenOCD, GDB, Eclipse. Cheap JTAG programmer/debugger ($50 - just slightly more expensive than PICKit or AVRISP), and is available from quite a few manufacturers, so a lot more choices of compatible chips with different emphasis (speed, power consumption, size, etc).Sure, for applications where you need 8-pin $0.50 micros, 8-bit ones are probably a better idea. But most of my projects are a LITTLE bigger than that. My by far most used AVR/PICs are in the $4-$5 range, and there are many Cortex-M3s in that range also.So now I don't really see any reason why I shouldn't switch to 32-bit. Sure, I'll need to learn some new stuff, but it's new stuff I'll probably be using for a long time, so I don't mind that.I know some people stick with 8-bit micros for 5V and DIP. That's the reason I chose to start with them as well (beside the fact that my school taught them first). Nowadays, though, all my projects are 3.3V, and all PICs/AVRs I use are TQFP anyways, so those things aren't really important any more. I make a lot of PCBs and I'm pretty good at soldering TQFP now. I can probably do them faster than DIPs (no huge pins to heat up).The extra speed/functionality is just nice bonus. It makes my life a lot easier to stick with one architecture from the $2 range to $20 range.What do you think?Edit:Using a 32-bit architecture also makes porting PC code easier, because many people assume int's are at least 32-bits when they program for PC. That means, things like compression or XML libraries can be easily ported over.There's also no weird memory layouts to worry about. Everything is flat.

author: johnmx
author_rank: Frequent Contributor
timestamp: June 11, 2011, 12:28:16 am
content: Quote from: cyberfish on June 11, 2011, 12:00:31 amMPLAB is completely free, no restrictions at all.In your specific case you should move to Cortex-M3.

author: slburris
author_rank: Frequent Contributor
timestamp: June 11, 2011, 12:29:46 am
content: I'm 100% behind this. I used to use various PICs and AVrs myself, but unlessI've got an application that really calls for a $0.50 - $2.00 micro, more and moreI'm using some flavor of TI (was Luminary Micro) Cortex M3.The cost difference is minimal now, and it's just silly to run out of flash or RAMand have to quibble about a few bytes. It'd nice to have some big boy featureslike hardware division as well.I know of people who go to the other extreme, like using a PC104 based PC to togglea signal line, but that's not a case of price parity, just not wanting to use unfamiliar stuff.I've said it before in other parts of the forum, but for $12 you can put an ARM Cortex M3and a Spartan 3A FPGA on a board, and with that combo, you can solve an awful lot ofproblems without stressing out about it. But that's just me.Scott

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2011, 12:44:06 am
content: You just gave yourself every reason to use them, no one will call you a fool for doing so, all your points are valid for you. They may not however be valid for someone else.These choices depend entirely on your own circumstances.Dave.

author: cyberfish
author_rank: Regular Contributor
timestamp: June 11, 2011, 02:08:35 am
content: I guess what I'm really curious about, is why 8-bit MCUs are still so popular?I totally agree that there's a market for it - the very low cost segment ($0.50-$1.50) and hobbyists, but they are very popular beyond those markets, too.For example, this very popular PIC (18F4550) -http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=PIC18F4550-I/PT-NDDigikey has almost 30000 of those. It's TQFP, so probably not for hobbyists. Besides, there is no way hobbyists can generate that kind of volume.That means it must be used in some real products by engineers.But we can easily find better, cheaper, faster 32-bit MCUs. Eg.http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-10499-NDSo why are the expensive PICs still on the market? What can they do that ARMs can't? Well, except running at 5V. But how important is that? Especially in non-hobbyist markets?

author: Trigger
author_rank: Regular Contributor
timestamp: June 11, 2011, 02:10:05 am
content: When it's for your own use then there's no reason not to. The Cortex-M3 has a lot of options and Energy Micro has placed them in the low power usage realm that was normally reserved for 8 bit micros.

author: Rufus
author_rank: Super Contributor
timestamp: June 11, 2011, 02:45:48 am
content: Quote from: cyberfish on June 11, 2011, 02:08:35 amDo you think products get re-designed every time a new more capable cheaper processor comes out?It is likely I will soon be re-designing the internals of a product which has been in production since 1995. It is only being redesigned because some of the components are becoming impossible to buy.For me that is a potential issue with the rash of dirt cheap ARM based processors. There is no money in making them without huge volume and too many manufacturers for them all to have huge volumes so I suspect a lot of parts (and possibly companies) will go obsolete pretty quickly.Can anyone tell me which ARM cored processors I will still be able to buy in 15 years time?

author: cyberfish
author_rank: Regular Contributor
timestamp: June 11, 2011, 04:40:28 am
content: Ah so they are only used to support old designs, and should not be used for new designs?QuoteIsn't it a bigger problem when only 1 company makes your chip?If your specific ARM chip disappears, you only need to change the PCB a bit and re-route a few signals to use a new compatible chip.If the PIC series disappears, you'll have a lot of code to rewrite.

author: johnmx
author_rank: Frequent Contributor
timestamp: June 11, 2011, 11:14:58 am
content: Quote from: cyberfish on June 11, 2011, 04:40:28 amThat's why you can still buy the first microcontroller developed by Microchip Inc. (correct me if I’m wrong but I think it is the PIC16C54).

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2011, 11:46:06 am
content: Quote from: cyberfish on June 11, 2011, 02:08:35 amOf course they are, Microchip didn't become #1 in the microcontroller business at one point (dropped from the top now) by hobby sales. They sell billions of microcontrollers into everything you can possibly imagine.QuotePIC's and 8bit micros are still cheaper than 32bit micros. You can't just take one Digikey example and compare them.When you manufacture in the millions you don't buy through Digikey, and you even get special deals from the manufacturers, and when you talk serious volume, silicon area matters, it matters a lot. All things considered, you simply can't make a 32bit die cheaper than a smaller 8bit die.Not to mention all other things like existing tool/family/vendor familiarity. Companies that use these parts can't just change willy-nilly based on what chip they think is slightly cheaper this month.Dave.

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2011, 11:54:21 am
content: Quote from: Rufus on June 11, 2011, 02:45:48 amActually, this is one of the reasons why the Microchip CEO himself told me they did not chose to go with ARM for their 32bit micros.ARM has become a commodity, and as such there is no money in it, and hence actually more likelihood of your particular ARM micro being discontinued than Microchip (or another major player) folding and not making your "single source" part any more.ARM micros are single source just like any other micro, only thing is hardly anyone is making money selling them except except for ARM themselves who sit back and collect the royalties and don't care if your chip gets discontinued.Dave.

author: johnmx
author_rank: Frequent Contributor
timestamp: June 11, 2011, 11:55:08 am
content: Quote from: cyberfish on June 11, 2011, 02:08:35 amDo you prefer to start learn some matter with a simple case or with a complex and advanced case? The best way is start with the simplest case. And as we learn we move to more advanced levels.Most people start working with microcontrollers in a young age and don’t have money to spend in this hobby. In my case I had to work at night to pay the tuition fees, so there was no money left for hobbies. Thanks to Microchip Inc. and their free samples program I started to learn by myself without spending a nickel. Also the application notes they have are an excellent source of help. 3 years later, I knew more about 8-bit microcontrollers than any professor in my University, because they only knew about 32-bit microprocessors.Nowadays I just use 8-bit micros for very simple projects. But if I need to make one, I would definitely use a PICmicro.Microchip Inc. has predicted this and that’s why they grow up so much in the last couple of decades.

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2011, 11:57:53 am
content: Quote from: cyberfish on June 11, 2011, 04:40:28 amNo, it's actually safer, as has been proven over several decades with the major players.QuoteSure, but that's actually a big deal too, and actually more likely to happen with ARM chips than say a Microchip or Renesas part.QuoteMicrochip won't disappear, that sort of things does not happen in this industry to the major players. They are actually "too big to fail" because the industry itself demands they stay afloat.Dave.

author: Trigger
author_rank: Regular Contributor
timestamp: June 11, 2011, 06:37:58 pm
content: Renesas decided to stay out of the ARM arena as well instead developing their own RX architecture to compete with ARM despite already having 2 types of 32bit microsWhen the two largest (and most successful) micro suppliers in the industry shy away from ARM that's something to pay attention to because they'll still be around long after some of the smaller companies are gone.

author: Unknown
author_rank: Unknown
timestamp: June 11, 2011, 10:59:50 pm
content: Quote from: EEVblog on June 11, 2011, 11:57:53 amMicrochip may be 'too big to fail', but does the same apply to the PIC32? The PIC32 doesn't appear essential to the electronics industry. I wouldn't be surprised if the PIC32 was discontinued in favor of some other architecture like ARM, if it turned out they failed to achieve the market penetration they expected.The 8051 still seems to be fairly popular in the industry, even though the situation is fairly similar to ARM (open architecture, lots of vendors).I agree that the number of ARM 'partners' (or whatever they call it) is likely to be reduced, but ARM going away seems unlikely for now. What will they use in all the gadgets like smart phones?Quote from: Trigger on June 11, 2011, 06:37:58 pmOf course, vendor lock-in is actually a good thing for the vendor. Doesn't mean the same arguments apply for the consumer.Quote from: Trigger on June 11, 2011, 06:37:58 pmI wouldn't exactly call companies like TI and Samsung small.

author: EEVblog
author_rank: Unknown
timestamp: June 12, 2011, 12:23:07 am
content: Quote from: alm on June 11, 2011, 10:59:50 pmThey don't expect market penetration, they wanted market differentiation (the CEO's words) from ARM. Renesas did it for the same reason.I don't think Microchip have ever discontinued an entire family of micros, and market forced would likely not let them do that, it would be too damaging.You don't know how many big influential customer might be using PIC32.And there is actually little benefit to a company to discontinue an entire family like that, it would be massively damaging to confidence. No one (not just Microchip) would be dumb enough to do it.QuoteARM will never go away, that's not what I meant.Your comment about the number of partners being reduced is spot on, and that's the problem, it's almost inevitable. Margins on ARM chips are razor thin, and the license fees are high, so that does not equal security. That's why two big player didn't touch ARM.If anyone thinks they are safer (from having to re-spin a design, even at just the PCB/BOM level) using a generic ARM chip over say a PIC or Renesas part then I think odds are you may ultimately end up being wrong.Quote from: Trigger on June 11, 2011, 06:37:58 pmI wouldn't exactly call companies like TI and Samsung small.Not at all. But Renesas are the biggest in the industry, and Microchip are what , #3, #4 at the moment?Samsung are massive, but the problem is they are not just a semiconductor maker, so they have less rep to lose if they decide to discontinue a chip. They are not as focused a microcontroller manufacturer as say Microchip is, and that can mean a lot.Dave.

author: cyberfish
author_rank: Regular Contributor
timestamp: June 12, 2011, 03:47:32 am
content: Ah I see. I didn't realize how big of an issue part longetivity is. I have never worked in the electronics industry.It would be very nice if ARM becomes something like 8051 in the future, when the patents expire, though. No royalty, and many implementations from many companies.I don't think familiarity should be too big of a reason. It's not like we need to educate consumers about anything. Only need to educate engineers, and engineers are supposed to be easy to educate.I think the ARM-making companies (eg. TI, ST, or NXP) face the same pressure to keep their ARM CPUs running, too. If they discontinue a popular series, like STM32, or LPC1000 series, they will be in similar situation.PIC was #1 before, but that's before the 32-bit and 16-bit stuff became cheap enough to compete (high end 8-bit vs low end 32-bit). With the competition that only started in the last few years, they dropped to #3 or #4. And many people only use them because of familiarity and existing designs. ARM chips are now starting to compete in the mid to low end market as well (except for very lowest end). How much longer can they stay popular for? Even if it never completely goes away, they will probably shift most of their resources to other products. Wouldn't that make designing with them even harder?

author: EEVblog
author_rank: Unknown
timestamp: June 12, 2011, 06:22:28 am
content: Quote from: cyberfish on June 12, 2011, 03:47:32 amPeople have been predicting the demise of 8bit micros for a long time, but it's really never going to happen. There are just too many apps that need ultra low cost in ultra tiny form factor.Dave.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 12, 2011, 10:34:49 am
content: In terms of compatibility, peripherals and pinouts are way more important than the core, both in terms of both hardware functionality and programmer familiarity.Changing a design from a NXP ARM to an ST ARM is likely to be harder than changing from PIC24 to PIC33 - Microchip is fairly unique in having very similar (and backwards compatible) peripherals on all their parts from 8 to 32 bit.In terms of free devtools, although the free version of Hitech C for the 8-bit pics sucks due to code bloat (the paid version is very good and not very expensive), the free versions of Microchip's MPLAB-C for the 16 and 32 bit parts are a lot more useable as the architecture of the chips is more compiler-oriented.If your projects are reasonably small, I'd highly recommend looking at IAR's free kickstart editions of embedded workbench, which are code-size limited (AVR 4K, ARM 32K) but otherwise fully functional professional quality compilers and debuggers, and available for many different MCUs (AVR,ARM,MSP430), so you can use the same tools whicheve part you find is most suitable for your application.As with most things, you get what you pay for. If you're doing commercial development, skimping on tools is a false economy.A good commercial devtool can easily pay for itself in saved time on a single project.

author: EEVblog
author_rank: Unknown
timestamp: June 12, 2011, 10:56:08 am
content: Quote from: mikeselectricstuff on June 12, 2011, 10:34:49 amAnd pinout compatibility too. Often it's possible to move though the different families without having to change your board at all.As far as cores go, it would have been really nice if Renesas chose the MIPS core like Microchip, but I guess they had their own agenda.Dave.

author: westfw
author_rank: Super Contributor
timestamp: June 13, 2011, 09:35:03 am
content: QuoteAh yes. One of the first microcontrollers to include a USB device peripheral, so a lot of people jumped on that one for a lot of applications.QuoteThat particular part doesn't have USB, so it's a poor comparison.My personal experience is that 8bit microcontrollers are HARDWARILLY simple and robust, while the equivalently priced 32bit chips are sort of a pain; multiple voltages, bunch of pins reserved for JTAG, lousy pin drive capability and internal design rules that make them more suceptable to damage, etc. The 18F4550 chip you mention is also available in a DIP package for easy experimentation on a protoboard, for example. Software is pretty much a wash; most things have inexpensive debug tools (ICD2 or ICD3 for PIC, DebugWire for AVR, Whatever TI calls theirs. JTAG (usually per-vendor specific?) for 32bit. And most have reasonably decent reasonably price compilers (though I haven't been tempted to use SDCC.) It not even like the 8bit chips are short on program or ram memory space anymore.

author: cyberfish
author_rank: Regular Contributor
timestamp: June 13, 2011, 04:40:46 pm
content: Quotehttp://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=568-4944-NDMany more expensive (~$10) ones nowadays have USB 2.0 HS OTG.Almost if not all Cortex-M3s are single voltage (3.3V). Pins are not reserved for JTAG (they can be used for GPIO, just like ISP pins), STM32 has 20mA drive capability I believe.DebugWire requires JTAGICE ($300). ICD is also $200+.ARM JTAG adapters, just like the CPUs, are available from multiple vendors, from as low as 29 Euro (http://www.amontec.com/jtagkey-tiny.shtml), or you can easily build your own with a FT2232D and a few passive components. Or integrate it into your own ARM board. They all work with all ARM processors (ARM has a standard JTAG pin-out). As an added bonus, I think they also program Lattice FPGAs.There are also state of art open source compiler and debugger, with huge online support communities. And everything has full Linux support (MPLAB and AVR Studio only run on Windows).

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 13, 2011, 05:43:09 pm
content: Quote from: westfw on June 13, 2011, 09:35:03 amActually lack of RAM is often the primary reason I need to go from 8 to 32 bit - once you need more than about 4K there are usually cheaper 32 bit options.

author: Unknown
author_rank: Unknown
timestamp: June 13, 2011, 05:48:44 pm
content: Quote from: cyberfish on June 13, 2011, 04:40:46 pmdebugWire also works with the $50 AVR Dragon. But your point about being proprietary protocol still stands.Quote from: cyberfish on June 13, 2011, 04:40:46 pmDon't most of the small Cortex parts use a different protocol like SWD? Is this protocol open and are there cheap programmers available? Last time I checked, SWD in OpenOCD was still work in progress. Not sure about the STM32 equivalent.Quote from: cyberfish on June 13, 2011, 04:40:46 pmOpen source AVR support appears to be quite close to open source ARM support. An open source development environment is fairly easy to setup in my opinion (included in many Linux distributions), ARM seemed a bit more involved last time I checked.Quote from: EEVblog on June 12, 2011, 06:22:28 amI wouldn't expect the 8-bit micros to go away anytime soon, it's hard to compete with the bottom end, but I would expect the high-end 8/16-bit parts to get some stiff competition from the low-end 32-bit parts (eg. Cortex M0). Performance, RAM and ROM tends to be cheaper in 32-bit parts due to more advanced (and lower voltage) processes. Like Mike writes, more than say 4k of RAM tends to get expensive and rare in 8-bit micros. For example, the cheapest Atmel part with >4k of RAM is the $7.5 ATmega1284 with 40/44 pins.

author: cyberfish
author_rank: Regular Contributor
timestamp: June 13, 2011, 06:25:24 pm
content: Ah! I didn't know about AVR Dragon.I don't know much about SWD, but I believe it is a standard from ARM also. I think STM32 also uses SWD, but I've never seen an ARM chip too small to have JTAG.AVR open source toolchain is quite good. That's the main reason for my preference of AVR over PIC. I don't know how hard the ARM toolchain is to set up yet. I just ordered my JTAG adapter, and designing my first STM32 board right now.

author: TheDirty
author_rank: Frequent Contributor
timestamp: June 13, 2011, 08:43:38 pm
content: Quote from: alm on June 13, 2011, 05:48:44 pmQuote from: cyberfish on June 13, 2011, 06:25:24 pmSWD is a standard and will work with any Cortex chip that supports it. I use a Rowley SWD adapter attached to my Olimex FT2232 based JTAG programmer for SWD.LPC13xx and LPC11xx devices require SWD and JTAG is not an option. The cheapest hobby level programmer that supports both JTAG and SWD is the J-Link EDU version. ~$60.00 Otherwise there are those cheap programmers like the Xpresso that are locked to a development environment.Quote from: cyberfish on June 13, 2011, 06:25:24 pmThe GCC/Eclipse ARM toolchain is a pain in the ass. At least it was to me, and I just gave up on it. I'm using a personal license version of Rowley Crossworks. $150.00Cortex-M3 and Cortex-M0 is nice to use, but they are just not suitable for smaller projects. I mean the simple stuff that takes one or two timers and a few pins. I've just been using MSP430's for smaller gadgets. No need to route a crystal and I can put a tiny little 16 pin QFN on the board.

author: westfw
author_rank: Super Contributor
timestamp: June 13, 2011, 11:31:52 pm
content: QuoteAh. So your enthusiasm is based mostly on the marketing literature, rather than actual experience ?Yeah. On paper, 32bit CPUs are wonderful.QuoteNo, most of them have an internal regulator for the core voltage, which is not quite the same thing.Quote+/-8mA, actually. 20mA under "relaxed voltage conditions."QuoteThat's because you seem to think a 48pin LQFP is "small", while I think it is "large." :-) (You may be right. Given high density packaging and fine pitch PCBs, pin count is no longer a very good measure of "size.")I happily designed a prototype board for the 28-pin Stellaris ARM when it first came out, and I was a bit shocked to discover that you wind up with only 13 usable IO pins (none in anything as big as an 8bit clump.) (7 power pins! 5 for JTAG (yes, you can turn off JTAG, but then you can't program the device any more!)) This compares to 20 IOs for a similar conservative configuration of a 28pin AVR, or 13 IOs on an 18pin PIC...

author: cyberfish
author_rank: Regular Contributor
timestamp: June 14, 2011, 12:22:37 am
content: QuoteIf you actually read my first post... this thread started with me thinking about switching to 32-bit microcontrollers, which usually implies that I haven't switched yet.QuoteSo does the PIC?The problem with multi-voltages is it either requires more layers on the PCB, or more complex routing, plus additional regulator. If the chip has an internal regulator, then for all intents and purposes, it's a single-voltage chip.You are right, I think QFP-48 is small. I have never really used anything less than 32-pin AVR or 48-pin PIC (besides playing with Arduino for a bit).On, for example, STM32, I see most pins are available as IO pins. Sure, there are a few more power pins, but that's kinda necessary for a chip that runs at 120MHz. Still not nearly as bad as FPGAs, though.

author: TheDirty
author_rank: Frequent Contributor
timestamp: June 14, 2011, 12:55:43 am
content: Quote from: westfw on June 13, 2011, 11:31:52 pmIn this case you would put a timer to allow the JTAG to function for a limited time, say 4 seconds or so, so you can always break into the chip if you need to. Not optimal, but still available if needed. I think that LM 28pin chip was just a stunt anyway, since they wanted to show they could put out a chip for less than $1 in bulk. I used the Stellaris at that time and it was fun at the time, but they dropped back a bit until TI bought them. Everything supports SWD as well as JTAG now, even the large 512k 100+ lead chips.So, on the 32lead QFN's I get 32 pins, minus VDD, VDD(io), XTAL1, XTAL2, SWCLK, and SWDIO. So I have 26 pins to work with. VSS is handled by the thermal pad on the bottom, so I guess technically it's a 33 lead part. SWDIO and SWCLK are remappable as well, if you want to put in a delay, though I've never had the need, so they rate it as 28 i/o.