Programming the PIC Microcontroller with MBasic

Chapter 11: Analog-to-Digital Conversion

The world is analog, not digital, at least at scales perceptible by human senses. If you are asked the temperature, you might respond "it's 77 degrees." However the temperature doesn't abruptly jump from 77 to 78 degrees. Rather, with a sufficiently accurate thermometer, you might have said "it's 77.123 degrees," to which the questioner might respond, "no, according to my higher precision thermometer, it's 77.12345 degrees." In theory, until we start to reach quantum uncertainties, there is no limit to the precision with which we may state the temperature, or a voltage reading, or many other parameters human ingenuity is able to measure.

Programs you write using MBasic, however, deal with bits and bytes; bit, byte, word and long variables and constants are in discrete steps. A bit must be 0 or 1, not somewhere between 0 and 1. A byte variable can't have the value 128.3; it can be 128 or 129, but not something between. Even if we use MBasic's 32-bit floating point arithmetic package, looked at in sufficient detail we find it also jumps between finite, discrete steps, albeit small ones.

This chapter examines how MBasic translates between the analog and digital worlds in the analog-to-digital direction. We'll see in Chapter 16 how to accomplish the reverse process digital-to-analog conversion.

We'll assume in this chapter that input signals to our A/D converter change slowly so that we may neglect anti-aliasing filters and other sampled system considerations. However, we'll touch upon Nyquist sampling rate limits in conjunction with Chapter...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Digital-to-Analog Converters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.