You are here
Home > Uncategorized >

Analog to Digital Conversion (ADC) interfacing

ADC

ADC is used to convert an analog input voltage to its digital equivalent. ADC chip family is ADC080X from National Semiconductors.

Some of the ICs are:

ADC-0800, ADC-0804: singly analog input channel and 8-bit out bits

ADC-0808 and ADC-0809: These are eight analog input inputs with 3-select lines used to select one of eight channel. It also has 8-bit digital output.

ADC-0816 : It is an 16-input channel and gives 8-bit digital output signal.

 

Why Analog to Digital

  • Signals in the real world are analog: light, sound, temperature, pressure, acceleration or other phenomenon. So, real-world signals must be converted into digital, using a circuit called ADC (Analog-to-Digital Converter), before they can be manipulated by digital equipment.
  • When you scan a picture with a scanner what the scanner is doing is an analog-to-digitalq conversion: it is taking the analog information provided by the picture (light) and converting into digital.
  • When you record your voice on your computer, you are using an analog-to-digitalq converter to convert your voice, which is analog, into digital information.
  • When an audio CD is recorded at a studio, once again analog-to-digital is taking place,q converting sounds into digital numbers that will be stored on the disc.
  • Whenever we need the analog signal back, the opposite conversion – digital-to-analog,q which is done by a circuit called DAC, Digital-to-Analog Converter – is needed. When you play an audio CD, what the CD player is doing is reading digital information stored on the disc and converting it back to analog so you can hear the audio. As microprocessor only understand digital signal, so real world analog signal should be converted into digital to process it by microprocessor. W

Types of ADC

  • Flash ADC
  • Sigma-delta ADC
  • Dual slope converter
  • Successive approximation converter

Successive approximation type of ADC is the most common and widely used ADC. It has a fixed conversion time for any type of voltage level conversion. Specification associated with ADC are:

  • Analog input voltage:

    The analog input voltage that can be accepted by ADCs can be of two types. These are:

Unipolar analog i/p : This type has only one polarity. Generally acceptable level are 0 to +5 V or 0 to 10V.

Bipolar analog i/p : This type has only two polarity +ve and -ve. Generally acceptable level are -5V to +5 V or -10V to +10V.

  • Number of bits at the digital output :

    No. of output bits in ADC vary depending on the chip type. ADC are available with 8-bits, 10-bit, 12-bits and 16-bits.

  • Resolution :

    Number of bits in the ADC decides the number of voltage level sensed. For an 8-bit output the number of voltage level sensed are 28=256. The number of bits and the input voltage range decides the resolution. Thus the resolution is defined as the smallest change in the input voltage that can be sensed at the output.

Mathematically

Resolution = range of input analog voltage / number of voltage level at the output

Example : find the resolution of an 8-bit ADC accepting 5V unipolar analog input

Ans: Resolution = 5/ 256 = 0.0195 = 19.5mV

  • Conversion time:

    The clock frequency and the type of ADC. It is the time taken by the ADC to convert an analog input to its digital output.

  • Number of analog input channels

    ADC can accept input from different sources. The input where an analog input can be connected is called a channel. ADC comes with number of input channels. A particular channel can be selected by applying particular bit pattern at the select input in the multiplexer circuit.

Pin AND Signal Diagram

 

Figure-1 Pin diagram of ADC

As shown in figure (b), When Vcc is +5V, the input voltage can range from 0 to 5V and the corresponding output can be from 00 to FF. However, the full scale output can be restricted to a lower range of input by using pin-9 (VRef/2).

For example, If we connect VRef/2 i.e pin-9 to 0.5V the full scale output FF will be obtained for 1V signal(twice than VRef/2 voltage)

Interfacing of ADC with microprocessors

Figure shows the interfacing diagram of the AD converter. Analog inputs can unipolar or bipolar 5 or 10V. ADC chip also has the START’ (start conversion) and the DR’ (data ready), both ACTIVE LOW SIGNALS.

The conversion process starts when a low pulse is sent to START’, after this the DR’ line goes high and the data output line will go in the high impedance state.

When a conversion is completed DR’ line would go LOW and the data is made available on the output data lines.

    • START’ is an output signal from the microprocessor and i/p to ADC
    • DR’ is an input to the processor from ADC
    • D7-D0 are the output of ADC and input to the processor

Interfacing to 8255

To interface the ADC to 8255, we need the 8255 port address. Letting the port addresses

The three port addresses are activated using the IOR’, IOW’ and the decoder outputs.

 

 
Port
Port Address
Interfaced to
1000 0000
PA
80h
DR’ (data ready o/p) to activate data output lines for MPU
1000 0001
PB
81h
 
1000 0010
PC
82h
START’ i/p to ADC
1000 0011
CWR
83h
 

These port addresses are generated using a 4-i/p NAND gate and a 3×8 decoder. The address input for interfacing is shown in figure.

Operation

The control inputs are CS’.  Signal MEMR’ and MEMW’ are generated from RD’ and WR’ of processor .

Figure: ADC Timing
  • When the CS” and WR’ goes LOW, the internal SAR(successive-Approx Register) is reset and the output lines D7-D0 go into the high impedance state.
  • Conversion from A-to-D begins when WR’ make the transition from LOW to HIGH
  • When the conversion is complete, the INTR’ is asserted LOW and the data are placed on the output data bus.
  • INTR’ can be used to interrupt the processor indicating the availability of the converted data.
  • When the processor reads the data by asserting the RD’ signal, the INTR’ is reset.

Interfacing and Programming to read ADC 0809

Figure: ADC with 8255

Port B connected to data outputs of the ADC

Port A is used to select a channel and output the SC (PA4) start conversion  pulse, Output is enabled by issuing a pulse on the OE i.e PA5

End of conversion is detected by reading the status of the EOC pin of ADC. This is connected to PC0

Control word of 8255

D7
D6
D5
D4
D3
D2
D1
D0
CW
1
0
0
0
0
0
1
1
83h

 

AD_Con:     MVI         A, 83h

OUT        CWR_Addr            ; CW

LDA         Ch_Num ; port A

ANI          0Fh

MVI         B, 19h     ; To issue ALE/SC signal (D4=1)

ORL         B            ; combined with channel number

OUT        PA_Addr                ; send on port A

NOP

NOP

MVI         B, 0         ; remove SC

ORL         B            ; Combined with channel no.

OUT        PA_Addr      ; send on port A

Check:     IN            PC_Addr      ; read status for EOC

RAR                            ; rorate to bring EOC to Carry i/p

JNC          Check

LDA         Ch_Num ; load channel no. in Acc if EOC is received

MVI         B, 20h           ; make OE signal high

ORL         B

OUT        PA_Addr

IN            PB                ; read data on port B

STA         ADC_Data

RET

Leave a Reply

Top
error: Content is protected !!