Microcontroller selection
The main component of hardware designs and prototypes are normally microcontrollers (MCU, uC); microcontrollers are low-power computers that have integrated memory and programmable peripherals on a single integrated circuit (IC). Microcontrollers are considered the brain of the hardware board that interfaces sensors, algorithms, and communications together.
There are many microcontrollers on the market and it can be overwhelming to choose which one to use. The most common microcontrollers are manufactured by:
1. ARM
2. Microchip Technology
3. STMicroelectronics
4. Texas Instruments
Texas Instruments (TI) makes extremely low-power MCUs ideal for applications with small coin cell batteries. TI's MSP430F2 is a fairly low power family with flexible capabilities. For more powerful applications, Microchip's PIC24F or ST Microelectronic's STM32F family are great options. Exploring outside of these families to see what is out there is always an option, but familiarity dramatically reduces design and development time.
Which MCU is for you?
Selecting a microcontroller can be overwhelming if you are not well versed in the vocabulary. The list below summarizes will clarify, hopefully, all the vocabulary required to read a data sheet.
Active mode - The highest power consumption mode and enables most of the subsystems of the MCU
Sleep mode - The low power consumption mode that turns off many non-critical components of the MCU to conserve power
Clock module - There are multiple clocks in the MCU that are all synced off one or two crystals or oscillators
Crystal Oscillator - Uses mechanical resonance to create an electrical signal of a single frequency
Timer - A register in the MCU that can be used for counting and capturing time
Comparator - Internal component to the MCU that can compare inputs
Pulse Width Modulation (PWM) - Generates a square wave signal with variable duty cycle
Analog-to-Digital Converter (ADC, A/D) - Evaluates the voltage level on an input pin using 16 or 8 bit binary values in the MCU
Universal Asynchronous Receiver Transmitter (UART) - Two line technique used for serial communication between chips
Serial Peripheral Interface (SPI) - Three line communications between multiple chips using hardware selection between chips
Inter-integrated Circuit (I2C) - Two line communications between multiple chips using software selection between chips via addressing
General Input-Output Pins (GPIO) - Pins used as outputs or inputs to control or read a single digital bit
To choose the microcontroller, the following steps can be followed.
1. Check required peripherals and number of pins
The first and foremost rule of selecting a MCU is to ensure there are enough pins and communication peripherals for your block diagram. Each chip used to communicate with the MCU will require its own communication modules unless it can share the line with another chip as in SPI or I2C. In addition, LEDs and programming pins will be required for programming and debug. This is explained in more detail in Pin Selection.
2. Check Memory and Architecture
This is probably the most difficult design consideration for hardware engineers, since they may not be familiar with the firmware to be implemented on the MCU. Always caution on the safe side for low production projects. If you are working on a large production project, develop the firmware and estimate the amount of memory required. The architecture could be 8-bit or up to 32-bit depending on how complex and fast the required operations are.
3. Power consumption requirements
For applications with limited battery power, this is a huge concern. Keep in mind lower power consumptions means less processing power. This balance is critical for your microcontroller selection. Also, don't forget about sleep mode! If the MCU only has to be on for a short period, a high power MCU with very low sleep mode power consumption might be the best option.
4. Cost
Cost should be the last and least important consideration unless you are on a high production product. It is necessary to get the proper MCU to complete the project effectively and efficiently.
There are many microcontrollers on the market and it can be overwhelming to choose which one to use. The most common microcontrollers are manufactured by:
1. ARM
2. Microchip Technology
3. STMicroelectronics
4. Texas Instruments
Texas Instruments (TI) makes extremely low-power MCUs ideal for applications with small coin cell batteries. TI's MSP430F2 is a fairly low power family with flexible capabilities. For more powerful applications, Microchip's PIC24F or ST Microelectronic's STM32F family are great options. Exploring outside of these families to see what is out there is always an option, but familiarity dramatically reduces design and development time.
Which MCU is for you?
Selecting a microcontroller can be overwhelming if you are not well versed in the vocabulary. The list below summarizes will clarify, hopefully, all the vocabulary required to read a data sheet.
Active mode - The highest power consumption mode and enables most of the subsystems of the MCU
Sleep mode - The low power consumption mode that turns off many non-critical components of the MCU to conserve power
Clock module - There are multiple clocks in the MCU that are all synced off one or two crystals or oscillators
Crystal Oscillator - Uses mechanical resonance to create an electrical signal of a single frequency
Timer - A register in the MCU that can be used for counting and capturing time
Comparator - Internal component to the MCU that can compare inputs
Pulse Width Modulation (PWM) - Generates a square wave signal with variable duty cycle
Analog-to-Digital Converter (ADC, A/D) - Evaluates the voltage level on an input pin using 16 or 8 bit binary values in the MCU
Universal Asynchronous Receiver Transmitter (UART) - Two line technique used for serial communication between chips
Serial Peripheral Interface (SPI) - Three line communications between multiple chips using hardware selection between chips
Inter-integrated Circuit (I2C) - Two line communications between multiple chips using software selection between chips via addressing
General Input-Output Pins (GPIO) - Pins used as outputs or inputs to control or read a single digital bit
To choose the microcontroller, the following steps can be followed.
1. Check required peripherals and number of pins
The first and foremost rule of selecting a MCU is to ensure there are enough pins and communication peripherals for your block diagram. Each chip used to communicate with the MCU will require its own communication modules unless it can share the line with another chip as in SPI or I2C. In addition, LEDs and programming pins will be required for programming and debug. This is explained in more detail in Pin Selection.
2. Check Memory and Architecture
This is probably the most difficult design consideration for hardware engineers, since they may not be familiar with the firmware to be implemented on the MCU. Always caution on the safe side for low production projects. If you are working on a large production project, develop the firmware and estimate the amount of memory required. The architecture could be 8-bit or up to 32-bit depending on how complex and fast the required operations are.
3. Power consumption requirements
For applications with limited battery power, this is a huge concern. Keep in mind lower power consumptions means less processing power. This balance is critical for your microcontroller selection. Also, don't forget about sleep mode! If the MCU only has to be on for a short period, a high power MCU with very low sleep mode power consumption might be the best option.
4. Cost
Cost should be the last and least important consideration unless you are on a high production product. It is necessary to get the proper MCU to complete the project effectively and efficiently.