Refresh!: Microcontrollers

June 1, 2006
What is a Microcontroller?A microcontroller (µC) is a microprocessor core incorporated with memory and other peripherals on a single IC used to control and monitor electronic systems. The difference between a microcontroller and a

What is a Microcontroller?
A microcontroller (µC) is a microprocessor core incorporated with memory and other peripherals on a single IC used to control and monitor electronic systems. The difference between a microcontroller and a microprocessor is that the microprocessor contains the core without memory or peripherals. The microprocessor needs external ICs in order to create a working system.

What are the components of a microcontroller?
A microcontroller can possess the following features, although this is not a complete list nor do all microcontrollers need to have anything except the core and memory in a monolithic IC.

  • Central Processing Unit (CPU)
  • ROM--generally one-time programmable (OTP) EPROM or Flash memory
  • RAM--on-board memory for data storage
  • Input/Output interface
  • Other Peripherals--Analog-to-digital converters, USB, UART, SPI, etc.

Selecting a Microcontroller
Designers select microcontrollers for many different reasons. µC core, µC speed and program memory size will more than likely be the most important criteria.

  • Core--Can be an 8-, 16- or 32-bit data bus. This means that the microcontroller can process this amount of bits of data per operation.
  • Speed—The number of instructions that can be executed in a certain amount of clock cycles.
  • Program Memory—The number of bytes of instructions or data that can be stored on the chip. Many companies have a roadmap for larger and smaller memory sizes for a specific type of microcontroller.

Other important criteria include:

  • Peripherals--Typical peripherals are an a/d converter and standard interfaces such as USB, SPI and I2C.
  • Package size and number of Input/Output pins—Microcontrollers range in size, so if package size is important to the design, there are a wide range of choices. Usually the smaller the package size, the smaller the number of I/O pins to address external components.

Microcontrollers in the Market
There are many different µC cores available in the market. Some cores have been licensed by multiple microcontroller manufacturers, and other cores are proprietary to the microcontroller manufacturer and considered to be their value-add for their product.

Two widely used µC cores are the 8051 and the ARM family of cores. The 8051 is a single chip microcontroller developed by Intel nearly 30 years ago for use in electronics systems. Many microcontroller manufacturers have adopted the 8051 architecture and have made enhancements over the years. But most importantly, the basic instruction set and architecture have stayed the same. Enhancements involve the expansion of memory and peripherals addressable within the architecture. More than 20 different independent manufacturers of microcontrollers have selected the 8051 as their base CPU core; some of them include Atmel, Dallas/Maxim, Philips, Winbond, and Silicon Laboratories.

Important features of the 8051 architecture include:

  • 8-bit data bus
  • 16-bit address bus
  • 4-bit bi-directional Input/Output port.
  • Serial port
  • Two 16-bit counters
  • Power saving mode

The ARM processor is a 16-bit/32-bit CPU designed by ARM (www.arm.com), a manufacturer of CPU core IP, and licensed for manufacture by many semiconductor companies. It is a robust architecture designed for low-power electronics including battery-operated mobile devices. The ARM is unique in design. It is a very efficient 32-bit architecture that can be realized in a very small package with low power consumption. The processor supports both 32- and 16-bit instructions through the ARM and Thumb instruction sets.

Many different peripherals can be implemented with an ARM microcontroller. This is made simpler through their AMBA bus, designed specially for the connection of the ARM core to peripheral devices. An example of an ARM-based microcontroller is the STR7 family from ST Microelectronics. The block diagram of this part is shown in Figure 1.

Program Memory
Two predominant flavors of program memory exist in the market today for microcontrollers: OTP EPROM and Flash memory.

There are definite advantages and disadvantages for either technology. OTP EPROM is a one-time programmable memory type and Flash is a reprogrammable memory type.

OTP EPROM has lower power consumption than flash memory. Unfortunately, once you program this type of EPROM, you cannot reprogram the memory again. Flash memory can be reprogrammed over and over, which has definite advantages in the development and manufacturing process.

Most flash-based microcontrollers are either in-system or in-application programmable. This means that the program can be updated over and over again even though the flash microcontroller is soldered to the application board. You don't have to remove the microcontroller and in some cases do not even have to take the microcontroller offline.

For instance, one board in a product family might have 10 applications depending on the program file. This would allow for manufacturing, before the product is shipped out, to update the correct version of microcontroller code. Boards can be manufactured and stocked and, not until the last moment, be given their final “code fix” or particular version. This is very handy for companies that have low-volume, high-mix products.

Microcontroller companies often offer the same pin out for a flash-based and a one-time programmable EPROM part. This allows for the flash-based part to be used for development and unproven products and then switch to the less expensive, lower power consumption EPROM parts when the product has been verified.

Microcontroller Peripherals
More and more IP blocks are being incorporated into microcontroller designs. If a microcontroller has a majority of circuit blocks necessary for a design, there is little or no need for external components. This, of course, leads to lower cost and smaller designs. Analog-to-digital converters, USB transceivers, CAN transceivers, SPI and I2C interfaces are cost-effective IP blocks inside a microcontroller part. Even if some blocks are not necessary for a particular design, some manufacturers offer an option to turn off those blocks so power isn't wasted.

There needs to be some way to connect or interface the microcontroller to the outside world. Remember, the microcontroller exists to control and monitor. It's possible to connect sensors, USB host controllers, SPI devices, I2C devices and other devices to microcontrollers. Internal IP peripherals can save costs as well as space and make a microcontroller more self-contained in a circuit design.

Design and Development With a Microcontroller
After the designer has selected a particular microcontroller for a design and all the system specifications have been decided on (i.e. core, speed of operation, I/O, peripheral set, package, etc.), then it is time for the hardware and software development portion of the design.

There are many pieces to microcontroller development. For hardware, an evaluation board or emulator board will be needed and possibly a programmer, which is used to download the firmware code into the microcontroller itself.

The evaluation board is used for physical testing of the design, to confirm that the code and microcontroller act as they were intended. The evaluation board usually has extra board space for the designer to connect the I/O and peripherals to outside devices.

Another hardware tool is an emulator. The emulator is similar to the evaluation board except it allows for the debugging and simulation of the microcontroller in a personal computer (PC) environment while also allowing for external components to be connected to the emulator board. The debug and simulation functions are very useful for complex designs and are software components that work in conjunction with the emulator. An example of an emulator board is the EPM900 from Philips Semiconductors shown in Figure 2.

Finally, there is the programmer. The programmer is a hardware tool that allows for the microcontroller to be programmed with the development and software code. Some programmers can be a separate board that has a socket for the microcontroller to be placed on, but most flash based microcontrollers can be programmed via I/O on the device and can be programmed, as mentioned, in-system or even in-application. This can be completed via connection to the PC environment.

Software development is different from the hardware development. The PC is the tool for software development. Many microcontroller manufacturers offer an integrated development environment or IDE for their microcontrollers. This can be as simple as a software program that offers project management as well as an interface to an emulator or evaluation board. Other software tools are usually necessary, and the IDE offers an interface to the third-party tools. Typically, the IDE corresponds to a particular evaluation board or emulator.

The IDE brings all the different segments of the software together. In addition to the IDE and project manager, there are the following possible modules:

  • Compiler
  • Assembler
  • Linker/Locator
  • Simulator/Debugger

The compiler is a software module that converts a high-level software language, such as “C”, into an object file. An object file is a standard file format, depending on the CPU core architecture, that can be merged with other files in the development process.

The assembler is used by design engineers who want to write in assembly code. Assembly code is useful for designs that require very efficient programming for saving code space and minimizing I/O pins. Writing a program code in “C” is less complex than writing in assembly, but if code space is an issue, assembly is the better solution. Also, the two different approaches can be used in conjunction with each other.

The linker and locator are the modules that merge all the object files together and allocate memory locations for the program code. The linker takes the object files from the compiler and assembler, adds the library information pertinent to the CPU core and merges them all together to make one program code file. This file can be simulated, debugged or programmed into the microcontroller. The emulator is used with the debug and simulator process, and then the updated code can also be uploaded to the emulator board for physical test.

Another possible software module for use in a microcontroller design is a real time operating system or RTOS. A real time operating system allows for multitasking and real time control in a microcontroller based system. One obvious disadvantage is that it takes up precious code space. Less complex designs can be implemented without an RTOS. A typical design flow for microcontroller development is shown in Figure 3.

Microcontroller Manufacturers
There are a multitude of microcontroller manufacturers in the market. Some base their microcontrollers on industry standard cores, such as 8051 or ARM and others differentiate themselves with their own proprietary cores, such as the PIC from Microchip.

Below is a list of a few microcontroller manufacturers categorized by standard (8051 and ARM) and proprietary cores:

8051 ARM Proprietary

Atmel

Atmel

Microchip (PIC)

Philips Semi

ST Micro

Texas Instruments (MSP430 )

Dallas/ Maxim

Analog Devices

Infineon (Tricore)

Infineon

Luminary Micro

Atmel (AVR)

Table 1- List of Cores and Microcontroller Manufacturers

The DSP Connection
Microcontrollers have been getting faster and faster in their ability to process information. Microcontrollers are traditionally in the control plane of a circuit and usually not the data plane. Components that are in the data plane need to acquire data quickly process it and send it on. This data function is usually reserved for DSPs (digital signal processors). Most systems that require a DSP most likely will require a microcontroller as well. This can be a costly proposition. If the two could be incorporated into one controller, the space savings, development time and cost savings would be quite attractive.

For this reason, some microcontroller manufacturers have incorporated DSP functions into their microcontroller cores. Infineon, Renesas, ARM and Silicon Labs are a few of the companies that have done this.

Infineon has the Tricore controller family. This is a 32-bit microcontroller with the ability to call DSP instructions within its instruction set. Complex arithmetic, FIR filters and varying MAC functions are available.

Renesas' SH3 and SH4 microcontrollers have the ability to address DSP functions as well. Renesas offers DSP instruction extensions with high-level arithmetic operations.

ARM, which we previously spoke about, offers DSP extensions for their ARM9E core. There is the ability to perform 16x16 and 32x16 MAC functions as well as other necessary DSP functions for use in such applications as VoIP. This gives designers a powerful solution with minimal cost.

Silicon Labs, manufacturer of high-speed, 8-bit microcontrollers utilizing the 8051 architecture, has the ability to perform DSP functions. The C8051F13x series has 100 MIPS CPU speed as well as a built-in 16x16 MAC.

Summary
In summary, we discussed the following:

  • What is a microcontroller and what are its components
  • Microcontroller design and development
  • Manufacturers of microcontrollers
  • Microcontrollers with DSP functions

Company: EEPN

Product URL: Click here for more information

About the Author

Staff

Articles, galleries, and recent work by members of Electronic Design's editorial staff.

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!