There was a time when deciding which microprocessor to use for a new project was pretty easy: there weren’t that many to choose from. Who remembers the Intel 8080, Motorola 6800 or the CBM 6502? These were all 8-bit microprocessors - no internal program memory – unlike subsequent devices with internal memory known as microcontrollers. Today sees the launch of a new NXP microcontroller device in the mbed format known for its revolutionary development system in the ‘Cloud’. This provoked some thinking about selection criteria: why choose this new mbed module in preference to its predecessor?
Nowadays there are many more manufacturers producing 8, 16, 32 and even 64-bit devices each with their own peculiar instruction sets and architecture. Not only that, but containing mostly microcontrollers, each family has a huge range of clock speeds, memory sizes and on-chip peripheral controllers. The situation is made more complicated by ARM who design 32-bit processor cores and license them to others. At the time of writing practically every major chip manufacturer uses one or more ARM cores at the heart of their products. The big exception is Microchip of course, although they used a MIPS core when they needed a 32-bit range.
Far from making choice easier, the large variety of ARM core designs can lead to much frustration and head-scratching. There’s the ARM 7, the ARM 9, ARM 11, the new Cortex series and all their variants. It’s going to take rather more than this blog post to go through all the pros and cons of each member of the ARM catalogue, so I’ll just take a look at the Cortex series. There are three main groups: Cortex-M, Cortex-A and Cortex-R. The main common feature that separates the Cortex devices from the other ARM cores is the built-in interrupt controller that makes them more suitable for embedded control systems.
Cortex-A based devices are very fast microprocessors using external dynamic RAM for program storage. The RAM is used because Flash memory technology is not fast enough for the processor clock speeds in excess of 500MHz required for high-end multimedia and communication systems.
Cortex-R based devices are also very fast with external program memory designed for embedded systems requiring not only real-time control, but features such as error correction to ensure reliability, Typical applications can be found in the automotive sector. The Texas Instruments Hercules range of fault-tolerant MCUs is based on the Cortex-R4F. See my blog post on this subject.
Cortex-M based devices are the workhorses of the range. They are true microcontrollers with on-chip Flash program memory suitable for most general purpose embedded control applications. Most manufacturers feature Cortex-M devices in their catalogue. Let’s look more closely at the M variants. The most popular up to now has been the M3 with its comprehensive and efficient 32-bit instruction set. To improve efficiency in applications that just don’t need 32-bit muscle, the Cortex-M devices feature a set of 16-bit instructions called ‘Thumb’. An example device is the NXP LPC1768 used in the first mbed. The Microchip PIC32 is usually considered roughly equivalent to a Cortex-M3 device. Moving up, we come to the M4 which has all the M3 instruction set plus dedicated DSP instructions. These make for much more efficient code when implementing real-time digital FIR filters or performing frequency analysis with Fast Fourier Transforms (FFT). An example of a device with an M4 core is the Freescale Kinetis K40. The top of the range title (currently) goes to the M4F which adds floating-point maths instructions to the M4 set. Code using these instructions can run 5 or 6 times faster than that using software routines. ST Microelectronics offer this core in their STM32F4 device.
Back to the new mbed module. This features the NXP LPC11U24 device with a Cortex-M0 core. As you might have guessed, this is the bottom end of the range and aimed firmly at the mid-range PICs. It really is a RISC machine featuring most of the 16-bit Thumb instruction set. The devices are dirt-cheap, very simple (but upwardly compatible with the rest of the Cortex-M range) and consume very little power. Hence their target application area of mobile, battery-powered systems. They have multiple ‘sleep’ modes to take advantage of the low-power technique involving wake-on-interrupt, process quickly then go back to sleep again until the next interrupt. See my article in eTech magazine on this subject.
So there you have it: a quick tour of the ARM Cortex-M microcontrollers. Of course I’ve missed loads of stuff out (particularly all the peripheral hardware added by the device manufacturers) and not explored all the other ARM cores available, but that will have to wait for a more in-depth article.
If you're stuck for something to do, follow my posts on Twitter. I link to interesting new electronics components and development kits (some of them available from my employer!) and retweet posts I spot about robot and space exploration issues.Like this Leave a comment