A microcontroller
A microcontroller is a chip or an IC designed to control other devices. Microcontrollers include a central processor, memory, and I/O peripherals. Microcontrollers are usually used to perform simple tasks and are usually described as “computers on a chip”.
To use them, they need to be programmed with a special control program. The information that enters the microcontroller is temporarily stored in its memory, and then the processor accesses the information and applies the necessary instructions to decode the data, then using peripheral I/O devices. , issues the appropriate action. The naming of these parts is based on the control tasks of the devices and their manufacturing dimensions.
Microcontroller components
Processor (CPU) : The processor is the most important part of a microcontroller that processes the input data that enters the micro through I/O.
Memory : Memory chips are integrated to store all the information entered into the microcontroller, which are of different types such as RAM, ROM, EPROM, EEPROM, Flash memory in microcontrollers
Input/output ports : Different microcontrollers have different input/output pins depending on their type. They play the role of interface between external input and output devices such as sensors, display units, etc.
Serial ports : they enable the serial interface of microcontrollers with other peripherals. A serial port is a serial communication interface through which information is simultaneously transferred in or out one bit by another
ADC and DAC : Sometimes embedded systems need to convert data from digital to analog and vice versa, and most microcontrollers are connected with internal ADC (analog to digital converter) and DAC (digital to analog converter) to perform the required conversion
Timers : Timers and counters are important parts of embedded systems that are needed for various tasks such as generating pulses, counting external pulses, modulation, oscillation, etc.
Interrupt control : Interrupt control is one of the powerful features in microcontrollers, which is a kind of notification that interrupts the continuous process and gives instructions to perform the task defined by the interrupt control.
Types of microcontrollers
There are different types of microcontrollers such as ARM microcontrollers, AVR microcontrollers, ATmega microcontrollers, plc microcontrollers, 8051 microcontrollers
Types of microcontrollers based on bits
8-bit microcontroller : This type of microcontroller is used to perform arithmetic and logical operations such as addition, subtraction, division, multiplication, etc. For example, Intel’s 8031 and 8051 are 8-bit microcontrollers.
16-bit microcontroller: This type of microcontroller is used to perform arithmetic and logical operations in cases where higher accuracy and performance are needed. For example, the Intel 8096 is a 16-bit microcontroller.
32-bit microcontroller: This type of microcontroller is generally used in automatic control devices such as automatic operating machines, medical devices, etc.
Microcontroller programming
For programming microcontrollers, there are special software’s called compilers. The names of some of these compilers are given below:
- ATMEL studio
- Codevision
- Bascom
- Keil
Each compiler has its own special language. For example, in Atmel Studio and Codevision compiler, C language, BASIC language, etc. are used. Even if the same language is used in two compilers, the same code cannot be used for both, because many functions and libraries in the compilers are different, for example, the programming language of Atmel Studio and Codevision is the same, but it is not possible to use their code for each other used. The great advantage of microcontrollers is reducing the number of ICs and the ability to write and erase the code several times.