This is the follow up from Part 1
How it differs from a Microprocessor
Microcontrollers are special-purpose computer systems, usually programmed to perform a single task. However, a microprocessor is tasked to perform a wide variety of functions. For example, a microcontroller in a traffic light control system is dedicated to timely switch ON and OFF the various switches so as to allow smooth traffic flow. On other hands, a microprocessor inside a desktop computer can do a wide variety of jobs depending upon the user inputs. As a matter of fact, a microcontroller has a built in microprocessor too that executes the instructions loaded in its memory.
Example of microprocessors: Intel 8085, 8086, Pentium, etc
A microcontroller can do nothing without it is instructed to do something. The instructions can be loaded into its memory so that it could execute them repeatedly and perform the task it is supposed to do based on those instructions.
Most of the modern microcontrollers have Flash EEPROM to store the instructions. It means you can erase the old instructions and reprogram. You need a programming device to do this. There are many companies who build these programming devices. A few websites where you can buy microcontroller programmers are listed here:
You can find many more on google search.
Additional features of Microcontrollers
Microcontrollers are available with extra features such as analog-to-digital converters (ADCs), watchdog timers, controller area network (CAN), and so on. With an inbuilt ADC, you can directly connect an analog input to the microcontroller. Similarly, a watchdog timer is a piece of hardware that can be used to automatically detect software anomalies and reset the processor if any occur.
A typical example of how microcontroller work?
Source : http://www.maxim-ic.com/products/microcontrollers/designers_overview.cfm
Let's examine how a microcontroller functions while cooking a bag of popcorn in a microwave oven.
You open the door and put the bag of popcorn inside. You close the door and push the button labeled "Popcorn." A few minutes later, a tone announces the popcorn is done. What happened behind the scenes?
When you opened the door, the microcontroller sensed the door switch, turned on the light and disabled the magnetron. The microcontroller continually scans the keyboard. When you pushed the "Popcorn" button, the microcontroller confirmed that the door was closed and began to count timing pulses, started the motor for the turntable, set the power level of the magnetron, and controlled the display. When the timer reached zero, the microcontroller shut down the magnetron, stopped the turntable, and signaled you.