Wednesday, March 10, 2010

Microcontroller and MicroProcessor

Microprocessor is a single chip computing unit , it has ALU , Registers for temporary data storage , address and data pins for accessing external memory ,
Timing and control circuits , Program counter etc etc;

A microcontroller has all that what a microprocessar has , sometimes external memory access pins also ,
Difference is that although microcontroller can have external memory access ,most of the time ,memory is fabricated on same piece of silicon , microcontrollers have on chip Program memory ,and some data RAM is also there , Manufactuting Large data size Static RAM is not cheap ,
thats why initial microcontrollers only have internal RAM size of 128 ,256 byte , now a days more complex applications are coming like USB , DSP, which require large size temporary storage , so now microcontrollers come with internal RAM size in kilo bytes ;

Another difference is that if you want to do Some Input /Output device interface with microprocessor you will need to combine its address lines with status signals of Read /write ; IO /memory , to make a proper IO Port ;
In a microcontroller its pins are ready IO ports , it can directly take input /output from some other device , you can address a single pin of microcontroller and can change the logic level on it, through your program.


Microcontroller and microprocessors applications are different ,

A microcontroller is meant for real time applications , with limited program and data memory , ,
for example there is microcontroller in keyboard of PC , which is detecting a keypress , and communicating this to the Computer ,

A microprocessor is for data intensive applications , where the focus is not much on input /output device interfacing but on fast , processing of huge amount of data ,a microprocessors memory is expandable within limits of its address and data bus size
For example :- The Pentium in CPU of computer is a microprocesssor , you can always increase the RAM of your computer upto a limit , which is where all programs are executed ;





Friday, December 4, 2009

Starting with Microcontrollers

If you want to learn Microcontroller , the best way is "do it yourself" , electronics is the best science which could be learned experimentally at home.You can make a simple kit from many design available on internet , or you can even purchase a ready made kit , many sample programs are available at websites of microcontroller manufacturers .

Thursday, May 14, 2009

Invention of Microprocessor

Microprocessor was invented at Intel , In early 70's intel was developing a chip for use in digital calculator for a japanese company, soon intel realized that such a chip could be used independently for other applications also, they released the chip in market , it became very popular , that was "4004" , a 4 bit microprocessor , that means the biggest number it can handle ( for addition , substraction etc ) , is "15 " ,its frequency was in KiloHertz , that means it took milliseconds to execute an instruction compare it with todays microprocessors which are 64 bit capable and operate at Giga Hertz (nano seconds instruction timing). Microprocessor is a big milestone in science , because of microprocessor it is possible to get the computing power in Hand held size machines, it incorporates a complete processing unit, earlier computers used electromagnetic relays as basic memory unit , so they were huge ,they took space equivalent to a room ,and were slower than even low end processors of these days.When semiconductor was invented and IC technology came , the computers were made using digital logic IC's , that also took much space , microprocessor is a single ic , equivalent (or even powerful) to those processing units .It has everything inside , fabricated on a single peace of silicon , whose area is in millimeters , so now computer could be anywhere , inside a washing machine , a mobile phone , GPS machine , any machine can have a higher level of interactivity , programability , and accuracy .

Tuesday, May 12, 2009

Boolean algebra

Digital electronics is based on boolean algebra, , it is mathematical binary system, as in decimal system we use digits from 0 to 9 and get the value of a "number" by multiplying every digit with " 10th order for that digit " and then adding all, so in binary we express number using only two digits 1 and 0 and use power of 2, to get the value of number ,
in decmal 987 = 9 x (10^2) + 8 x(10^1) + 7 x (10 ^ 0) = 9 x 100 + 8 x 10 + 7 x1

in binary 101 = 1 x (2^2) + 0 x(2^1) + 1 x (2 ^ 0) = 1 x 4 + 0 x 2 + 1 x1 =4+0+1 =5

Boolean algebra is set of rules of addition , subtraction , OR , AND ,NAND operation for binary digits,

The Beauty of boolean algebra is that you can directly copy it on electronic ciruits , you have just two states "1" or "0" , not like 10 (0-9) , in decimal , and with those two states you can express any mathematical ,physical quantity, so if i consider "1" to be on state of my circuit , then "0" will be off state and vice versa. Now using semconductor devices ciruit could be formed which execute boolean operations like AND , OR , NOT , NAND , you are not giving any "number " to a ciruit for addition , you are applying a combination of high (1) and low (0) ,
to the inputs of ciruit , and the output is a sequence of high and low voltages , the only thing is that it is exactly boolean algebra if you have assumed a high voltage to be boolean "1" , and a low voltage to be "0".

So when in a calculator you press 9 that "high" "low" voltage combination appears on some pins of the inside microcontroller , how you see "9" on the display , microcontroller program , glows those segments of LED , or LCD , which are required for Digit "9" , its not like that there is some unchangeable relation between pressing "9" , and "9" being displayed, that you pressed 9 and that's why 9 is there on display , no !!! it is made like that , if you change the program of microcontroller you may show some other digit for the "9" button ,
All digital electronics is like this , "rules" are made , ciruits which do calculations , are made to imitate boolean algebra, and there are other parts of that system , which take the "boolean output" and control some output device in accordance with that so that humans can interpret them, that is all made by us , for our own interpretation .

Sunday, January 18, 2009

Programmability and Digital Electronics

Programming and Digital Electronics:-

What is a Program ?

A program is sequence of instructions made for a purpose ;

suppose you have to find a x b + c;

to find the answer you follow some sequence ;

you can divide your all activities into many small activities ;

In a program these small activities are "instruction " ;

Programmable Digital Electronics :-

suppose i have a digital circuit which can add ,subtract ,multiply , divide,
i can give my variables to its input , and by some function selection inputs , i can tell
it whether to add, or subtract the variables ;it can do one calculation at a time;
what if i want to make it programmable?this is the general idea of programming , and is the core of all digital computers ;whether high speed super fast machines, or a microcontroller in a toy;

i will add a memory ic to the function input of the circuit ;the output of memory will decide what will be done by the circuit ;since my memory has many addresses , i will store my instructions , at consecutive memory locations of the memory;
then i will apply a clock to the address counter, of the memory , that will cause the counter to increment once every clock cycle,so at each new clock cycle , my digital circuit will execute a new instruction , or part of instruction (Microprogram ) , previously stored in that memory location to which address counter is pointing ;

this is a simple picture however inside of a programmable machine is more complex, there are many more circuits to make it perfect.

That digital circuit which performs the arithmetic logical operations is called "ALU"(arithmetic logic unit) ;
when the circuitry needed to fetch the instruction from memory , decode and execute that , is added to it , this is called "microprocessor"; when the memory is provided within the chip itself ,along with the circuitry needed to for external input or output , that is called "Microcontroller".

Silicon chip

If you have ever opened a calculator to find out what enables the calculator to calculate all your mathematics in blinking of an eye , which will take much time while calculating with pen and paper,you see a black piece of silicon , "what that is ?" that it is nothing else than a "Microcontroller ",what makes the things automatic , how those tv video games worked , what made them interactive, certainly the program running in a microcontroller .