All too often, the focus of discussion for microcontrollers is the latest 32-bit device. Is it the fastest? Does it come with the most memory? Does it feature the biggest set of peripherals? Does it have the lowest power?
However, for every application where these new devices find a home, there are many more where an 8-bit microcontroller is happily filling a need.
The traditional 8-bit application used to be memory-limited and communicated through a simple serial interface. Software was normally handcrafted assembly code, designed to squeeze the maximum of processing with the minimum of memory for code. Today, there are still several 8-bit architectures, including the classic all-purpose 8051 design. For each architecture, there are often multiple implementations. Each implementation can have a huge number of variants, with different processor speeds, different power consumptions, different memory configurations, different selections of peripherals, and different packaging options. Combine these, and it is common to get hundreds of different parts within a single family and thousands for a particular architecture.
Choosing the best configuration for a particular application can quickly become an issue. Fortunately, as well as the traditional “paper and pencil” ways of defining requirements, there are boards that allow the development of prototypes to explore configurations, providing better information to help decide on the most appropriate device for that application.
Figure 1: Arduino Uno board.
One way to explore an application before committing to a specific architecture is through Arduino. Arduino is an open-source project concerned with, as the Arduino web site says, “making computers that can sense and control more of the physical world than your desktop computer.” This is perhaps a definition of embedded systems. It revolves around the Arduino board, a family of small development boards each with an Arduino processor - an Atmel ATMega 8-bit processor from the AVR family. The processor is programmed using an Arduino programming language in an Arduino development environment that runs under Windows, Macintosh OSX, and Linux operating systems. The development boards are available as fully populated boards, as bare boards, or as design files. Supporting this is a number of interface boards (again populated or as build your own) and educational kits. Arduino users are encouraged to share designs and code on the project web site.
Figure 2: Parallax BASIC Stamp 2.
A superficially similar approach comes from Parallax with the BASIC Stamp microcontrollers/modules. The modules are packaged as large, dual-in-line packages and are powered by 9 V batteries. They communicate with a PC through a serial port - the first design was in 1990. The module contains its own BASIC interpreter to execute pBASIC – a dialect of BASIC with a range of microcontroller-oriented commands and features. Like Arduino, there are support boards and development kits, both from Parallax and from third parties, and there is a community website. Unlike Arduino, however, Parallax is a commercial organization.
A more recent entry into the development market is mbed. While Arduino and Stamp are educational/hobbyist oriented, with a slight overlap with the professional arena, mbed is the equivalent of the top end of the semi-pro digital camera market, with a strong leaning towards the professional. The website states that “mbed is a tool for Rapid Prototyping with Microcontrollers” and later clearly spells out the purpose of mbed:
“…mbed is designed for quick experimentation and iteration… Professional embedded tools are like a complex CAD program, good for refining every detail. In contrast, mbed is more like a pencil and paper, great for quickly sketching out a design with the support of the resources, libraries and developer community.”
Figure 3: The mbed NXP LPC11U24 (left) and mbed NXP LPC1768 (right).
The processors at the heart of the boards are the NXP LCP11U24, based on the ARM® Cortex™-M0 and the NXP LPC1768, based on the ARM® Cortex™-M3. The original mbed board used the NXP LPC2368 with ARM7 architecture. These are both 32-bit architectures and can draw on extensive C and C++ libraries and the relevant bits of the ARM eco-system. The project, which started as a skunk-works project within ARM, is now officially supported by the company. The boards communicate with a host through USB, and have interfaces like SPI, I²C, and CAN to communicate with other devices, as well as PWM and analog interfaces.
These development environments are often, as the mbed people say, a way of sketching out an idea or investigating possible configurations for an application. When it comes to developing the real system, the developer may need a more heavyweight set of tools. The size of memory and speed of processing in many 8-bit processors indicates that it has become possible to move away from assembler and use instead high-level languages, often C, for application development. This, in turn, requires more detailed debugging tools. Most chip manufacturers provide these as part of their general resources.
One significant trend has been the extension of general-purpose 8-bit processors into using the 8-bit controller as the programmable basis for a special application. For example, a growth area for little micros is in capacitive sensing. When an application uses a touchscreen, sliders or wheels, resolving the input and passing it to the appropriate application software requires processing power. An attractive way to achieve this is to offload the processing onto an 8-bit processor, often communicating with the main processor through a simple serial interface. STMicroelectronics, for example, has developed the STM8-TOUCH-LIB free software library that converts any 8-bit STM8 microcontroller into a capacitive touch-sensing controller. Microchip has a similar mTouch™ library for PIC16 8-bit controllers.
Within cars, while safety-critical applications are normally implemented on 32-bit devices, there is a range of interface and control applications where an 8-bit processor is the optimal solution. Examples include motor controls for doors and windows, displays for the dashboard, and for infotainment applications such as audio and satellite navigation systems. Often the controllers for buses, such as CAN or LIN, are variants of an 8-bit design.
Processors for use in automotive applications have to meet the extreme environmental conditions that are found in a car, from as low as -40 up to at least +105 degrees Celsius and sometimes up to +125 degrees. An example of a general-purpose device that meets automotive temperatures is the Atmel Mega168-15AD.
In consumer applications, the little micro is often the processor(s) within white goods – refrigerators, washing machines, dishwashers, and so on. Top of the range machines may have several devices, with a central processor, an interface controller, and a motor controller, while in lower level-machines, these functions may be shared on a single processor. While what we have been looking at so far has been based on the specific technology of an 8-bit processor, Microchip, with the PIC family, has a different approach. In fact, the company has said in the past that bit numbers are irrelevant, and that what counts is matching the package of processor (speed and power), memory, and peripherals to the application. If you are interested, the internals range from 8-bit through 16-bit to 32-bit, but all the devices share a common development platform: the MPLAB IDE. Under this umbrella is a range of development boards, software development tools and libraries, debuggers and probes, even third party RTOSs. Recently, the company has launched an Accessory Framework for Android™ with a development board and a software library for creating applications running under Android™ on the PIC family, communicating through a USB connection.
Texas Instruments is one of the few companies that are still introducing new products at the 16-bit level. These are designed for very low-power applications and often have very low prices. The MSP430 architecture, supported by the Code Composer Studio IDE and the LaunchPad development and software libraries, is intended for developers working on battery-powered products, such as personal health and fitness, and portable consumer devices. They are deployed in a wide range of sensor-based applications. Not yet released is the Wolverine platform, which, using FRAM (Ferroelectric RAM), will have ultra-low power requirements suitable for applications powered from energy-harvesting – remote and portable devices without wires or batteries.
As we have discussed earlier, by the time you have combined the different options of processor speeds, memory capacity and peripherals, the options for a particular processor family can be enormous. Cypress Semiconductor has an alternative approach: the PSoC or Programmable System on Chip. Their introduction to it describes it as the conjunction of a microcontroller, and ASIC and a standard product, with the virtues of all of these and fewer of the drawbacks.
On a single chip are an 8-bit microcontroller, either the venerable 8051 or the Cypress M8C controller (although an ARM® Cortex™-M3 32 bit product is being rolled out). Alongside this are programmable analog and digital blocks; FLASH and SRAM; and a wide range of IO functions. At design time, the engineer determines the functions that will be needed and the connections between them. These settings are stored in registers on the device. At power up, the registers configure the device. However, the chip can be reconfigured dynamically – perhaps one configuration for setting up a system and a second one for normal system execution. If the application requires a particular function only in special circumstances, perhaps when only an occasionally used particular task requires a specific communications interface, then this can be configured for as long as necessary and then released again.
The 32-bit cores in the ARM® Cortex™ range, particularly the Cortex-M0 and other 32-bit architectures, are making inroads into what was traditionally the 8-bit application space. However, there is still a wide sweep of applications where the small footprint and low power, often combined with proven legacy software, of an 8-bit processor will continue to provide very attractive options both in cost, power consumption and speed of development. For a long time to come, developers will be making use of the little micros that could.