What's the difference between a microcontroller and a microprocessor?
-
3\$\begingroup\$ Also see this article by Atmel. \$\endgroup\$– Microsoft Linux TMCommented Jan 2, 2015 at 20:36
-
\$\begingroup\$ mostly price :-) \$\endgroup\$– HilmarCommented Feb 9, 2018 at 14:02
-
1\$\begingroup\$ @Hilmar, re "mostly price" - wrong. \$\endgroup\$– cp.engrCommented May 16, 2018 at 19:41
12 Answers
A microprocessor generally does not have RAM, ROM and IO pins. It usually uses its pins as a bus to interface to peripherals such as RAM, ROM, Serial ports, Digital and Analog IO. It is expandable at the board level due to this.
A microcontroller is 'all in one', the processor, ram, IO all on the one chip, as such you cannot (say) increase the amount of RAM available or the number of IO ports. The controlling bus is internal and not available to the board designer.
This means that a microprocessor is generally capable of being built into bigger general purpose applications than a microcontroller. The microcontroller is usually used for more dedicated applications.
All of these are very general statements. There are chips available that blur the boundaries.
-
5\$\begingroup\$ Many microcontrollers make a memory bus available for external code and data; those pins may or may not usable for other purposes if external memory is not used. To my mind, the defining distinction is whether a device would typically() be capable of running at least somewhat usefully without an external memory bus. () The 8051 is certainly capable, so it's clearly "microcontroller". An 8031 is the same chip as an 8051, but with the ROM contents unspecified. The lack of useful ROM would make it a microprocessor, but since it's the same chip as the 8051, it could be called a microcontroller. \$\endgroup\$– supercatCommented Mar 2, 2011 at 17:31
-
2\$\begingroup\$ "The controlling bus is internal and not available to the board designer." That's not necessarily true. There exist microcontrollers with an external address/databus to allow for extra memory. \$\endgroup\$– stevenvhCommented Jun 8, 2011 at 16:07
-
\$\begingroup\$ So, could we say that a microcontroller is essentially a computer while a microprocessor is merely a single-chip implementation of a CPU ? \$\endgroup\$ Commented Nov 19, 2018 at 19:37
-
\$\begingroup\$ @doubleOrt: You could put it that way, but the boundaries are blurred. These days, there are quite a few chips that include volatile data memory (SRAM), but no nonvolatile code memory (Flash). They are often also called MPU (microprocessor). So the distinction seems to be mainly associated with on-chip Flash these days. NXP markets something they call a "crossover" processor with RAM, but no Flash. This has to do with the rising difficulty of integrating Flash in a chip with ever smaller transistors. The current limit seems to be around 28 nm. \$\endgroup\$– sh-Commented Apr 11, 2019 at 14:24
As was mentioned microcontrollers are essentially systems on a chip. Except for some specialized peripherals everything is in one package. Interface to external peripherals is almost always done using serial connections. This keeps the package sizes small (less pins) and the PCB size small (less pins to connect between packages).
At the last Boston Barcamp (MIT 2009) I did an "Intro to Microcontrollers" talk. A copy of the handout is at
http://www.lucianifamily.org/not-quite-ready/doc/intro-to-uC.pdf
Microcontrollers:
- are typically 8-bit, but may be 4-, 16-, or 32-bit
- run at speeds less than 200 MHz
- use very little power
- may provide enough current to operate an LED
- are useful to interface with sensors and motors
- are readily replaced, being inexpensive ($0.10 to $10)
- are really constrained for RAM and persistent storage (flash space)
- are really nice for electronics hobbyists
Microprocessors:
- are often at least 16-bit, and typically 32-bit or 64-bit, though 8-bit still has a big market share
- many will be able to do floating point math in hardware
- run at speeds measured in hundreds of MHz
- are designed to be the brains of a system (and need a whole system to support them)
- need special hardware to interface with sensors, motors, LEDs, etc.
- are expensive (think $50 - $250 for 32 or 64-bit)
- are designed for external RAM and persistent storage (hard drives)
- are not as easily worked with by a hobbyist
I find it interesting that the LEGO Mindstorms NXT set has a microprocessor [32-bit AT91SAM7S256 (ARM7TDMI) main microprocessor @ 48 MHz (256 KB flash memory, 64 KB RAM)] for doing the thinking, and a microcontroller [8-bit ATmega48 microcontroller @ 4 MHz (4 KB flash memory, 512 Bytes RAM)] for interfacing with the sensors and motors. See technical specifications on Wikipedia.
-
2\$\begingroup\$ 8-bit is the dominant microprocessor, but it is far from the most common, I thought I read earlier this year that they no longer make up more than 50% of market share. \$\endgroup\$– KortukCommented Dec 18, 2009 at 1:39
-
3\$\begingroup\$ Actually, I would like to say that I do not agree with a large amount of the microcontrollers list. Most of the cheap ones they put in systems do not cost a dollar, many, dependent on brand, cannot provide the current to power an LED. There are also a very large group that break 20MHz, but in general do meet that spec. i think they are also great for hobyist. \$\endgroup\$– KortukCommented Dec 18, 2009 at 2:34
-
\$\begingroup\$ I've incorporated some revisions and made my answer a community wiki -- help me make it right! \$\endgroup\$ Commented Dec 18, 2009 at 15:49
-
4\$\begingroup\$ AT91SAM7S256 is definitely a microcontroller nor a microprocessor. \$\endgroup\$– jpcCommented May 1, 2010 at 11:22
-
5\$\begingroup\$ I started to edit this, posting, but I don't think it's really redeemable. The accepted answer to this question has the essence of the difference, which is basically 'integrated memory' or 'no integrated memory'. I'm afraid this lot is largely a list of generalisations, a number of which are just plain wrong. \$\endgroup\$– user1844Commented Nov 23, 2010 at 18:32
This distinction is one that is much harder to make these days, since a whole spectrum of devices has arisen between the extremes, but if there's one identifier that seems to work, it's to look at the pin-out, and look at what the designers did with the pins. Are they mostly individual I/O? Or do buses dominate?
In my view, a microcontroller has traditionally been something that works as a 1-chip solution; put one on a PCB with a few unavoidable discretes, and some connectors, write a small amount of software, and you have a system. The microcontroller contains all the memory, volatile and not, that the system needs, the price paid for this convenience being that there wouldn't be very much of either at hand. Most of the pins are dedicated to I/O functions.
Whereas, at the other extreme, the microprocessor is the sort of beast to offload as much as possible to support chips, in order to dedicate silicon to maximizing the throughput of the CPU core. Most of the pins on this kind of device are address and data lines, necessary in order to connect to the memory and I/O devices that the core lacks.
It's still possible to call some things microprocessors, and other things microcontrollers, when the designers clearly adhered to one philosophy or the other. An Intel Core i7 is clearly a processor, PICs and AVRs are clearly controllers. At this point in time, however, with the amount of logic that can be put in a single chip, you can easily embed an entire 1990 microprocessor system into a single chip. What do you call a 400MHz PPC604 with an interrupt controller, an SDRAM controller, ethernet support, and a slew of other peripherals, all on one chip?
-
1\$\begingroup\$ > What do you call a 400MHz PPC604 with an interrupt controller, an SDRAM controller, ethernet support, and a slew of other peripherals, all on one chip? => I'dd call it a "fat microprocessor". No ROM and RAM, so definitely not a microcontroller. \$\endgroup\$ Commented Aug 27, 2011 at 8:16
-
2\$\begingroup\$ @Wouter van Ooijen -- I guess I should have mentioned, I'd call that a "system on a chip". \$\endgroup\$– JustJeffCommented Aug 27, 2011 at 12:01
-
\$\begingroup\$ µProcessors borrow integration techniques to reduce size, integration costs, and power usage. µControllers gain processing power due to silicon cost efficiency, and demand for smarter gadgets. If we differentiate based on intent, instead of architecture or computing capability, then the answer stands the test of time. In the 50 years since the dawn of the "micro" computer age, we now have light bulbs with more processing power and RAM than the mainframes that ran the global banking system. Yet a Philips Hue would not be used for banking. \$\endgroup\$– ColinCommented Mar 18, 2021 at 10:27
I would suggest that a microcontroller is a device that contains enough internal memory and circuitry that, at least in some variants, it could perform some useful function without external memory. By such a definition, the 8051 would have enough circuitry to be useful by itself and the 8031 would not; the 8031, however, is simply an 8051 in which the contents of the internal ROM are unspecified (while it's entirely possible that some "ROMless" 8031 chips and variants leave the ROM space off the die, I would expect there are some others which, for consistency of die layout with versions which include ROM, include a useless blank ROM array).
Mostly marketing.
There's some other weird terms; Analog Devices has (or had) something they called "microconverters" which were like ADC/DACs with a microprocessor built in. TI is now calling some of their DSPs (the C2000 series) Digital Signal Controllers.
Otherwise what JohnC said.
-
\$\begingroup\$ Where can I find more about these "microconverters"? The closest thing I've found is the TAS3202. \$\endgroup\$– endolithCommented Dec 18, 2009 at 2:59
-
\$\begingroup\$ they may have stopped calling them that. analog.com/en/analog-microcontrollers/analog-microcontrollers/… I've never been impressed much with ADI's microprocessors, their analog stuff is good, and their DSPs are supposed to be good but I don't have experience w/ them. \$\endgroup\$– Jason SCommented Dec 18, 2009 at 4:45
-
\$\begingroup\$ Maximum sampling rate 8 kHz, so not useful for audio. :/ \$\endgroup\$– endolithCommented Dec 19, 2009 at 22:16
-
3\$\begingroup\$ I don't agree that it is Mostly marketing. I agree with JohnC answer. \$\endgroup\$ Commented Jul 10, 2010 at 13:23
The line is somewhat blurry but generally it goes like this:
microprocessors contain the processor core (fetch/decode unit, ALU, registers etc) and maybe a couple of more basic blocks, but usually not much more.
microcontrollers add RAM (SRAM), usually some ROM (can be mask rom or Flash/EEPROM) for code storage (but can also be ROMless), and a set of basic peripherals (SPI/I2C, UART, GPIOs, maybe even USB or Ethernet and so on). Sometimes this gets called System-on-Chip (SoC), or sometimes SoC is something even more integrated. Some Japanese companies also love the term "microcomputer".
However, as I mentioned, the line gets blurry. For example, recent Intel/AMD processors add a memory controller on the chip (previously it was in the chipset).
BTW, I would actually call 8086 a microprocessor (Intel's microcontrollers include for example 8051 or 80186).
-
\$\begingroup\$ The line is not blurry. Microprocessors do not have internal memory. Microcontrollers do. \$\endgroup\$ Commented Sep 25, 2022 at 21:33
Just to add all above excellently written answers, Analogy : Microprocessor is a Brain. while Microcontroller is Entire Body.
Brain is capable of Executing all the instructions but We need to attach Eyes,Hands (i.e. Peripherals) externally.
While Body has Brain and Other Peripherals i.e. Microcontroller :)
-
\$\begingroup\$ Sorry for bumping this 8 years later, but I find this analogy falling a bit short. A microcontroller too is oftentimes used as a Brain only, for example when one has to connect external sensors/actuators to it. Similar to an actual processor. The way the sensors are connected may differ (say PCIe vs I2C), but even that line gets blurred by modern SoCs, still often called microprocessors. A microcontroller is IMO quite rarely the Entire Body. The major differentiator is still the processor core complexity/need of external RAM. Yet I rather like the analogy - the software becomes the Soul :) \$\endgroup\$ Commented Jun 3, 2020 at 17:35
Difference between microcontroller and microprocessor
Microprocessor = cpu; Microcontroller = cpu + peripherals + memory Peripherals = ports + clock + timers + uarts + adc converters +lcd drivers + dac + other stuff; Memory = eeprom + sram + eprom + flash
In Microprocessor more op-codes, few bit handling instructions. But in Microcontroller: fewer op- codes, more bit handling Instructions.
A microprocessor may not also be programmed to handle real-time tasks whereas a microcontroller such as in devices that need to control temperature of water or perhaps measure the temperature of a room require real time monitoring and therefore with its inbuilt set of instructions the microcontroller works on its own.
-
4\$\begingroup\$ These informations are a little bit random and not so well formulated, for a question with so many answers. Take an example: who says that a microcontroller has to have ADC, DAC and LCD drivers? Many have them, but it's not a rule. The same for bit handling and real time operation. \$\endgroup\$ Commented Feb 16, 2012 at 7:13
-
\$\begingroup\$ @neelamSingh, Welcome to the site, your post did not format well and seems to cutoff partway through, it could use some work! \$\endgroup\$– KortukCommented Feb 16, 2012 at 7:14
-
3\$\begingroup\$ Your third point is not valid. Real-time ability is determined by the OS, not the type of processor. There's no reason why a RTOS wouldn't run on a microprocessor. And microcontrollers don't have necessarily more bit handling instructions, either. \$\endgroup\$– stevenvhCommented Mar 21, 2012 at 16:14
Microprocessor is a simple central processing unit (CPU) on a single chip (remember the word ‘Single Chip’). It includes Arithmetic logic unit (ALU), control unit (CU), registers, instruction decoders, bus control circuit etc. but everything should be on a single chip.
Microcontroller: A microcoontroller is the association of microprocessor and the peripheral I/O devices, support circuitry and memory (both data and program). It is not necessary to be on a single chip (remember this point, not in a single chip).
- Microprocessor is one component of the microcomputer.
- Microcontroller is a complete computer similar to any other computer.
-
\$\begingroup\$ Sorry, Both are single chip \$\endgroup\$ Commented Sep 25, 2022 at 21:35
Long answer short:
MicroProcessor - Does the 'thinking', is basically is the chip itself which handles math.
Microcontroller - A system with a microprocessor included, readily capable of interfacing with electronic components for developing embedded system. (Think arduino, PI, PSOC4 etc.
-
4\$\begingroup\$ This is one of the worst answers to this question. Calling a microprocessor "a chip that does math" is like calling an automobile "a device with seats". Both are "readily capable of interfacing" or they would have no practical value. \$\endgroup\$ Commented Nov 15, 2019 at 20:15