Electronic – Arduino vs Microprocessor vs Microcontroller

arduinomicrocontrollermicroprocessorterminology

What is the difference between an Arduino, a microprocessor, and a microcontroller? I'm trying to determine what is best to operate a cheap resistive touch screen.

Best Answer

A microprocessor:

is typically found in a desktop PC or laptop and contains a CPU and an external memory interface plus various I/O buses to connect to the outside world such as SPI, I2C, UART, USB, LCD and others. A microprocessors will also have an external crystal to provide a clock.

Most microprocessors have no read-only memory on the chip; instead there is an external chip on the motherboard where the initial boot code is located. On Intel-based PC's, this is called the Basic Input/Output System (BIOS) and also contains I/O routines in addition to the initial boot code. The boot code starts by doing a Power-On Self Test (POST) and then looks to see where to load the next stage of the boot code -- from a hard drive, CD (or in olden days) a floppy disk. This second level boot then loads the operating system. (There may even be three levels of boot code in some systems.)

Some microprocessors (usually ones targeted for smart phones and tablets, which have limited boot options) have a small amount of read-only memory that contains the initial boot code.

I refer to the boot code as read-only; actually on some systems, it can be updated. However this is fairly risky; if something goes wrong the system may no longer boot.

Unlike microcontrollers, which execute their programs out of read-only memory, after booting up microprocessors load their programs into external RAM and execute it from there.

A microcontroller:

on the other hand is a standalone single-chip IC that contains a CPU, read-only memory to store the program, RAM to store variables used in the execution of the program, and various I/O buses to connect to the outside world such as SPI, I2C, UART and others. By itself, it cannot execute any programs without being programmed via an external interface to a PC. A microcontroller may also need an external crystal to provide a clock, however some have an internal clock.

Some microcontrollers (such as Microchip's PIC32) have two sections of flash memory; one to hold initialization (boot) code, and another to store the application. This makes it easier to update the application code in-place.

For your purpose, you would want to use a microcontroller, not a microprocessor. To use a microcontroller, you would either have to design your own board, or buy some sort of development board.

An Arduino:

is such a board, and contains a microcontroller, typical an 8-bit AVR such as the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560, plus power supplies, crystal, and female headers to interface with various peripheral boards.

These peripheral boards are called shields, and are designed to stack on top of each other (there are male pins on the bottom of the boards to connect to the Arduino itself or another shield, and female headers on the top to accept the male pins of a shield stacked on top of it).

Example shields are motor control boards, general I/O boards, relay boards, Ethernet boards, and LCD's, typically with a touch-screen. However I don't know of any resistive touch screens that would be used just for detection (without an LCD).

In addition to the hardware described above, Arduino also come with a cross-platform Integrated Development Environment (IDE) written in Java. It was designed to introduce programming to artists and other beginners, much as the BASIC language did 50 years ago. A program for Arduino is called a sketch.

Arduino programs are written in C or C++, however many of the details are hidden from the user: only two functions (called by the system) need to be defined to make a program that continually loops (which is typically for embedded programs)

setup(): a function run once at startup that performs initialization
loop(): a function called repeatedly until the board powers off

The IDE comes with a software library called "Wiring" which can be used for common input/output operations.