Microcontroller is a small programmable computer on a single chip.
This IC is composed of CPU, RAM, Flash (ROM) and some peripherals such as GPIO, UART, SPI, …. (for connecting to other devices and the outside world in general).
Since a PC is very expensive for tiny applications, choosing a microcontroller is a lot more efficient, very smaller and less power consuming as well.
Many different microcontrollers, such as 8051, ARM, AVR, PIC, TI exist in the world,
Why do we use microcontrollers?
Before the invention of microcontrollers, electronic designers were forced to design electronic circuits with transistors and lots of other various electronic devices and ICs so that the final circuit would be able to serve one purpose. Therefore circuits would become very large and the process of designing circuits was very difficult.
By invention of the first microcontroller in 1981 (named 8051) by Intel corporation, complications of design were lessened.
We can use microcontrollers in many applications. for example, in subway entrance gates, temperature controllers, robots, elevator control systems, toys, keyboard and mouse control, digital clock, display panels and anywhere we need a digital controller like industrial controllers (PLC and simple controllers).
Thus we can control any circuit thanks to microcontroller.
And any electronic engineer should know how to use it.
We can program microcontrollers with Assembly, Basic, C and C++ languages.
Assembly and basic languages are different in each microcontroller so modifying a program written for an early microcntroller, so that it can be used in other microcontrollers is a difficult task and the programmer must learn new instructions of each microcontroller.
Unlike assembly and basic languages, C and C++ languages have the same instructions in any microcontroller and any compiler. That’s why we are able to move our programs to any other microcontroller easily. Maintenance of programs is easy as well.
The only advantage of assembly language over C is that, assembly language is faster.
Programmer needs to be well aware of capabilities of the microcontroller. He can write parts of the code that need more speed with assembly language.
By using PC and programmer hardware, we can program the microcontroller.