What The Tech

Micro-What?!

Mike Hansell

Issue 11, May 2018

There is often much confusion about terminology. So precisely what makes something a “microprocessor”, a “microcontroller”, or a “microcomputer”?.

Whether you’re using a Raspberry Pi, an Arduino, or building a gaming machine, you have probably dealt with a micro-something. The fact is, there’s not much technology hitting the market these days that doesn’t have some type of microprocessor, or better, sitting inside doing the thinking. But the specific terminology is often misunderstood, and even here at DIYODE, we’ve been guilty of mixing them up unintentionally too, despite knowing the differences! So we thought we’d explain it all.

Perhaps the best analogy of how these three concepts are linked, is to refer to the infamous Matryoshka Dolls, also known as “Russian Nesting Dolls”. Each one fits neatly into the next size up, but from the outside it appears as a whole. The same basic idea applies, as microprocessors are used in microcontrollers, microcomputers (and larger systems too). Of course, one caveat to this analogy is that the Matryoshka dolls look the same when there’s nothing inside. A microcomputer without a microprocessor of some description may still look the part, but will be, for all intents and purposes, useless.

The Microprocessor

THE FUNDAMENTAL BRAIN

A microprocessor is at the heart of most modern computers. This includes everything from your laptop to your mobile phone.

It’s effectively a massive array of transistors, which are used to perform logic operations and calculations from very specific instructions. These instructions form the “instruction set” of the microprocessor. When we write a sketch for an Arduino, or some Python code for a Raspberry PI, or maybe we write a program for a PC, that human readable code we’ve written eventually gets converted into instructions that the microprocessor can read and execute.

How does a microprocessor work?

Microprocessors access a program written in their own machine code. This is just 0s and 1s but arranged in such a way that the computer can decode these into its native machine code instructions. Different manufacturers may implement vastly different instruction sets. Each instruction has a mnemonic (human readable name) like MOV B,C which means move the contents of register B to register C. That’s a lot easier to read and understand than 0x41 or in binary 01000001.

It should be noted that machine code is vastly different to the lowest level human readable computer code which is known as “assembler language”. An assembler is a program that converts the human readable mnemonics (MOV B,C) to machine readable machine code, that is the 0s and 1s that make digital electronics tick. These days we use much higher level programming languages (C, Python, BASIC, Java etc) that convert the human readable source code into executable code.

That’s all very well and good but how does the computer read the program? A digital computer (microprocessor, microcontroller, microcomputer or the biggest mainframe) all have this issue. The process works like reading a book, where we start at the first page and scan left to right (in the Western world) and top to bottom. We recognise the words and follow along. We could make a decision that the story is boring and skip forward a few pages or even refer to another book to look up a reference in the first.

A computer has an address bus that it uses to find the various words (instructions) in its book (the program it’s running). The address bus and the data bus are a number of digital signals working in parallel. With a 16-bit address bus we could look at a total of 65,536 (64k) separate memory addresses. Once the address is determined the computer can then read the value or write a new value, found there over its data bus. This value may be an instruction (or part thereof) or data. Note that some microprocessors use the same hardware pins for data and address buses, but at different times.

There is one last bus, the control bus. This allows the microprocessor to indicate whether it is reading data or writing data, and can be used to read the status of external components.

The Microcontroller

A MICROPROCESSOR AND MORE

A microcontroller is essentially a microprocessor, plus memory to store a program, temporary workspace and a number of I/O pins so that it can interact with the world outside of the chip to read sensors or control external devices, and more, packed into one integrated circuit.

It’s important to remember that a microcontroller can take many forms, and could be physically identical to the most fundamental integrated circuit. The ATtiny5 is a tiny IC with just 6 pins but it packs ROM to permanently store a program, RAM for temporary storage or working room, a timer, 2 PWM pins, analog to digital converters and 4 programmable I/O pins. These functions are shared amongst the pins.

These devices unless accompanied by other circuitry have little or no facility to interact with a human user; however, as they cost as little as $1 they find their way into many applications where a bigger device is not suitable. How about cufflinks? These could easily find their way into control circuits for LCD panels or the like. At the DIYODE office we have a programmer for the ATtiny85. It is built on a small PCB with a USB port. It looks like a naked USB flash drive. It has an ATtiny84 to assist in the programming process. As small as that is (10mm x 4mm), it is huge compared to the ATtiny5.

If we look at the Atmel ATmega328P, which powers the Arduino Uno, it’s still one IC but in a 28-pin package. It packs a lot of punch into that package. It can be used in a standalone fashion to provide a more powerful (and cheaper) solution that it’s tiny brethren.

The Microcomputer

THE NEXT LEVEL

As you can likely see, there are various roles for microprocessors and there are many levels of microcomputers.

Microcomputers take things one step further. A microcomputer may be a motherboard with many daughter boards, or can be a single board computer. A big difference from a microcontroller is that a microcomputer may have fewer I/O pins that are so useful for interacting with the real world. Microcomputers provide everything you need, to perform like a large personal computer, but in a tiny package. They have a microprocessor, memory, and often support for peripherals (USB keyboards, etc), displays (HDMI output), and more.

Microcomputers will run an operating system (perhaps a “lite” version), often similar to a large computer. This category would certainly include the Raspberry Pi. The Pi has a much faster CPU than an Arduino, with 512MB of RAM, multiple USB ports, composite video and HDMI, Ethernet, WiFi and Bluetooth. That’s quite an array of useful hardware in a small and relatively cheap package. This allows the Pi to be used in many diverse projects like a home theatre system or a gaming computer.

Perhaps the next level of performance is a device known as a NUC, or “next unit of computing”. These devices are typically around 10cm x 10cm in size. They have fully fledged Windows-compatible hardware, and they can generally run many flavours of Linux also.

Your home PC or Mac is the next level of microcomputer. It will have a lot more storage than a NUC and potentially much stronger performance,

Bigger microcomputers may be used as file servers supporting, possibly, hundreds of users. These can have multiple CPUs (not just multiple cores), vast amounts of RAM, and lots of fixed storage.

Finally, six of the fastest supercomputers in the world are made of clusters (many smaller computers working together) of quite high-end microcomputers.

Microprocessors, microcontrollers and microcomputers have certainly changed the world that we live in and who knows what the future will bring? Certainly, developments at every level are announced regularly. While some get very small, others provide huge computing power. Personally, I enjoy working with all of these and look forward to new developments.