Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

Analogue to Digital Conversion

<^< Digital Data | Course Index | Inputs and Outputs >^>

Much of our 'real world' data is analogue, but computers (including the PICmicro microcontroller) can only process digital data. Fortunately the PICmicro has a circuit inside it that can convert information inside it from an analogue format to a digital format. This is called an Analogue to Digital Converter - ADC or A/D for short.

The ADC inside the PICmicro chip divides the range of possible analogue voltages into equal steps. The first step is given the number 0, and the highest step is given the highest number that the A/D converter can handle. The highest number the ADC can handle is determined by the resolution of the ADC inside the chip. The resolution is determined by the number of 'bits' the internal circuitry of the ADC has. The resolution of PICmicro ADCs is 8, 10 or 12 bit.

For example, if the biggest analogue voltage is 5V, and the PICmicro has a 8 bit A to D converter:

  • the highest 8 bit number is 1111 1111 (= 255 in decimal)
  • the first step is 0000 0000 (= 0 in decimal)
  • This makes a total of 256 steps, so each step is a voltage jump of 5V/256,which equals about 20mV per step.

When the PICmicro is told to look at an analogue signal, and convert it, it divides the analogue signal by 20mV, to find out how many steps up the signal sits. This gives the digital equivalent of the analogue signal.

The next graph may make this clearer.

In our example, the converter outputs 0 for any analogue signal up to 20mV, outputs 1 for analogue signals between 20 and 40mV, and so on.

<^< Digital Data | Course index | Inputs and Outputs >^>

Print - Search - Login

Page last modified on May 14, 2013, at 01:25 PM