analogue to digital conversion

15
Analogue to Digital Conversion By Cap’n Tim Johnson, PE Prepared 11/12/2013

Upload: ophira

Post on 23-Feb-2016

66 views

Category:

Documents


0 download

DESCRIPTION

Analogue to Digital Conversion. By Cap’n Tim Johnson, PE Prepared 11/12/2013. Digital World. The digital in A/D conversion consists of binary or hex numbers that will come to stand for a real world phenomenon. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Analogue to Digital Conversion

Analogue to Digital Conversion

By Cap’n Tim Johnson, PEPrepared 11/12/2013

Page 2: Analogue to Digital Conversion

Digital World

• The digital in A/D conversion consists of binary or hex numbers that will come to stand for a real world phenomenon.

• Say, for instance we have four-bits we use to represent an analog value that’s been converted.

• In binary, the numbers would range from 0000 to 1111 and there are (24 = 16) sixteen different values represented.

• These number in base 10 could range from 0-15

Page 3: Analogue to Digital Conversion

Typical example of converting a binary number to a decimal number

While this is very useful in converting binary number to decimal and back… analog to digital conversion is similar but different.

Page 4: Analogue to Digital Conversion

A/D is converting a binary number into something else

We want to change the decimal number column into real world values that don’t necessarily increment by whole numbers but do increment by binary numbers.

SomethingElse

Page 5: Analogue to Digital Conversion

This example shows the conversion of real world values to binary numbers

Here if we let each binary bit value or weight represent a 1/3 of a volt, as the binary numbers increment, the voltage goes up 1/3 a volt at a time.

Real World Values

0.000.330.661.001.331.662.002.332.663.003.333.66

Page 6: Analogue to Digital Conversion

How do we get the real world values?

1. We need to know the maximum input voltage or the range between Vmax – Vmin. If Vmin is 0 or ground then all we need is Vmax.

2. We need to know the number of bits used in the A/D converter.

3. Vmax/(2#bits) = Resolution4. Resolution is the value of the incremental voltage

change per bit or the difference between 0001 and 0000.

Page 7: Analogue to Digital Conversion

What else does the table tell us?Real World Values

0.000.330.661.001.331.662.002.332.663.003.333.66

The binary numbers are stored after a conversion in the A/D results register. By using a simple formula the binary number can tell us what the input voltage is.

Page 8: Analogue to Digital Conversion

How?Real World Values

0.000.330.661.001.331.662.002.332.663.003.333.66

Convert the binary number in the A/D results register to its decimal equivalent. That tells us how many bits are needed to multiply the resolution to equal the input voltage. alue10)

101121110 ⅓ * 11 = 3 ⅔ volts

Page 9: Analogue to Digital Conversion

Quick Summary

• You need to know the maximum voltage that will be present on the input. This voltage can not exceed the device’s upper limit.

• You need to know the number of bits the device uses to report the value in the A/D results register

• Calculate the Resolution: Vmax/(2#bits) • Convert the value in the A/D results register to base 10

to determine the decimal number of bits• Multiply the decimal number times the Resolution to

determine the input voltage.

Page 10: Analogue to Digital Conversion

General Rule

• Your results will never be higher than Vmax

• For instance, if the results register reads $FF, all the bits are filled in a 8-bit ADC.

• The complete formula is: •

• The fraction 255/265 ≈ 1 thus you have 1*V• The error in the fraction = Quantization error

Page 11: Analogue to Digital Conversion

Other Rules of Thumb

• If you get $80 (1000 0000) in the result register, the answer is ½ Vmax ($80/$FF is ½)

• If the last four zeros have some value then 1000 XXXX is approximately ½ Vmax

• You could read just the first 2 bits and round off to fourths of Vmax Ex.: 0100 XXXX ≈ ¼ Vmax

• If you read just the first 3 bits you can round off to eights of Vmax

• Ex.: 0110 XXXX ≈ ⅜Vmax & 1110 XXXX ≈ ⅞Vmax

Page 12: Analogue to Digital Conversion

What else could we do with A/D?• First we have to think of what it is that we want digitized.

Rotation around an axis is a useful number especially if we were rotating a telescope horizontally.

• We’d need to digitize the number of degrees we rotated a telescope. The maximum number of degrees is 360°. Then suppose our A/D converters was limited to 5 volts input maximum and 8-bits…that would be ~1.4 degrees/bit.

• But if we limited our rotation to 180° that would be ~.7 degrees per bit. Use the ADC we can determine if the telescope turned 1 ° with each change of a bit.

Page 13: Analogue to Digital Conversion

Another look at ADC

This graph shows the fitting of a linear voltage to an ADC in theory. Visible is the quantization error which is the overhang of the digital step higher and/or lower than the ideal value. The ideal quantization error is ± ½ LSB. The LSB is aka Resolution.

LSB value

Page 14: Analogue to Digital Conversion

Role of ADC module in microcontrollers

The ADC module is one of a number of modules on a microcontroller. Others include General Purpose I/O, Comparators, Digital to Analog Converters , Op Amps, Timers, Real-Time clock, AES encryption, Brown-Out Reset, Direct Memory Access, Memory Protection Units, Supply Voltage Supervisors, Capacitive Touch Sense I/O, Communications (UART,SPI, I2C, IrDA, USB, Ethernet), LCD, and other specialty designs.

Page 15: Analogue to Digital Conversion

This is the block diagram for the TI MSP430 Sigma-Delta 16 bit ADC

A/D Results Register