How Microcontrollers Work

Aug 16, 2018

Microcontrollers are embedded inside devices to control the actions and features of a product. Hence, they can also be referred to as embedded controllers. They run one specific program and are dedicated to a single task. They are low power devices with dedicated input devices and small LED or LCD display outputs. Microcontrollers can take inputs from the device they controlling and retain control by sending the device signals to different parts of the device. A good example is a TV’s microcontroller. It takes input from a remote control and delivers its output on the TV screen.

Like traditional computers, microcontrollers rely on different features to get their job done. These features include:

RAM

RAM is used to store data as well as other results that are created when the microcontroller is at work. However, it does not store the data permanently and its memory is lost once the power supply to the microcontroller is cut. The RAM hosts a special functions register (SFR). This is a pre-configured memory offered by the microcontroller’s manufacturer. It controls how particular circuits like the serial communication and analog-to-digital converter behave.

ROM

The special tasks that microcontrollers carry out as programs are stored in the ROM (Read Only Memory) and never change. ROM allows microcontrollers to know that certain actions should trigger particular responses. For instance, ROM allows the TV’s microcontroller to know that pressing a channel button should change the display on your screen. The program size that is stored on ROM depends on the ROM’s size. Some microcontrollers accept ROM addition in the form of external chips while others come with built-in ROM.

Program counter

The program counter allows the minicomputer to execute programs based on a series of different programmed instructions. The program counter increases by 1 every time a line of instructions is executed. This helps to keep track of the counter’s place in the line of code.

Inputs and outputs

Unlike a computer that you control with the help of a mouse or keyboard, microcontrollers have unique ways of interacting with humans through inputs and outputs. Typical input and output devices on microcontrollers include LED displays, switches and sensors that determine humidity, temperature and light levels. Most embedded systems do not feature screens or keyboards for direct human-to-computer interactions. Instead, microcontrollers feature a wide range of input and output pins or GPIO that are configured for different input and output devices.

For example,you can have one pin configured as an input on the microcontroller that works by sensing temperature, and another pin configured as the output and connected to the thermostat that triggers the air conditioner or heater to turn on and off based on the pre-set temperature ranges. The input and output dynamics are purely machine-to-machine and do not require direct human interactions in order to make decisions.