Intro

Big Bang Theory of Microcontrollers, well the title may confuse you a little. Basically, this post is about all that drive development of microcontrollers, and how it actually works. We see (actually use) microcontrollers in number of different devices and gadgets. These gadgets may include your microwave oven, the energy meter, inverter, the billing machine, the Set-top box for your TV, your car dashboard, digital watches, washing machines and so and so the list goes on and on. But the details and study of these tiny wonderful chips is always limited to a very small class of people called engineers, that too only electronics and computer engineers. So this post is to share the basics of microcontrollers to all those are interested in, no specifics, no much technical fuss, plain history and science study. So its really about the big bang of microcontrollers. The need, arrival, and use of microcontrollers in the world of electronics. Lets begin!!!

History

In early days of semiconductors and electronics, there were no such highly developed Integrated Circuits available like are today. In those days, electronics manufacturing business was mostly driven as service oriented business. The manufacturing Giants like Canon, Nikon or any other end product manufacturer used to go the electronics semiconductor manufacturer like Intel, or Texas Instruments with their requirement about particular project. Many times, these companies already had the actual circuit which they wanted to be miniaturized embedded in small size. So engineers at these companies ( TI/Intel) used to work on that circuit, and apply all their intelligence to deploy the circuit on an Integrated-Circuit, which we also call as IC, to reduce space, and overall cost of the total system. It would end up with 4-5 IC’s than a complete board of various electronics components, so the clients were happy from it.

Now the problem in this kind of work, was that completion of each project used to require almost 6 months, sometimes an year to finish and deliver the system. It was completely dependent on intelligent engineers to finish project early and deliver. Though the requirements of these projects differed in terms of detail, the major principle and the overall function was quite identical. Over time, these engineers also used to get bored doing the same job over and over again and necessity of some unique solution was emerging every where. As we say, requirements and needs lead to inventions and discoveries. So in this time, Texas Instrument people thought that One customer needs one set of features and other customer needs some other set of features and it changed with every customer. But the fact remained that every customer needed something common in every Integrated Circuit, some amount of memory, some amount of Interfacing ports and so. So as a result of this excellent thought, came the first TMS 1000 microcontroller chip in 1971. This microcontroller was used at the Texas Instruments internally in its calculator products between 1972 and 1974. The device was further refined over the years. TI offered this microcontroller for sale to the electronics industry in 1974. It was made available in different configurations of RAM and ROM sizes. By 1983, nearly 100 million (1000 Lacs of units) TMS 1000 had already been sold.

Over the coming year, many companies came up looking in this market and applied their own intelligence to generate something unique and something new. Intel Came up with 8051 in 1980 and became one of the most popular microcontroller families. Variations of the 8051 architecture are still manufactured today, making the 8051 one of the most long-lived electronic designs in history

First Micro controller, and second and third

As said above, history says the first one was developed by Texas Instruments, and it was followed by a series of different microcontrollers with different features by different companies. Everyone was excited to buid something unique of them unlike today (use an ARM architecture and develop a chip, simple game though!!! ). So there came a plethora of different devices. Here, we’ll see name of few along with company name and the year of release.

  1. Texas Instruments, TMS1000 1971
  2. Intel 8051 1980
  3. Atmel 89C51, perfect licensed clone of 8051, 1984
  4. Motorola 68HC11 1985
  5. Microchip PIC16C64 1985
  6. Intel 8096 1993
  7. Atmel AVR 1996
  8. Many more after AVR by Freescale, renesas, ST Microelectronics, TI many many more

 

Building Blocks of Micro controller

Now, having known about the microcontrollers history, now lets look on some science of microcontroller working. Lets what exactly microcontroller is made up of. In contrast to the early IC’s developed for specific clients, microcontrollers were different. Any general purpose IC (which is not microcontroller) is manufactured to perform only one particular task, or some related tasks. Microcontroller was manufactured to be programmable. It means, microcontroller, just bought from a shop, will do nothing when you give power to it. It will also do nothing if you connect lots of circuits to it externally. It wont do anything unless you program it.

Whats programming then? Programming is telling the microcontroller about what to do. Sounds funny right, but it is this way. A microcontroller is having something called ALU, an arithmetic and logic unit. This is a large complex matrix of various circuits. It contained lots of circuits to perform arithmetic and logical operations. But these circuits are bare open and not much interconnected. What a program does is simply interconnect these circuits to do a specific thing, and every time you change program, the operation that a controller performs may change. This is because the ALU circuits are rearranged every time a program is executed. In order for this to happen, every microcontroller needs to have at least these things

  1. Clock Generator
  2. ALU
  3. ROM
  4. RAM
  5. IO Ports

Though previous few microcontrollers didn’t always had all above things, they were connected externally if not present on chip. Lets see about these things one by one

Clock Generator

Microcontroller is a digital electronic circuit. Its a combination of Combinational and Sequential Circuits and hence, it requires a Square wave signal called clock for its operation. If a microcontroller dont have clock generator on-chip, it needs to be provided externally. Most modern microcontrollers including the classic 8051 do have their own clock generator. In order to generate accurate clock for further calculations, we use Crystal as component to generate oscillations. Crystal is a quartz substance used for this purpose. Clock generated using crystal oscillator is very accurate and precise. Crystal can not be embedded into the chip, hence its needed to be connected externally. Look at figure below

ALU, and Buses

ALU, as said above is a complex circuit capable of doing various tasks. Basically ALU is nothing but a set of all different circuits which can be accessed by internal wires, which we call for now as Buses. A bus is an internal highway which can carry information to and fro. So in ALU these buses are connected with ALU, and carries some unique identification number ( opcode ) every opcode selects a particular operation to be performed in ALU, so its like a switching circuit with selectable input. These opcodes decide exactly which out of hundreads of circuits in ALU should be used followed by the data for processing.

for example, if addition is to be performed, then in ALU, first a unique code which we call as opcode will come and select the circuit responsible for addition. Once this circuit is selected, from this internal bus will come 2 numbers one by one in which addition is performed. Once addition is performed, another data bus carries result to some safe location. Wonderful right? yes, its all mechanical, everything is decided and designed by humans to operate and there is no one sitting inside to make decisions.

These opcodes are nothing but Raw Binary data which we also call as instructions.Every manufacturer provides its own instruction set. A set of instructions written for performing one particular task is called as a program.

Since human beings can not understand these binary language instructions, they are converted in hexadecimal representations for easy reading. Furthermore, we can not remember hexadecimal codes, so manufacturers assign a particular english language word to every opcode, like add, sub, mul. These english coded opcodes are easy to remember as well as write on paper, and a program written using these english language words is called as Assembly Language Programming.

ROM

Read Only Memory (ROM) is a type of memory used to permanently save the program being executed. ROM, full form is Read-Only-Memory is a kind of electronics storage where a particular information can be stored for further reading. Initially there were ROM’s which were not erasable as well as not having much capacity. These days, we use Flash Memory. This kind of memory is used to store the above explained program. As we discussed, a program is series of binary codes, called opcodes which is executed by the ALU. This program in its binary form is stored in ROM which once stored doesn’t get erased even after the power down. Main feature of ROM is to keep its content regardless of power applied to the circuit, hence its used for storing the programs. The size of the program that can be written depends on the size of this memory. ROM can be built in the microcontroller or added as an external chip, which depends on the type of the microcontroller. The internal ROM is usually smaller and more expensive. The size of ROM ranges from 512B to 1MB and increasing everyday.

RAM

RAM is memory of microcontroller. To understand this, lets take a very simple example

A: hey b, can you perform an addition and multiplication?

B: Yes, surely, tell me

A: ok, now add 2 numbers, these are 5 and 3, once this is done, multiply it by 12 and lastly add 50 to the result

B: Ok, here it goes,

the numbers are 5 and 3 so, 5+3 = 8,

now multiply by 12, so 12 x 8 = 96,

lastly, add 50 so 96+50 = 146

A: are you done

B: yes, the answer is 146, right?

If you’ve gone through above example, can you tell that where guy A keeps the numbers marked RED?

The process of addition and multiplication is permanently stored in his memory (ROM) but still, he needs a temporary storage to hold some real time results. This is the job of RAM in microcontrollers, and microprocessors.

Random Access Memory (RAM) is a type of memory used for temporary storing data and intermediate results created and used during the operation of the microcontrollers. The content of this memory is cleared once the power supply is off. For example, if the program performs an addition, it is necessary to have a memory standing for what in everyday life is called the “sum” . For that purpose, one of the registers in RAM is called the “sum” and used for storing results of addition. The size of RAM goes up to a few KBs.

Ports and Interfaces

In order to make the microcontroller useful, it has to be connected to additional electronics. Each microcontroller has one or more registers (called a “port”) connected to the microcontroller pins. These are called input/output port. Because you can change the pin’s function as you wish. For example, suppose you want your device to turn ON three signal LEDs and simultaneously monitor the logic state of five push buttons. Some of ports need to be configured so that there are three outputs (connected to the LEDs) and five inputs (connected to buttons). It is simply performed by software, which means that the pin’s function can be changed during operation.

Usage in Real World

Thus, we’ve seen the basics of microcontroller in most simplistic way without touching the technical aspects of electronics. These microcontrollers, hence forth can be used to develop numerous different systems which can perform with an accuracy of a computer but in quite low cost. Basically what differs in microcontrollers and microprocessors is the ability to work. Microprocessors are much complex devices which can do thousands of different things hence require more circuits to work and more complex. Microcontrollers are developed with a vision to serve one dedicated application and related things. One can not compare microcontrollers with microprocessors. its like comparing A scooter with a Car, both have their own application areas and both are good at performing something which other cant perform.

If you ever want to enter this exciting field of microcontrollers, then learning Arduino’s is best choice. Arduinos are most simple microcontroller boards ever invented. You can read about it further in Arduino section of our tutorials.

Happy Learning!!!