Upgrading 8- and 16-bit MCU designs: 32-bit MCU architectures
Modern embedded designs require a wide range of capabilities, including low power support, high performance/throughput, function-rich peripherals, different connectivity options, large internal memory, scalable CPU core, high code density, and easy access to a development tools and hardware. As these options are available in 32-bit MCU devices, this will be the common choice for designer.
ARM is a popular 32-bit core that is licensed across multiple vendors. This gives a unique flexibility for designers to move from one supplier to another without worrying whether the application development environment will change. Choosing a 32-bit device means not only finding the special peripherals needed to meet your system’s requirements today but to also secure the ability to upgrade the device in the future. This is more easily achieved with 32-bit devices since most embedded system R&D effort is focused on 32-bit cores.
However, you have to be careful and aware of how to leverage the features of the 32-bit CPU to the advantage of your application. This article discusses the need for moving to 32-bit systems from 8/16 bit MCUs and explores issues that you need to consider while migrating to shorten your time to market.
Throughput and CPU Performance:
Throughput is the number of instructions that can be processed by a CPU in a given unit of time. The higher the throughput, the more work the system can complete. There are two factors that define a CPU’s capacity for doing work in a given unit of time. The first one is the speed at which the CPU executes instructions. The Dhrystone benchmark is a popular synthetic benchmark for embedded systems to produce a measure of CPU performance in DMIPS/MHz. For example, Table 1 shows the performance measures for different 8-bit and 32-bit cores. Not surprisingly, 32-bit cores show a significant performance advantage.
Table 1: CPU performance comparison
|Architecture||Processor Example||Performance (Speed, MIPS)||Device details|
|8-bit M8C core||PSoC 1||Up to 24 MHz, 4 MIPS||CY8C29XXX|
|8-bit PIC Core||PIC18F||Up to 40 MHz, 10 MIPS||PIC18FXX2|
|Enhanced 8-bit 8051 core||AT89LP||Up to 20 MHz, 20 MIPS||AT89LP828|
|Enhanced 8-bit 8051 core||PSoC 3||Up to 67 MHz, 33 MIPS||CY8C38XXX|
|32-bit ARM Cortex-M0+||PSoC 4||Up to 48 MHz, 0.9 DMIPS/MHz, 43 DMIPS||CY8C4Axx|
|32-bit ARM Cortex-M3||PSoC 5||up to 80 MHz, 1.25 DMIPS/MHz, 100 DMIPS||CY8C58LP|
The second factor is the amount of data a CPU can process at a given speed. An 8-bit CPU has 8 digital lines (data-buses) in parallel. This allows an 8-bit MCU to work with values only from 0 to 28 (255) each clock cycle. In contrast, a 32-bit CPU has 32 parallel digital lines, allowing it to handle values from 0 to 232 (4,294,967,295) each clock cycle. This shows the significance of 32-bit architectures over 8-bit in terms ofprocessing power.
This plays a role in the efficiency of executing mathematical operations. 32-bit MCUs are more efficient in processing math operations on numbers that are longer than 8-bits. To implement mathematical operations of 32-bit numbers with an 8-bit MCU requires more CPU cycles as compared to a 32-bit CPU. Depending on how processing intensive your application is and how many calculations it makes, this can affect the performance of the circuit.
With its larger data-bus, a 32-bit MCU can also access larger memory spaces. A 32-bit data path also enables faster copying of large chunks of data as compared to an 8-bit MCU as a 32-bit MCU is capable of handling four times the data at a time. For an application wherein the primarily function is to stream data from one place to another (for example, implementing an UART to USB bridge), a 32-bit MCU will be more suitable than an 8-bit MCU.
Table 2: Data/Memory Access capabilities 8-Bit vs 32-Bit
|Data / Memory access capability||28 = 255||232 = 4,294,967,295|
For embedded systems that are battery powered, power consumption is a key factor that you need to consider early in your design. While a CPU’s datasheet may provide some insights on active current and certain low power modes current consumption numbers, it is average power that determines how efficient a given application is in the end. With the latest process technologies in place, 32-bit MCUs are no longer power hungry in comparison to 8-bit MCUs. In addition, 32-bit MCUs are capable of doing more work than 8-bit MCUs in a given time since they can more data bits per clock as well as achieve superior code density. As a result, a 32-bit processor can finish a given task in less time and drop back into a low power mode faster to improve the overall power consumption compared to an 8-bit processor.
A 32-bit MCU can process instructions quickly, enabling CPUs to wake up from a low power sleep mode, crunch and transmit data, and go back to sleep as soon as possible. One such example is shown in Figures 1 and 2 where the average power consumption is better for 32-bit MCU as compared to an 8-bit MCU.
Figure 1: 32-Bit MCU example for Average Power Consumption
Figure 2: 8-Bit MCU example for Average Power Consumption
Driving bus lines requires the bus capacitance to be charged and discharged. Thus, the more bus activity that is required, the more power that will be consumed. Driving 32 lines will consume more power than 8, so clearly an 8-bit CPU has a power advantage. However, if constants larger than 8 bits are required, then multiple accesses are required. Not only do the data lines need to be charged multiple times, so do the address lines. Figure 3 shows an example of an 8-bit MCU where the address bus has to be changed 4 times to perform a 32-bit data transfer:
Figure 3: 32-bit data transfer using 8-bit CPU
In this case, the 32-bit processor will require only one access to memory (which can also be switched into low power mode more quickly) and therefore consume less power globally.
Figure 4: 32-bit data transfer using 32-bit CPU