A microcontroller is an electronic device belonging to the microcomputer family. These are fabricated using the VLSI technology on a single chip. There are microcontrollers available in the present market with different word length starting from 4 bit, 8 bit, 64 bit to 128 bit. This chapter is about microcontrollers, their architecture, and various features.
In a broader sense, the components which constitute a microcontroller are the memory, peripherals and most crucially a processor. Microcontrollers are present in devices where the user has to exert a degree of control. They are designed and implemented to execute a specific function such as displaying integers or characters on an LCD display module of a home appliance. Application of microcontrollers is myriad. In simpler terms, any gadget or equipment which has to deal with the functions such as measuring, controlling, displaying and calculating the values consist of a microcontroller chip inside it. They are present in almost all the present day home appliances, toys, traffic lights, office instruments and various day-to-day appliances.
The most important part of a microcontroller is a central processing unit with a word length ranging from 4-bit to 64-bit and in some modern microcontrollers the word length goes even beyond the limit of 64-bit. A timer is one other constituent of a microcontroller. There is a watchdog timer. Memory spaces such as RAM, ROM, EEPROM, EPROM are there to store data and programs. For data storage, volatile memory RAM is used while for the program and operating parameter storage ROM and other memory spaces are used.
CPU: Being regarded as the brain of the microcontroller, central processing unit fetches, decodes and executes the instructions. It coordinates various activities taking place in the microcontroller.
I/O ports: There are several parallel input/output ports in a microcontroller. They are used to interface various peripherals such as printers, external memories, LEDs and LCDs to the microcontroller. Apart from parallel ports, there are serial ports to interface serially connected peripherals with the microcontroller.
Memory: As in the case of a microprocessor, a microcontroller has spaces for memories such as RAM, ROM including EEROM and EPROM. It also allocates a certain amount of flash memory to store program source code.
Timers and counters: These are the fascinating constituent parts of a microcontroller. Timers and counters are used in operations which include modulation, clock functions, frequency generation and measuring and pulse generation.
Analog to digital converters (ADCs): Such converters are useful while converting the output of a sensor which would be in analog form.
Digital to analog converter (DAC): The working of a DAC is just the reverse of an analog to digital converter. As it is obvious, the output will be an analog signal which can be used to control the analog peripherals such a motor.
The main advantage of a microcontroller is that the low cost with all the integral parts mounted together on a single chip. The design makes it more compact and easy to use. The easiness of using a microcontroller and the relatively easy maintenance process also make it more reliable. Almost all the pins in a microcontroller are programmable and it makes the microcontroller a lot user-friendly. Simplicity while interfacing ROM, RAM, and I/O ports. Easiness of troubleshooting and a minimal time requirement for various operations are other crucial advantages.
Since it contains all the components on a single chip, microcontrollers are having relatively complex architecture. Microcontrollers are not suitable to interface high power devices directly and they can only perform the limited number of operations simultaneously.
According to the architecture, memory and word size, it can process, microcontrollers are divided into several categories.
There is an 8-bit microcontroller which executes basic functions such as arithmetic and logic operations. Intel 8051 is an 8-bit microcontroller. Example for a 16-bit microcontroller is Intel 8096. They are more accurate and provide better performance compared to the 8-bit microcontrollers. 32-bit microcontrollers are used to execute higher functions where precise automatic control is required. The best example of such a microcontroller application is implantable medical appliances.
According to the memory space inside the microcontroller, the microcontrollers are classified as external memory microcontroller and embedded memory microcontroller.
External memory microcontroller: It does not have all the integral parts fabricated on a single chip, especially the memory. Intel 8031 is such a device which does not have the program memory on the chip.
Embedded memory: As the name indicates it has all the functioning bocks including the program and data memory
fabricated on a single chip. 8051 is an example.
Based on memory architecture, microcontrollers are divided into two: Harvard memory architecture and Princeton memory architecture.
There are two classifications based on the instruction set. They are CISC and RISC. CISC is the abbreviated form for complex instruction set computer and RISC is the abbreviated form for reduced instruction set computer. CISC is based on macro instruction sets which mean a single instruction is used to replace a number of instructions. In reduced instruction architecture, the operation time is reduced by minimizing the clock cycle per instruction.
8051: It is the most universally used microcontroller and was introduced by Intel in the year of 1981. It has 40 kb internal ROM and 128 byte RAM. An additional 64 kb of external memory can be interfaced with the microcontroller. The four parallel 8-bit ports of this microcontroller can be easily programmed and addressed. There is a crystal oscillator interfaced to the microcontroller which generates a frequency of 12 MHz. Apart from these components, there is a serial port which is 8-bit sized and two 16-bit timers incorporated in the 8051 microcontrollers.