Introduction to Microcontroller

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.

Microcontroller

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.

Microcontroller Architecture

MICROCONTROLLER ARCH

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.

Features of a Microcontroller

  • The main advantage of a CISC (complex instruction set computer) architecture, with which the modern microcontrollers are built, is the macro-type instructions. A macro instruction can be used in a program replacing a number of instructions.
  • Latest microcontrollers are operated at lesser power consumption. Usually, they can support a working voltage of 1.8-5.5 V.
  • Advanced memory is another feature of a microcontroller. Use of ROM memories like EEPROM and EPROM (flash memory) make it more reliable and user-friendly. While EEPROM is a relatively slow memory, EPROM is faster. Fact that it allows more erase/write cycles also makes it more usable.

Advantages

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.

Disadvantages

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.

Comparing Microcontroller with a Microprocessor

Microprocessor

  • It has only the CPU inside; ie the processing powers such as Intel’s Pentium 1,2,3,4 core 2 duos, i3, i5 etc.
  • Don’t have RAM, ROM and other peripheral on the chip. The system designer has to add them externally to make them functional.
  • Application includes desktop PCs, laptops, notepads etc.
  • Applications are where tasks are unspecific like developing software, games, websites, photo editing, creating documents etc.
  • Since microprocessors cannot be used stand alone as it needs RAM, ROM and other peripherals the system that uses microprocessors is costlier than a microcontroller.
  • The clock speed of the microprocessor is quite high as compared to the microcontroller. This can operate above 1 GHz as they perform complex tasks.

Microcontroller

  • In a microcontroller CPU, RAM, ROM, and other peripherals are embedded on a single chip.
  • At times it is termed a mini computer or a computer on a single chip.
  • Some giants in the manufacturing business of microcontrollers are ATMEL, microchip, TI, Freescale, Philips, Motorola etc.
  • Designed to perform specific tasks. ie, the relationship between the input and output is defined.
  • Since the applications are very specific, they need small resources like RAM, ROM, I/O ports and hence can be embedded on a single chip.
  • The clock speed of a microcontroller varies from a few MHz to 30-50 MHz.

Types of Microcontrollers

According to the architecture, memory and word size, it can process, microcontrollers are divided into several categories.

Categorization Based on Bit Size

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.

Categorization Based on Memory

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.

Categorization Based on Instruction Set

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.

Applications

  • Peripheral controller of a PC
  • Robotics
  • In bio-medical equipment
  • In communication system
  • In automobiles
  • In fire detection devices
  • In light and temperature sensing and controlling devices
  • Process control and industrial automation devices
  • In measuring devices such as volt and current meters

Various Manufacturers of Microcontrollers

  1. Analog devices- 8051 microcontrollers with the 12-bit analog to digital converter.
  2. Atmel- 8051, AT91, AVR, AVR32
  3. Freescale semiconductor-family of microcontrollers ranging from 8-bit to 32-bit
  4. Infineon technologies- 8-bit microcontrollers based on 8051 and 16-bit ROM and OTP microcontrollers
  5. Maxim Integrated Products- 75 MHz single-cycle flash 8051 microcontrollers, some low power 16-bit microcontrollers
  6. Microchip – wide array of 8-bit microcontroller families including PIC12, PIC16, PIC18, 16- bit PIC 24 microcontroller and PIC32 which is 32-bit microcontrollers.