Should I Make The Switch? The 8 vs 32-bit Migration Decision

by donpedro

At element14 we’ve been supporting design engineers through the element 14 Community for 8 years. During this time we’ve witnessed first hand the shift in the microcontroller market, as advances in technology and the launch of 32-bit architecture offers engineers the power to take their designs further than ever before.
Of the billions of embedded devices the world uses every day, a large number of them are powered by legacy 8 and 16 bit microcontrollers. Many embedded engineers grew up with these older architectures and their low cost, low power, and simple architecture has kept them popular even as 32-bit devices have taken off. As popularity for 32-bit devices grows, so does the need for education about the differences, benefits and opportunities newer architectures can offer.

Authors:
Ankur Tomar, Farnell element14,
Anthony Huereca, Freescale Semiconductor

With every new project, there are ever growing questions: What am I missing out on by staying with 8-bit? What does a 32-bit architecture really give me? And with 32-bit devices now taking the lead in embedded MCU sales, is it time to make the move before I get left behind?
Fortunately, the exciting thing about our industry is that we never stop innovating. And with cores like the ARM® Cortex®- M0+, which can be found in devices from Freescale®, Atmel®, NXP®, and others, 32-bit processors have arrived at the point where they can match the legacy 8/16-bit MCU strengths, plus provide a multitude of advantages that make upgrading very compelling. The Cortex-M0+ core was designed specifically to make the switch more attractive than ever before, letting you take your projects to the next level with 32-bits of power.
Why 32-bit?
If you asked a new engineering student why migrate from 8-bit to 32-bit, you might get the obvious answer: There are 4 times as many bits, and more is always better! In reality it’s not quite that simple, but there’s a lot of compelling reasons why 32-bit MCUs make sense, even for “traditional” 8 and 16-bit projects.

Higher Performance: Moving to a 32-bit core can provide from 2 to 40 times the performance per MHz of the 8 and 16-bit architectures in use today. You’ll get much faster 32-bit math processing, and single cycle 32-bit multiplication. And there’s single cycle IO for bit banging and software protocol emulation.

All that power opens up a new world of possibilities with software stacks (USB, Bluetooth, etc), RTOSs, advanced UI’s, and much more, with ample processing power leftover for the defining features of your application.

More energy efficient: The Cortex-M0+ core is also incredibly efficient, getting almost 2x the Coremark®/mA of other 16-bit competitors. Combined with that more powerful Cortex-M0+ core, your embedded system can use less energy by finishing its tasks much quicker and getting back into sleep mode.

Even sleep modes have impressive low power credentials, down to <500nA when in the deepest of the 9 power modes found on the Freescale Kinetis® L family. And thanks to intelligently designed peripheral modules as found on the Kinetis families, you can now do far more without waking the core, saving even more power. • Increased Code Density: It might seem counter-intuitive that using a 32-bit processor would lead to smaller code size. However the Cortex-M0+ core uses Thumb-2 instructions, many of which only take up 16 bits in Flash. And keep in mind that many instructions on 8-bit processors are actually longer than 8-bits. Also depending on the application, several bytes of 8-bit instructions can be replaced by a single instruction on a 32-bit MCU, as in the case of the 16-bit multiplication below.
The result is that code density can be significantly improved by moving to a 32-bit architecture using Thumb-2.

Scalable: No longer will assembly, tied to one specific architecture from one specific manufacturer in the 8-bit world, hold you back as project and performance needs change. The emphasis on C code for 32-bit devices instead of assembly reduces development and debug time, and makes porting code to new devices ever easier. And with all the 32-bit ARM MCUs spreading across the world, the software ecosystem is huge and growing.

But…

This all sounds great you think, but I need the small size, low price, and ease of use that 8/16 bits MCUs give me for my application. Luckily it’s a whole new world for 32-bit MCUs these days:

• Size: With sizes as small as 1.6×2.0mm, as found on the Freescale Kinetis KL03 family making it the world’s smallest ARM MCU, 32-bit performance can be found in some very small places.

• Cost: With devices starting at only $0.49 cents, 32-bit MCUs can make sense in previously cost prohibitive applications. And because of higher code density, less flash memory may be needed.

• Complexity: Surprisingly 32-bit architecture can actually be simpler in some aspects. With 32-bits of address space, there’s no need for paging and memory locations can be accessed directly. The Cortex-M0+ core architecture has a full-featured interrupt controller, simplifying interrupt handling. Throw in a trace buffer for easier debugging, and only 56 instructions for those who want to keep using assembly, the “leap” to 32-bit complexity is more like a small hop.

Developing with 32-bits

One the major advantages of using a 32-bit ARM core is the staggering amount of software and hardware enablement that’s available for it, which includes a plethora of compatible compilers and debuggers. Hardware and software re-use becomes easier as projects scale between cores like the Cortex-M0+ and the more powerful Cortex-M4.

And with the Freescale Kinetis MCU pin and module compatibility, with hundreds of devices across the families, moving up and down the performance/flash curve becomes much easier.
Freescale takes 32-bit enablement even further with Processor Expert® software modeling tool and MQX™-Lite Real-Time Operating System (RTOS) to get you up and going quickly with new 32-bit projects. The Processor Expert software modeling tool is a complementary GUI tool that for code generation, creating customized drivers and significantly shortens development time.
MQX-Lite RTOS is a simplified version of the popular MQX RTOS and was specifically designed for microcontrollers with under 4KB of memory. The RTOS drivers come from the

Processor Expert software modeling tool, and it’s a subset of MQX RTOS, making future upgrades to more powerful devices easy. It comes complementary with Processor Expert software modeling tool, and for those devices with USB, there’s a complementary USB stack available as well.

The Next Step

Now that you want to try out what 32-bit has to offer, where do you start?
Fortunately there are a number of boards out there that provide a great 32-bit evaluation platform, and you can get them for less than the cost of a pizza. The FRDM-KL05Z is perfect for dipping your toe into the 32-bit world and is pin-compatible with Freescale’s 8-bit S08 devices. The FRDM-KL26Z adds USB and more advanced peripheral modules, and the FRDM-KL46Z takes it even further with both USB and segment LCD support. Or if 5V IO and electrical robustness are critical to your application, the FRDM-KE02 will be exactly what you’re looking for.
All 4 of these mint tin sized boards feature Cortex-M0+ cores and are enabled with the Processor Expert software modeling tool, MQX-Lite RTOS, complimentary USB stacks, and more. And with a debug circuit called OpenSDA built right into the board, a simple USB cable provides all the debugging, serial communication and flash programming capabilities you’ll need.
Plus all of those boards, along with the entire Freescale Freedom development platform lineup, are Arduino™ shield compatible and provide easy access to digital and analog IO pins. The MEMS Sensors Evaluation Kit is a good example of the possibilities this enables, as it pairs a FRDM-KL25Z Freescale Freedom development platform with a MEMS Sensor Evaluation shield on top, giving the Kinetis L MCU access to an array of cutting edge sensors to explore the world around it. All the way through the learning experience it’s important to keep in touch with other engineers and that’s where the element14 Community can provide support. There’s often another engineer who has already found a solution to the problem you’re facing, and that’s where online communities can be an excellent resource.

A 32-bit Future

Technology never stops moving forward, and the trend of seeing 32-bit MCUs in more and more embedded applications will only accelerate. At element14 we’re supporting engineers through each stage of the design process, from development kits to prototype and manufacture, to ensure that engineers feel confident when choosing to migrate to a newer 32-bit architecture. With their higher performance, impressive power efficiency, and better code density, now is the time to make that first step to a better and brighter 32-bit future.

www.freescale.com
http://uk.farnell.com

Related Articles

Leave a Comment