MCU peripherals

We already covered what microcontroller is and the difference between microcontrollers and PCs in the last post. We will explore more about how peripherals play a role in MCUs and basic types of peripherals this time.

Peripherals add functionality to the MCUs – they can work alone or together with other peripherals. The peripherals are connected to each other, the CPU and memory through a bus, which is a mechanism that transfers data between components. The peripherals are controlled by turning features on or off in their associated control registers. A register is a small amount of memory that can be read from and written to.

1. Clocks

Clocks are what drives the CPU, memory and peripherals and ensures cooperation between the different components by emitting electrical impulses at regular intervals. The clocks are produced by oscillators. Different clocks can be obtained by using different types of oscillators and by scaling.

Figure 1. Clocks produced by an oscillator and scaled into one low frequency and one high frequency clock

2. Timers

A Real Time Counter (RTC) can be used to keep track of time. It can both increment a count register based on a clock and to check if the count has reached some value and trigger an action.

3. ADC and DAC

There are ways to make the MCU interact with everyday continuous signals like for instance sound waves. Analog to Digital Converters (ADC) are used to discretize an analog signal to a digital (binary) value. An example could be to take the continuous variation in voltage produced by a microphone and store it as a sequence of discrete voltage values. The values can then be accessed from software. The converse operation, performed by Digital to Analog Converters (DAC), could be used to play a sound through speakers.

Figure 2. The analog signal is sampled at regular time intervals by the ADC. The sample size is 8 bit and corresponds to the unsigned voltage level at the given time step. The DAC converts the discrete values back into an analog signal.

4. Communication

Several communication solutions exist: Universal Serial Bus (USB), Serial Peripheral Interface (SPI), Universal Asynchronous Receiver/Transmitter (UART) and Universal Synchronous Asynchronous Receiver/Transmitter (USART). The UART can be used to communicate with a serial port on a PC.

Figure 3.  A kit where an MCU is mounted on a printed circuit board together with external peripherals such as LEDs, buttons and an LCD display.

Energy Micro University is a program developed by Energy Micro to encourage learning and to help institutions develop their own programs for teaching microcontroller development. To download learning materials in pdf, please click here: Energy Micro University Program

To know more about EFM32 starter Kits and development Kits, please click here: Kit Summary

For technical questions about this project, please use our support forum