Microcontroller fundamentals in a nutshell


Article background

In this article I will cover various aspects of microcontroller components, programming, interfacing peripherals, design, develop software, testing and debugging the developed software features.

Required Components

Article Contents

Online courses related to this article

Course description

Learn to develop software solutions for linux environment, implement requirements through real time projects and get required practical skills for software jobs

Course description

Learn to develop embedded systems, interfacing electronic peripherals through real time projects and get required practical skills for software jobs

Course description

Learn firmware development theory, applications, get practical skills from online tests, projects and earn certificate for software jobs

Micrcontroller Basics

An embedded system is a combination of computer hardware, software and few additional mechanical or electronic parts designed to perform a dedicated function. Examples of embedded systems are microwave oven, MP3 player, or alarm clock. microcontroller production counts are in the billions per year, and are integrated into household appliances (microwave, washing machine, coffee machine, . . . ) telecommunication (mobile phones), automotive industry (fuel injection, ABS, . . . ), aerospace industry, industrial automation and so on...

A personal computer too is comprised of computer hardware and software and mechanical components like memory cards, disk drives etc. But personal computer is not designed to perform a specific function. It does many different things for you starting from playing games to talking with friends over voice and video.

A personal computer uses a microprocessor where as an embedded system uses a microcontroller.

Since there is a wide variety of microcontrollers to choose from and since costs are important we need to select the cheapest device that matches the application’s needs.

The basic layout of a microcontroller is shown below. We will discuss each of the component and its interfacing with the microcontroller in great detail in the following sections.

MCU layout
Basic layout of a microcontroller.

CPU, Architecture, Instruction set

CPU – Microcontrollers brain is named as CPU. CPU is the device which is employed to fetch data, decode it and at the end complete the assigned task successfully. With the help of CPU all the components of microcontroller is connected into a single system. Instruction fetched by the programmable memory is decoded by the CPU. CPU is a unit which monitors and controls all processes within the microcontroller and the user cannot affect its work. With the help of CPU all the components of microcontroller is connected into a single system. It consists of several smaller subunits, of which the most important are:

  • Instruction decoder is a part of the electronics which recognizes program instructions and runs other circuits on the basis of that. The abilities of this circuit are expressed in the "instruction set" which is different for each microcontroller family.
  • Arithmetical Logical Unit (ALU) performs all mathematical and logical operations upon data.
  • Accumulator is an SFR closely related to the operation of ALU. It is a kind of working desk used for storing all data upon which some operations should be executed (addition, shift etc.). It also stores the results ready for use in further processing. One of the SFRs, called the Status Register, is closely related to the accumulator, showing at any given time the "status" of a number stored in the accumulator (the number is greater or less than zero etc.).
  • The instruction set is an important characteristic of any CPU. It influences the code size, that is, how much memory space your program takes. Hence, you should choose the controller whose instruction set best fits your specific needs.

    Memory, Volatile, Non-volatile memory, Accessing memory

    To Read Full Article

    Start any course from the following

    Want to contribute or ask a new article? Write and upload your article information .