99 MHz Frequency Counter

This dual-channel frequency counter work based on 920 kHz microcontroller-based frequency counter. First channel has 99 MHz upper limit of frequency, and the second channel has 920 kHz upper limit of frequency. For the beginner, you can read the basic operation of this frequency counter and learn our old project.
We have extended the upper limit of maximum frequency that can be counted by adding 74HC393 divider. This CMOS IC is a dual 4-bit binary ripple counter. The operation of each half of this device is the same as the 393 series except no external connection are required.
To maintenance of the accuracy of counting, we cut the upper limit of frequency range feed to timer 0 of AT89S52 microcontroller that can be counted at 900 kHz. By using the all the flip-flop of 74HC393, we can build 8-bit counter. This must be a counter with modulus of 256. But 74HC393 have a maximum clock input frequency of 99 MHz. So, to maximize the accuracy, we only operate this device as 3-bit and 4-bit counter. Counter 0 was operated as 3-bit counter and counter 1 operated as 4-bit counter.
The range of incoming frequency was divided by three.
  1. Low Frequency (LF): 0 Hz ~ 899,999 Hz. This incoming frequency can feed through T0 pin of microcontroller. To display the value of incoming frequency is the same of our old project.
  2. Medium Frequency (MF): 900,000 Hz ~ 7,199,999 Hz. This incoming frequency must feed to T0 pin of microcontroller via a 3-bit counter/divider. To display the value of incoming frequency, the number of pulse that was counted by timer 0 must be multiplied by eight. To maintenance the accuracy, we cut the least significant digit of display. The display format is X,XXX.XX kHz.
  3. High Frequency (HF): 7,200,000 Hz ~ 99 MHz. This incoming frequency must feed to T0 pin of microcontroller via a 3-bit and 4-bit counter/divider. To display the value of incoming frequency, the number of pulse that was counted by timer 0 must be multiplied by 128. To maintenance the accuracy, we cut the two least significant digits of display. The display format is XX,XXX.X kHz. To display the frequency between 99 MHz and 100 MHz is still on experiment.
It’s not convenient for user to select a switch to match between the incoming frequency and those three ranges above.
So, we make an auto-select subroutine program to automatic select the best range that will be used. This subroutine will drive the some open-collector configurations of counter output that builds five switches. So we only connect the probe to feed the incoming frequency, wait 1 second, and read the display.

Open-Collector as Selector

We use the open-collector configuration to make five digital switches like figure below. The range of incoming pulse is 1 Hz to 99 MHz. By adding the 74HC393 frequency divider, we get the output that its frequency range is 1 Hz to 900 kHz. This is done because the frequency range for incoming pulse that can feed to timer 0 of microcontroller is 920 kHz.
We have three states. Each state has its frequency range.
1. High Frequency State.
This state sets HFPin, so the incoming pulse (f) can feed to CP1 (Clock Pulse of counter 1). This state also sets HFPin1, so the output frequency of counter 0 feed to CP0 (Clock Pulse of counter 0). The incoming pulse was isolated to CP0 by resetting MFPin. Next the output frequency of counter 0 was emitted from Q2-0 to timer 0. To do this, we set HMFPin and reset LFPin.
2. Medium Frequency State.
This state resets HFPin and sets MFPin, so incoming pulse feed to CP0 . The 3-bit counter/divider works and emits the pulse at Q2-0.
3. Low Frequency State.
This state sets the LFPin and resets the others. The incoming pulse feed through to timer 0.
The schematic diagram is the same as the schematic diagram of dual channel 920 kHz Frequency Counter project, but before counter 0 pin (P3.4), we must add this divider.

Auto-select Subroutine Program
When counting the incoming pulse (by timer 0) was running, counter/divider that was activated must proper with the incoming frequency. To do this, the Auto-select Subroutine Program will be run before the counting process. This subroutine will determine the counter/divider that must be activated.
This subroutine works as follow.
1. Check if incoming pulse is high frequency.
  • Activate HF state: set HFPin, HFPin1, HMFPin; and reset MFPin, LFPin (See table bellow). This will enable output of the 3-bit and 4-bit counter/divider.
  • Count incoming pulse during 20 ms intervals.
  • If result is grater than 56,250, the incoming pulse must be high frequency, go to step 4.
2. Check if incoming pulse is medium frequency.
  • Activate MF state: set MFPin, HMFPin; and reset HFPin, HFPin1, LFPin. This will enable output of the 3-bit counter/divider but disable the other.
  • Count incoming pulse during 20 ms intervals.
  • If result is grater than 112,500, the incoming pulse must be medium frequency. So, and go to step 4.
3. Activate LF state: set LFPin and reset the others. This will disable all output of all counter/divider.
4. Count incoming pulse during 1 s intervals.

aaaaaHFPin HFPin1 MFPin HMFPin LFPin
aaaaaP0.1 aa P0.2 aaP0.3 aa P0.4 aaP0.5
HF aaaaa1 aaaaa 1 aaaaa0 aaaaa1 aaaaa0
MF aaaaa0 aaaaa 0 aaaaa1 aaaaa1 aaaaa0
LF aaaaaa0 aaaaa0 aaaaa0 aaaaa0 aaaaa1

To do four step above we make some subroutine: PreDelay20ms to prepare timer 2 for delay 20 ms, PreCount20msT0 to count the incoming pulse of timer 0 during 20 ms intervals, CheckIfHF to check if incoming pulse is high frequency, CheckIfMF to check if incoming pulse is medium frequency, CountF to count incoming frequency during 1 s interval, CountHFFrequency to divide the incoming high frequency by 128 and prepare it for display, CountMFFrequency to divide the incoming medium frequency by eight and prepare it for display.
The listing program can be downloaded here.

Dual Channel 920 kHz Frequency Counter

This is the listing program of Dual Channel 920 kHz Frequency Counter. The basic operation of this dual channel 920 kHz AT89S52-based frequency counter can be found here.

Note that this program involve some subroutines as follow:
  1. CmdWrtStart,CmdWrt, DataWrt
    This subroutine will display a character on LCD and others facilities to display some properties like initiate LCD, clear screen, go to home, and write some characters.
  2. HexToBcd
    This subroutine will convert 20-bits hexadesimal number at tripple of register R1 R2 R3 to 8-digits BCD number at quadruple of register R4 R5 R6 R7. The BCD data can be displayed on LCD. May be only some lowest data that required to display.
  3. DisplayDigit
    A subroutine to display 6-digits is enough for displaying digital data accuratly.DisplayDigitThis subroutine will display 6-digits on LCD. Zero will be replaced by space until we find non-zero number. Input data must be BCD format and located at triplle of register R5 R6 R7.
This is the schematic diagram of the frequency counter. The buffer should be TTL/CMOS with Schmitt trigger like 74LS14 or 74LS19 or its family. The basic operation of this dual channel 920 kHz AT89S52-based frequency counter can be found here.

This application can be extended to build frequency meter that can measure up to 99 MHz of frequency.

Microcontroller-based 2 Channel Frequency-Meter

Our Goal
This project is to make frequency counter/frequency meter that can measure the frequency of incoming analog signal. This project has two input leads. Up to now, this application can measure the frequency of both leads from 0 Hz to 920 kHz with six digit display. We have calibrated this project with fabrication-made frequency counter. This project has only 0.01 % error. So if we measure a frequency above 100kHz, the error may be happen below 20 Hz. And if we measure the a frequency between 10kHz and 100kHz, the last digit may be toggle between two values.
By adding prescaler, we hope the range of frequency that can be measured can be increase to 100 MHz. And by some additional methods, we also hope the accuracy of measurements of lower frequency can be greatly increased so we can display the frequency from 1.0 Hz to 100 MHz. To do this, we will need to perform some mathematical operations. We rely on an AT89S52 microcontroller (8051 family) to perform them in this project.
We try to use minimal component so the price of this project not so expensive. The main component is an AT89S52 microcontroller and a LCD display. The only one advantage of AT89S52 than AT89S51  that we use is there is one additional 16-bit timer called timer 2. 

Target Specifications:
Channel Input: 2
Frequency range: 1.0Hz ~ 35MHz (auto-scale)
Display: 6-Digit LCD
Gate time: 0.1s ~ 1s
Error: less than 0.01%
Input sensitivity: minimum 0.1V
Power consumption: less than 1W
DC Power Supply Input: 4.5V ~ 5.5V

We make open discussion forum, so all of you can contribute to this forum to share our ability.

Overview
A processor is one of main components of frequency counter. It must has ability to count and then perform arithmetic operations. To reduce price of the frequency counter become more competitive, then this research is used a microcontroller as substitute for a processor. This paper presents the design of frequency counter based on AT89S52 that it has three independent timers.
This Frequency Counter, based on counter program, can measure up to 920 kHz of incoming frequency. This will be enough to trace and debug most of circuits, to adjust 555 timers frequency and perform all kind of frequency measurements in Digital circuits. This device has 0.01% error, so it can display up to 5 digits at frequency above 100 kHz. The upper limit of frequency can be extended up to 256 MHz by adding a frequency divider. The analysis of the accuracy of measuring presented in this article can support to determine the number of digit to display.
To understand the basic of operation of this project, recall the simplest definition of frequency: the number of occurrences within a given time period. What we are trying to do is to count the number of electric pulses during a time of one second. To do this, we need a counter. The counters count the high-to-low transition of incoming pulses. A timer stop that after 1000 milliseconds.

Counter Methods
This frequency counter work by using a counter which accumulates the number of events occurring within a specific period of time. After a preset period, that is 1 second, the value in the counter is transferred to a memory and the counter is reset to zero. After that, microcontroller runs a subroutine to prepare to display and a subroutine to display some character that representing a value of incoming frequency.
If the event being measured repeats itself with sufficient stability and the frequency is considerably lower than that of the clock oscillator being used, the resolution of the measurement can be greatly improved by measuring the time required for an entire number of cycles, rather than counting the number of entire cycles observed for a pre-set duration (often referred to as the reciprocal technique). The second method can be used for measure the incoming frequency below 1kHz effectively. The accuracy for this can be improved so I can display the one tenth of frequency.

Using T0 and T1 of AT89S52 as Counter
In this application we use 2 timers that operate as mode 1 counter. They are Counter 0 and Counter 1, and can be independently configured to operate in a variety of modes as a an event counter. When operating as a counter, the counter runs for a programmed length of time, then issues an interrupt request. They counts negative transitions on an external pin. After a preset number of counts, the counter issues an interrupt request.
In this application we use 2 timers that operate as mode 1 counter. They are Counter 0 and Counter 1, and can be independently configured to operate in a variety of modes as an event counter. The timer register counts the negative transitions on the Tx external input pin. The external input is sampled every peripheral cycle. When
the sample is high in one cycle and low in the next one, the counter is incremented.
Since it takes 2 cycles (12 peripheral clock periods) to recognize a negative transition, the maximum count rate is FPER/12, i.e. FOSC/24 in standard mode or FOSC/ 12 in X2 mode. Because we use standard mode at 24 MHz clock operation, theoretically the maximum count rate is 1 MHz. In fact, the count rate can not exceed 920 kHz.

Two Input Channels
We use two input channels. The first input directly fed to the T0 (P3.4) pin of the AT89S52, and the other fed to T1 (P3.5). In order to make any kind of measurements on some circuits, the ground of the measurement device and the ground of the all circuits being tested must be connected together. The incoming signal must be match to TTL level. But in the future, by adding a signal conditioning, we hope all type of analog signal can be fed to this device. The signal conditioning must take off any DC offset from the signal and then convert it into a square wave.
Counter 0 counts the incoming clock pulse at T0 (P3.4) and Counter 1 counts the incoming clock pulse at T1 (P3.5). By resetting all counter before running, they count 0000h~FFFFh. After a value of FFFFh of counts, the counter issues an interrupt request. At the each of interrupt vector of their interrupt, we put some commands to increase a value that is an accumulator of each of overflow event of each counter.

Timer 2 In Auto-Reload Mode
The interval of 1 second is held by timer 2 that acts as auto-reload mode. The auto-reload mode functions just like Timer 0 and Timer 1 in auto-reload mode, except that the Timer 2 auto-reload mode performs a full 16-bit reload (recall that Timer 0 and Timer 1 only have 8-bit reload values). When a reload occurs, the value of TH2 will be reloaded with the value contained in RCAP2H and the value of TL2 will be reloaded with the value contained in RCAP2L.
To operate Timer 2 in auto-reload mode, the CP/RL2 bit (T2CON.0) must be clear. In this mode, Timer 2 (TH2/TL2) will be reloaded with the reload value (RCAP2H/RCAP2L) whenever Timer 2 overflows; that is to say, whenever Timer 2 overflows from FFFFh back to 0000h. An overflow of Timer 2 will cause the TF2 bit to be set, which will cause an interrupt to be triggered, if Timer 2 interrupt is enabled. Note that TF2 will not be set on an overflow condition if either RCLK or TCLK (T2CON.5 or T2CON.4) are set.
By setting RCAP2H and RCAP2L to 3CB0h, timer 2 runs for 50 ms. Timer 2 runs 40 times, so we get 1 second delay.
We use ISP Flash Microcontroller Programmer Ver 3.0a to burning the hex code. Listing program can be found at here. Look schematic diagram.
2X16 LCD Display
We choose 2X16 LCD for display. The LCD display is “lighter” than 7-segment LED display. The second display much more needs microcontroller attention to scan some LED. The attention may be could be reduced by replacing subroutine for scanning with some driver like 74LS46/7. But its need more complex circuit for it.

Access 4X3 Matrix-Keypad

A keypad is the most widely used input devices of a microcontroller. In order to use it effectively, we need a basic understanding of them. In this section, we discuss keyboard fundamentals, along with key press and key detection mechanisms, Then we show how a keyboard is interfaced to an AT89S51 microcontroller.

At the lowest level, keyboards are organized in a matrix of rows and columns. The CPU accesses both rows and column through ports; therefore, with a port of microcontroller, a 4X3 matrix of keys can be connected. When a key pressed, a row and column make a connection; otherwise, there is no connection between row and column.

Scanning and Identifying the Key Pressed

Figure1 shows a 4X3 matrix connected to port 1. The rows (R1 through R4) are connected to an output port and the columns (C1 through C3) are connected to an input port. Note that, we only use 7 pins of port 1.
Figure 1 A 4X3 matrix connected to port 1.

To detect a pressed key, first, the microcontroller set pin 0 through 7 of port 1 and initiate the variable ‘Digit’ to zero. The value of ‘Digit’ represents the digit of key pressed.
Then it sends 0111 to R1 R2 R3 R4 and it reads the columns. If the data read from the columns is C1 C2 C3 =111, no key has been pressed and the process continues to next step.
If the data read from the columns is C1 C2 C3 =011, this means that a key in the R1 row and C1 column has been pressed. That is ‘1’.
In the subroutine ‘CheckColumn’, the value of ‘Digit’ is increased. The value of ‘Digit’ represents the key pressed. Before leave this subroutine, microcontroller set ‘KeyPressed’ to indicate there is a key pressed.
If the data read from the columns is C1 C2 C3 =101, this means that a key in the R1 row and C2 column has been pressed. That is ‘2’. Table 1 represents the meaning of each combination of data received at C1 C2 C3.

Table 1 The meaning of each combination of data received at C1 C2 C3

Someone can not press two key at the same time. There is time different between press a key with another key. ‘KeyPressed’ indicates there is a key pressed in this time. Before leave the entire subroutine, if ‘KeyPressed’ has been set, the microcontroller set the variable ‘KeyAlreadyPressed’. This variable will not be cleared until this subroutine detect that there is no key pressed. So, if press more than two key, only the first key will be read.
To see if any key is pressed, the columns are scanned over and over in an infinite loop until one of them has a 0 on it. The listing below is only for example. In fact, it’s no efficient if we scan the keypad without any intervals of time. We usually use the intervals time for scanning more than 10 ms. This interval can be generated by timer.

Listing Program.

Program for counter

Sometimes we need a counter to count an event at digital scope. Counter can be made by JK flip-flop. There are some integrated chip contains two or more JK flip-flop that can be operated as a counter. A flip-flop can act as one bit counter. So, if we need 4 bit counter, that can count 0 to 16, we need four flip-flops.
A programmable counter can be made by a microcontroller. AT89S51 have two timers that can be operated as independent counter. To do this, we must set c/t bit at TMOD register. This sample will operate timer 0 as mode 2 counter. By loading 155des at TL0 and TH0, timer 0 act as 100des counter.
A simple frequency counter can be made by this counter.

This is the sample program for counting negative edge of input clock at T0 (p3.4). The number of clock will displayed at 2 digit of 7-segment LED common anode.
This program also acts as frequency divider. The clock frequency will be divided by 100 and emitted to P3.2. Press INT0 for pause and INT0 again to resume.

Here is the listing program.

Displaying 2 digits to 7-segment LED

The 2 digit 7-segment display can seem a little complicated. The main idea for this system is to connect both 7-segment cells together in parallel, but in the same time, only one that be powered.
Here is the simple sequence to show the ones at the right cell and tens at the left cell.
1. Sends data ‘ones’ though the ‘PortLED’.
2. Energizes the right cell while left cell is off by resetting P1.0.
3. Wait for a short time delay. In this project, we paused for 8.192 ms that was setted by interrupt from timer 1.
4. Sends data ‘tens’ though the ‘PortLED’.
5. Energizes the left cell while right cell is off by setting P1.0.
6. Wait for 8.192 ms too.

Here is a sample program for displaying 00~99 to 7-Segment LED common anode.Each digit activated by multiplexing every 8128 ms.
The ones will increment in 1 second.


Microcontroller as a frequency generator

Many electronic experiences require clock generator. In common, analog clock generator can build clock signal with 5 % error, and digital clock generator can build it with 0.1 % error. Microcontroller-based clock signal generator has crystal accuracy. The useful frequency range that can be generated is between 1 Hz and 1 MHz when the microcontroller operating at a 24 MHz clock frequency. The 1 MHz frequency output can be generated with continuing to execute a one-cycle-instruction to complement the pin output. To generate a specific frequency below 1 MHz, the other instruction(s) such as no-operation can be inserted to delay the next instruction. The maximum error of 0.1 % can be generated at frequency output below 2 kHz and the maximum error of 1 % at frequency below 20 kHz. The selected frequency signal with 0.1 % or less error also can be generated for frequency below 1 MHz.
The main principle of microcontroller-based clock generator is toggling a output pin with specific time interval.
Here is a sample program for toggling pin 0 through 7 of port 0 with delay routine.
$MOD51
Org 0h
Start: Mov P1,#00001111B
call Delay
Mov P1,#11110000B
call Delay
Jmp Start
;------------------- Delay sub routine -------------------
Delay: Mov R0,#0FFh ;R0=FF (Hex)
Delay1: Mov R1,#0FFh ;R1=FF (hex)
Delay2: nop ;no operation
nop
nop
Djnz R1,Delay2
Djnz R0,Delay1
Ret
End


Here is a sample program will source the clock with its periode 6 ms.

$mod51
MOV P1,#0h
Repeat: CPL P1.0
JMP Repeat
END

Keypad

A keypad is a set of buttons arranged in a block which usually bear digits and other symbols but not a complete set of alphabetical letters. If it mostly contains numbers then it can also be called a numeric keypad. Keypads are found on many alphanumeric keyboards and on other devices such as calculators, combination locks and telephones which require largely numeric input.
Figure 1 A 4X3 matrix keypad
A computer keyboard usually contains a small numeric keypad with a calculator-style arrangement of buttons duplicating the numeric and arithmetic keys on the main keyboard to allow efficient entry of numerical data. This number pad (commonly abbreviated to "numpad") is usually positioned on the right side of the keyboard because most people are right-handed. Many laptop computers have special function keys which turn part of the alphabetical keyboard into a numerical keypad as there is insufficient space to allow a separate keypad to be built into the laptop's chassis. Separate plug-in keypads can be purchased.
By convention, the keys on calculator-style keypads are arranged such that 123 is on the bottom row. In contrast, a telephone keypad has the 123 keys at the top. It also has buttons labelled * (star) and # (octothorpe, number sign, "pound" or "hash") either side of the zero. Most of the keys also bear letters which have had several auxiliary uses, such as remembering area codes or whole telephone numbers. The keypad of a calculator contains the digits 0 through 9, together with the four arithmetic operations, the decimal point and other more advanced functions. Keypads are a part of mobile phones that are replaceable and sit on a sensor board. Some multimedia mobile phones have a small joystick which has a cap to match the keypad. Keypads are also a feature of some combination locks. This type of lock is often used on doors, such as that found at the main entrance to some offices.
There are some type(s) of keypad: 4X3, 4X4, etc. Each type of those sould be accessed with different manner. Microcontroller must use I/O port to source and sink current to achieve data in which keypad pressed.

Constructing a Matrix Keypad
Martix keypads are well known for their simple architecture and ease of interfacing with any microcontroller. In this part of tutorial we will learn how to interface a 4x4 matrix keypad with AVR and 8051 microcontroller. Also we will see how to program then in Assembly and C.
Figure 3 Keypad Switch
Constuction of a keypad is really simple. As per the outline shown in the figure below we have four rows and four columns. In between each overlapping row and column line there is a key. Now our keypad is ready, all we have to do is connect the rows and columns to a port of microcontroller and program the controller to read the input.

Scanning a Matrix Keypad
There are many methods depending on how you connect your keypad with your controller, but the basic logic is same. We make the coloums as i/p and we drive the rows making them o/p, this whole procedure of reading the keyboard is called scanning.
In order to detect which key is pressed from the matrix, we make row lines low one by one and read the coloums. Lets say we first make Row1 low, then read the columns. If any of the key in row1 is pressed will make the corrosponding column as low i.e if second key is pressed in Row1, then column2 will give low. So we come to know that key 2 of Row1 is pressed. This is how scanning is done.
So to scan the keypad completely, we need to make rows low one by one and read the columns. If any of the button is pressed in a row, it will take the corrosponding column to a low state which tells us that a key is pressed in that row. If button 1 of a row is pressed then Column 1 will become low, if button 2 then column2 and so on...

Overview of microcontroller

A microcontroller is a miniature of computer. It has CPU, ROM, RAM, I/O port and timer all embedded on single chip, some times its contain ADC, DAC and analogue comparator. It's also known as IBP ("itty-bitty processors"). All computers -- whether we are talking about a personal desktop computer or a large mainframe computer or a microcontroller -- have several things in common:

  • All computers have a CPU (central processing unit) that executes programs. If you are sitting at a desktop computer right now reading this article, the CPU in that machine is executing a program that implements the Web browser that is displaying this page.
  • The CPU loads the program from somewhere. On your desktop machine, the browser program is loaded from the hard disk.
  • The computer has some RAM (random-access memory) where it can store "variables."
  • And the computer has some input and output devices so it can talk to people. On your desktop machine, the keyboard and mouse are input devices and the monitor and printer are output devices. A hard disk is an I/O device -- it handles both input and output.

The desktop computer you are using is a "general purpose computer" that can run any of thousands of programs. Microcontrollers are "special purpose computers." Microcontrollers do one thing well. There are a number of other common characteristics that define microcontrollers. If a computer matches a majority of these characteristics, then you can call it a "microcontroller":

  • Microcontrollers are "embedded" inside some other device (often a consumer product) so that they can control the features or actions of the product. Another name for a microcontroller, therefore, is "embedded controller."

  • Microcontrollers are dedicated to one task and run one specific program. The program is stored in ROM (read-only memory) and generally does not change.

  • Microcontrollers are often low-power devices. A desktop computer is almost always plugged into a wall socket and might consume 50 watts of electricity. A battery-operated microcontroller might consume 50 milliwatts.

  • A microcontroller has a dedicated input device and often (but not always) has a small LED or LCD display for output. A microcontroller also takes input from the device it is controlling and controls the device by sending signals to different components in the device.

    For example, the microcontroller inside a TV takes input from the remote control and displays output on the TV screen. The controller controls the channel selector, the speaker system and certain adjustments on the picture tube electronics such as tint and brightness. The engine controller in a car takes input from sensors such as the oxygen and knock sensors and controls things like fuel mix and spark plug timing. A microwave oven controller takes input from a keypad, displays output on an LCD display and controls a relay that turns the microwave generator on and off.

  • A microcontroller is often small and low cost. The components are chosen to minimize size and to be as inexpensive as possible.

  • A microcontroller is often, but not always, ruggedized in some way.

    The microcontroller controlling a car's engine, for example, has to work in temperature extremes that a normal computer generally cannot handle. A car's microcontroller in Alaska has to work fine in -30 degree F (-34 C) weather, while the same microcontroller in Nevada might be operating at 120 degrees F (49 C). When you add the heat naturally generated by the engine, the temperature can go as high as 150 or 180 degrees F (65-80 C) in the engine compartment.

    On the other hand, a microcontroller embedded inside a VCR hasn't been ruggedized at all.

The actual processor used to implement a microcontroller can vary widely. For example, the cell phone shown on Inside a Digital Cell Phone contains a Z-80 processor. The Z-80 is an 8-bit microprocessor developed in the 1970s and originally used in home computers of the time. The Garmin GPS shown in How GPS Receivers Work contains a low-power version of the Intel 80386, I am told. The 80386 was originally used in desktop computers.

In many products, such as microwave ovens, the demand on the CPU is fairly low and price is an important consideration. In these cases, manufacturers turn to dedicated microcontroller chips -- chips that were originally designed to be low-cost, small, low-power, embedded CPUs. The Motorola 6811 and Intel 8051 are both good examples of such chips. There is also a line of popular controllers called "PIC microcontrollers" created by a company called Microchip. By today's standards, these CPUs are incredibly minimalistic; but they are extremely inexpensive when purchased in large quantities and can often meet the needs of a device's designer with just one chip.

A typical low-end microcontroller chip might have 1,000 bytes of ROM and 20 bytes of RAM on the chip, along with eight I/0 pins. In large quantities, the cost of these chips can sometimes be just pennies. You certainly are never going to run Microsoft Word on such a chip -- Microsoft Word requires perhaps 30 megabytes of RAM and a processor that can run millions of instructions per second. But then, you don't need Microsoft Word to control a microwave oven, either. With a microcontroller, you have one specific task you are trying to accomplish, and low-cost, low-power performance is what is important.