What is the main difference between microcontroller and microprocessor?
A microprocessor typically includes only the circuitry needed to fetch, decode, and execute instructions. The other necessary elements of a fully-functioning computer are memory and provisions to interface to input and output devices. These are not usually included as part of a microprocessor. A microcontroller, on the other hand, includes a microprocessor as well as some or all of the memory system and some peripherals and I/O interface ability. Microcontrollers typically offer lower performance (e.g. MIPS) than microprocessors, but the integration of memory and I/O peripherals makes them well suited for applications where highest possible CPU performance isn’t required, or where factors such as size, complexity, power consumption are key. This is just a ‘working definition’ but it highlights the main difference between these two types of devices: microcontrollers have memory and peripherals built-in, microprocessors generally do not.
A microcontroller has a Microprocessor, Input/Output, and memory on one chip. A Microprocessor is just that alone, requiring separate I/O and memory circuitry to be useful. A “System on a chip” is kind of halfway between, in that it has the microprocessor and I/O, and maybe a DSP in one package, but still uses external memory. Sometimes the I/O and processing s very specific, such as the chips may digital TV set-top-boxes are made from.
A microcontroller is an extension of a microprocessor. It has inputs and outputs designed to control other devices in a more direct fashion than a microprocessor. Microcontrollers many times have built-in ROM of some type so they can boot up on their own, making them a little more self-contained than a microprocessor. A microprocessor is optimized more for raw data processing power, a microcontroller is optimized more for control.