2.2. What is a Microcontroller?#
Everyone nowadays have at least one computer with them, it’s either the smartphone or a laptop or maybe a workstation. All of these devices have a CPU (Central Processing Unit), also known as a microprocessor (μP), where the computation happens. Apart from a CPU, these devices also have a couple of GBs of RAM (Random Access Memory) and hundreds of GBs in the form of HDD (Hard Disk Drive) or SSD (Solid State Drive) for information storage. Along with these building blocks, each device may have extra hardware for different types of I/O (Input/Output) like USB, Wi-Fi, SDCard Reader, etc. All of these components/hardware is made to talk with each other with the help of a big circuit board known as motherboard.

Fig. 2.1 μC with different functional blocks on the same chip#
Contrary to a μP based distributed system, such as one discussed above, a microcontroller (μC) has almost everything embedded in a single chip. This difference enforces different design constraints for both the systems and in effect cause them to be used in different applications. Following are some differences between μP based systems and μCs
It is difficult to produce large chips/silicon dies without a fault, thus μCs are limited in size while μP based systems can be large due to their distributed nature.
Chip size is somewhat proportional to the computation power, thus the μCs are always computationally less powerful than a μP based system.
Due to their smaller size/footprint, a μC generally doesn’t face problems related to heat dissipation. To the contrary, μP based systems almost always require extra components for heat dissipation.
Since the majority of functional components (RAM, storage, etc.) are embedded on a single chip, the signal transmission time is much lower in case of μC as compared to the μP based system. This makes μCs suitable for real-time applications.
Apart from these major differences, the type of I/O used for μCs is also slightly different. The I/O in μCs include PWM (Puls Width Modulation), I2C (Inter-Integrated Circuit), ADC (Analog to Digital Converter), etc. These I/O functionalities for μCs are more collectively known as Peripherals.
Keep in mind that the differences discussed above are not strict. The boundaries between μCs and μPs are getting blurrier. For example, some manufacturers now allow external flash (where the program is stored) to be connected to a μC, the base clock speed of some consumer μCs has now reached close to 1GHz, etc. Thus, this distinction between μC and μP based systems might change over a period of time as technology advances.