8-bit vs. 32-bit MCU: Choosing the Right Microcontroller for Your PCB Design
I have very bad shopping habits when it comes to electronic gadgets. Torn between buying a new laptop or upgrading my tablet to an iPad Pro, I end up purchasing both and getting an endless lecture from my fiancé.
Thankfully, I’m more decisive when choosing between 8 bit vs 32 bit microcontroller devices for my hardware design. They’re not too different in terms of cost, and one is more powerful than the other. To make the right choice, however, it’s important to understand the fundamental differences between the two microcontrollers.
8-Bit vs. 32-bit MCU: What's the Difference?
Strictly speaking, an 8-bit microcontroller processes 8-bits of data at any particular time. The number of bits used by an MCU (sometimes called bit depth or data width) tells you the size of the registers (8 bits per register), number of memory addresses (only 2^8 = 256 addresses), and the largest numbers they can process (again, 2^8 = 256 integers, or integers 0 through 255). An 8-bit microcontroller has limited addressing, but some 8-bit microcontrollers use paging, where the contents of a page register determines which onboard memory bank to use.
A 32-bit microcontroller can theoretically handle numbers reaching 2^32. They have 32-bit arithmetic logic units, registers, and bus width. In general, this means that a 32-bit can handle quadruple the amount of data, making it technically more data efficient. However, there are other differences between 8-bit and 32-bit microcontrollers that span beyond arithmetic operations.
One limitation should be obvious, which the limitation on arithmetic operations. An 8-bit microcontroller would normally only allow arithmetic operations that output numbers ranging from 0 to 255 (or from -127 to 128), although a larger number can be shared between two threads. This introduces some programming complexity as threading does not happen automatically at the hardware level.
In general, using a microcontroller with a larger data width allows computation with larger numbers. A 32-bit microcontroller can handle unsigned numbers from 0 to 4,294,967,295 (I’ll let the reader figure out the range for signed numbers!). If you use a high level programming language like C, or a proprietary IDE (e.g., AtmelStudio), you should have access to a library that provides support for larger numbers or the use of scientific notation.
Form Factor in 8, 16, and 32-bit Microcontrollers
If it sounds like a 32-bit microcontroller will always sit in a larger package than an 8-bit microcontroller, this is not always true. Some 8-bit, 16-bit, and 32-bit microcontrollers have the same form factor (e.g., Microchip offers a series of microcontrollers with different bit widths that all come in TQFP-64 packages). 8-bit microcontrollers come in DIP packages, as seen on popular Arduino boards.
Two common packages for 8-bit (left) and 32-bit (right) microcontrollers.
Embedded Software and Memory Usage
At the software level, the data types used in your code will also determine which type of microcontroller to use. For example, an unsigned integer declared in an 8-bit microcontroller will only consume 1 byte. The same variable in a 32 bit microcontroller consumes 4 bytes of data. You might say “wait, a 32 bit MCU has 16 million times as many addresses, what do we care if it uses 4 bytes?” The maximum number of available unique addresses says nothing about the actual amount of memory placed on a microcontroller. On-chip memory is usually at the KB level, so the amount of data required in your code matters.
Deciding between an 8-bit vs 32-bit microcontroller involves more than the data width alone. Considering the major differences between 8-bit and 32-bit microcontrollers will help you make the best decision for your design.
Speed and Memory
One of the primary advantages of a 32-bit microcontroller over an 8-bit microcontroller is its superior processing speed. A typical 8-bit microcontroller usually runs at 8 Mhz while a 32-bit microcontroller can be clocked up to hundreds of Mhz. You might not notice the embedded data processing speed difference if you’re using the microcontroller to turn on a mechanical relay; however, it quickly becomes obvious when you’re running applications that require heavy data processing applications. For example, a door access controller that processes thousands of transactions per day requires a 32-bit microcontroller processor.
8-bit microcontrollers are cheap and easy to work with. In fact, they are still very popular after four decades in many applications. But if you’re working on a product that requires a huge internal Random Access Memory (RAM), then you may have to replace the 8-bit with a 32-bit. 32-bit microcontrollers often have 8 times more RAM than their 8-bit peers. If you need to a huge buffer to store audio data, then a 32 pin microcontroller is the better processor application option.
Get a 32-Bit microcontroller if your design can’t live without speed.
The basics of embedded system design involve creating a list of required peripherals based on project requirements. If you require Ethernet, Universal Serial Bus (USB Stack), multiple universal asynchronous receiver-transmitter devices (UARTS), and a Controller Area Network (CAN) bus, an 8-bit microcontroller would be insufficient. You might have to consider adding peripheral chips, which may cost more than a 32-bit microcontroller alone.
Generally, 32-bit microcontrollers are feature-packed compared to 8-bit microcontrollers. With superior processing speed, a 32-bit microcontroller can handle multiple peripherals efficiently. However, bear in mind that 32-bit microcontrollers consume more power, especially when all embedded systems and peripherals are turned on.
Hardware Design and Learning Curve
It’s fair to say that a PCB with a 32-bit microcontroller, which usually has over 100 pins, is more complex than an 8-bit one, which rarely exceeds 30. Assembly wise, soldering an SOIC package is definitely easier than a Quad Flat Package (QFP) or a Ball Grid Array (BGA) package. There are also fewer quality issues with wider pitches on an SOIC package. If an 8-bit microcontroller device is sufficient for your project, do not choose a 32 pin microcontroller. Otherwise, use pre-built footprints in PCB design software to minimize your design time.
When you search programming tutorials for microcontrollers, you’ll find that most tutorials stick to 8-bits microcontroller like 8051 or Arduino, a popular 8-bit based microcontroller board. This is because it is easier to get started with an 8-bit microcontroller. A 32-bit microcontroller has a more complex architecture and demands a longer time for familiarization. If you’re creating a simple code production counter, it’s not cost-efficient to ask the firmware engineer to explore microcontrollers for a week when he can set up the entire firmware for much cheaper using an 8-bit microcontroller.
Expect a steeper learning curve with 32-bit microcontrollers. Editorial credit: goodcat / Shutterstock.com
32-bit Microcontroller Applications
There are plenty of applications for a 32-bit microcontroller, but this should be a discussion regarding when not to use a 32-bit microcontroller. In general, any application that requires computations that inevitably involve large numbers and that must be calculated faster should use a 16-bit or 32-bit microcontroller. Some example operations include FFT calculations, image processing, high quality audio or video, and edge computing applications. Some memory and processing intensive tasks involving machine learning or AI are better implemented with something more powerful, such as an ARM MCU or a single-board computer.
If you need to gather measurements of analog signals, a 32-bit microcontroller is not necessarily better than an 8-bit microcontroller. The bit depth quoted for a microcontroller is not equivalent to the bit depth of the built-in analog-to-digital converter (ADC). Commercially available microcontrollers will include an onboard ADC that reaches 8, 10, 12, or 16-bits.
For mobile applications, a 32-bit microcontroller will provide more intense computation at the expense of higher power consumption. Some engineers will tell you that, by using a 32-bit microcontroller, you can finish important computations faster and then put the CPU in sleep mode for a longer period of time. However, this does not mean a 32-bit microcontroller is more power efficient. An 8-bit microcontroller will generally provide longer battery life and have a better balance of peripheral features than similar 32-bit devices.
Choose the Best MCU for Your PCB Design
To choose the best microcontroller for your PCB design while minimizing time and overall cost, it is necessary to carefully assess key advantages and disadvantages of 8-bit versus 32-bit microcontrollers. By taking design requirements like speed, complexity, peripherals, and flash memory into consideration, you can minimize decision paralysis as well as potential setbacks when choosing the best microcontroller for your design.
Still undecided between an 8-bit or 32-bit microcontroller for your project? Talk to an expert at Altium.