3
\$\begingroup\$

Whoopie - I've got a Raspberry Pi. When doing stuff it runs @ 1.2GHz and there are Uber overclockers out there who have boosted them to 1.5GHz (with phase change coolers). Today, the cheapest CPU on Amazon (Intel E7300 Core 2 Duo - £8.99) runs @ 2.66 GHz.

An Arduino Uno runs @ 16MHz and the top of the line Microchip micro controller (SAM 7) only goes to 300MHz.

It seems a micro processor runs ten times faster than a micro controller whilst being hugely more complex. Why? Is it that AMD and Intel are cleverer than everyone else, or is it something more fundamental? What's the difference between a microcontroller and a microprocessor? doesn't cover this particular aspect.

\$\endgroup\$
16
  • 1
    \$\begingroup\$ How many tons can you haul in a smart car? What is the top speed of a dump truck relative to a sports car? Almost everything with a power switch these days (no need to list exceptions) has a processor in it. Various sizes. AVRs (arduinos) at 16Mhz are pretty slow by some MCU standards you can get MCUs in the small hundreds of mhz where my first computer was only a few mhz. \$\endgroup\$
    – old_timer
    Commented Jan 22, 2018 at 22:28
  • \$\begingroup\$ The raspberry pi uses a processor/system designed to run an operating system, consumes considerably more power than a few (dozen) mhz mcu. Costs significantly more although you cant actually see that price difference between a branded arduino and a pi-zero for example. \$\endgroup\$
    – old_timer
    Commented Jan 22, 2018 at 22:29
  • 1
    \$\begingroup\$ an mcu usually carries much of its basic system baggage on chip, program storage, memory, primary peripherals and I/O. where a non-mcu even system on a chip doesnt normally carry all of that baggage, the set top box and cell phone processors like the pi uses, do carry quite a bit and are called system on a chip but there is still dram off chip (or package on package) and primary storage is off chip. in the case of the pi the network is off chip and some other small items. \$\endgroup\$
    – old_timer
    Commented Jan 22, 2018 at 22:31
  • 3
    \$\begingroup\$ Everything has it's own purpose. The back-loader manufacturer is not "cleverer" than a shovels manufacturer. It's just that you don't need a back-loader to clean the snow from your driveway. \$\endgroup\$
    – Eugene Sh.
    Commented Jan 22, 2018 at 22:32
  • \$\begingroup\$ clock speed is no longer if has ever been a primary thing to focus on, processors running bloated/bulky operating systems want more Hz than mcus that are not as bloated, but you can certainly find someone running an operating system on a processor running slower than an mcu I can find. \$\endgroup\$
    – old_timer
    Commented Jan 22, 2018 at 22:32

2 Answers 2

7
\$\begingroup\$

Paul, Imagine that you wanted to increase the top speed of your car. Ignoring problems of "how much are you towing, as well?" or "Is that uphill, downhill, or on a flat straight-away?"... you might say, "I need a more capable engine" as a 1st order guess about the next step.

But. You would realize you need more horsepower to overcome the wind resistance at any speed (which depending on Reynolds numbers may be related to \$v\$ or \$v^2\$ or some more complex function of velocity.) You will probably wind up with more torque in the process, too. And then you start working on how to reduce the wind resistance (laminar flows vs turbulent, etc.) And then on the new transmission system that can withstand higher torque and horsepower delivery to the axles and different gearing ratios. And then you have to deal with the traction -- the ability of the wheels to deliver what is needed to the ground. (Spinning wheels slipping over the ground don't really get you anywhere.)

In short, the whole thing is an incredible design process. Everything in the system has to be designed to apply the changes needed in order to achieve that higher speed.

It's like that here. It's a reasonable analogy.

The basic cpu core can run, let's say, at 3 GHz with a given FAB process and heat dissipation limitations. You can pile in 12 cores, let's say, into a single die. Each core can individually decode, let's say, up to 3 instructions per clock (up to, not always -- we are talking about x86 here.) So, technically in this proposed scenario, I can achieve \$3\cdot 12\cdot 3\:\text{GHz}\$ or rates of about \$144\times 10^9\:\frac{\text{Instr}}{\text{s}}\$. Pretty cool, right?

Yeah. But.

How do you feed that monster??

Well, you add in some L1 cache. Stick in right on the same die, in fact. (Can't afford off-chip delays.) But you need enough to matter. And if you put enough in, you have lots of details regarding N-way caching requirements and addressing and so on. Turns out, let's say, that your L1 cache can't do better than about 4 clocks per fetch by a core. Which means whenever a core needs something, it has to sit and wait!

Now, you can make this better by increasing your L1 cache by a large factor -- more cache is better because you are finding more needed data there. But this increases the cycle time for it and maybe now that means 5 clocks per fetch, instead of 4. Is the better rate of finding the data there worth the price paid for every fetch? (Usually not.)

So you add an L2 cache. It's bigger... but slower still. You also can no longer fit it on the original die. So you make a 2nd die and wire bond them over a backside bus. And now there are more delays. Not only is the memory slower, itself, but so are the delays involved in hopping signals across two dies via wire bonds.

So you add an L3 cache.....

And eventually you get to the external memory system.

Oh. But not really. Those external memory sticks aren't all that fast, either. And they need help. So you create a chipset that accepts reads and writes and puts them into FIFO queues going between the core CPUs and the external memory sticks. (With cache helping out, hopefully.)

But even that isn't good enough. It might make sense to allow a read to take place without having to wait for writes. So you add a "read around write" capability to your FIFOs.

And so it goes.

Eventually, after a HUGE EFFORT and incredible design resources plus caches, and branch prediction, and instruction conversion to RISC instructions, and adding in multiple functional units attached to some registration stations, and out of order execution followed by in-order retirement units, and cache, and....

You have a GHz system. It's got an incredible amount of crafted design, built in the most expensive FABs in the world, coupled with huge resources both within-chip as well as added surrounding chips and systems, all designed to support the feeding of that incredibly fast set of cpu cores.


Switch now to embedded.

Are you going to even "go there?" Who'd use your parts? Do they have the tools to use them in their lab? (Each piece sometimes costing $100k?) Do they have the skillsets?

It's pretty easy for most anyone to make circuit card that works okay at \$10\:\text{MHz}\$. The design rules aren't horribly hard and the tools you need are modest.


Of course, there is the obvious. Volume, too. This helps pay for all that work required. But frankly, this is a weaker argument because there are a great many of the simple embedded chips made, too. Perhaps "profit" might be a better measure here.

But it's more about selling retail. Regular consumers buy these fast computers one at a time and cannot get "bulk pricing." They pay enough to pay for large distributor profits, smaller distributor profits, retail store profits, etc. That all funds a lot of support infrastructure. And it also pays for those tools and the skillsets to use them, too.

By comparison, a hobbyist might pay $1 for an embedded Microchip MCU, stick it on a protoboard, programming it with free compiler tools, using free libraries.

I think we are incredibly lucky with what we have available. And besides, I don't want to even THINK about what I'd need to spend here (nor the extra training I'd require) to handle GHz embedded processors.


Bottom line? How would you plan to use a 3 GHz MCU, even if you had one? Could you afford the price required to provide all of the support needed just to feed it? Flash is very slow compared to such an MCU. So you'd need a lot of internal support hardware in there (cache, prediction, out of order execution, ......) Would you pay for all that die space? Really? Just to get to blink an LED using one?

How exactly would you use something that fast on a protoboard??

You really need to think about this. Whatever it is, it has to work both for the manufacturer and also for you. And there has to be some delivered value to the end-user that the end-user will pay enough for to make it work out for both parties.

Right now, while that balancing act is always in motion, it has found a reasonable equilibrium point in the market. And I'm pretty impressed at just how much we are being given for just a few pennies.

\$\endgroup\$
2
  • \$\begingroup\$ I'm more than pretty impressed. I'm gobsmacked. Right now next to me is a breadboard with a PIC16 (32MHz) in it and 128k RAM I'm not even using but I've just sort of left in there, which were dream machine specs when I was starting out as a teenager in the 1980s. Scratch that, blistering speed like that wasn't even a dream. And they're so cheap that damaging one means just grabbing another one and shoving it in the board. \$\endgroup\$
    – Ian Bland
    Commented Jan 22, 2018 at 23:55
  • \$\begingroup\$ This should be the definitive answer to all the questions regarding why we're not over engineering every product - with touch displays and GHz processors, when raspberry Pis are so cheap, and microcontrollers are soooo slooooow \$\endgroup\$
    – MrGerber
    Commented Jan 23, 2018 at 8:05
3
\$\begingroup\$

There's two important differences between a microprocessor and a microcontroller:

  1. Cost per unit, when bought in bulk.
  2. Power consumption. The slower the clock, the less power consumed.

Low-end microcontrollers may only cost a few cents each, to the extent that they are often used to control cheap toys that only cost a couple of dollars retail.

Microcontrollers can run for hours on batteries. The same cheap toy may run on two AA cells. A laptop requires a big and expensive LiIon battery pack.

\$\endgroup\$
3
  • \$\begingroup\$ @TonyM Nobody but the manufacturers cares about that. You could add physical size though. \$\endgroup\$ Commented Jan 22, 2018 at 23:13
  • \$\begingroup\$ @immibis True. The little 8-pin microcontrollers are tiny. \$\endgroup\$
    – Simon B
    Commented Jan 22, 2018 at 23:15
  • \$\begingroup\$ I disagree. BOM cost directly impacts sales price, so price is definitely an issue, also for the end customer. The same goes for power consumption. That couples with power consumption as well - more power is often more complex, so that could be price driving too. Also, it is less likely that the market would accept a grossly power hungry embedded device just because it has GHz processors (With one impressive exception, Cellphones) \$\endgroup\$
    – MrGerber
    Commented Jan 23, 2018 at 8:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.