Download EELab2_Exp2_AD_Converter_V3 720KB Apr 18 2016 08:18:48

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Variable-frequency drive wikipedia , lookup

Alternating current wikipedia , lookup

Flip-flop (electronics) wikipedia , lookup

Stray voltage wikipedia , lookup

Rectifier wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Oscilloscope wikipedia , lookup

Voltage optimisation wikipedia , lookup

Television standards conversion wikipedia , lookup

Voltage regulator wikipedia , lookup

Oscilloscope types wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Multimeter wikipedia , lookup

Metadyne wikipedia , lookup

Oscilloscope history wikipedia , lookup

Power electronics wikipedia , lookup

Mains electricity wikipedia , lookup

Buck converter wikipedia , lookup

Schmitt trigger wikipedia , lookup

Integrating ADC wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Opto-isolator wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Transcript
Electrical and Electronics Engineering Department
Electrical & Electronics Laboratory 2
(BAEL1101)
Experiment 2
A/D
CONVERTER
Name:
Due Date:
Submission Date:
Instructor:
19 April 2016
Tan Teck Siang
KOLEJ UNIVERSITI SELATAN
Southern University College
1
Course: BAEL1101
Date: _____________
Time: ________________
Instructor: _____________
A/D Converter
Lab Report Score:(1) Pre Lab: On time, with Calculation, etc. (20%)
(2) Lab Report: Format, Purpose, Approach, Results (40%)
(3) Lab Report: Analysis and Conclusion (30%)
(4) Questions (10%)
(5) Late Penalties
_____
_____
_____
_____
_____
Total
_____
Pre-lab Assignment
1. What is the difference between ADC and DAC?
2. Calculate the step size for a 9-bit ADC that with FSO of 5.11V.
3. What are the important ADC parameters for PIC32MX130 microcontroller? (refer to the
attached datasheet)
4. What does “1.1Msps” mean?
5. Calculate the total steps for a 10-bit ADC.
2
Objectives
1. To analyze the performance of the ADC0804 ADC.
2. To conduct the measurement of ADC output of discrete ADC and built-in ADC
module.
3. Understanding the applications of ADC in embedded system design.
Introduction
Analog-to-digital converters (ADC or A/D converters) translate from analog measurement,
which are usually continuous voltages or currents, to digital words used in computing, data
transmission, information processing and storage, and control systems. We do this
conversion because digital signals are easy to store, debug, and are almost free from noise.
ADC0804
The ADC0804, which is a 20-pin dual-in-line package, is an 8-bit ADC which operates on the
successive approximation principle. Its major characteristics include single 5V power supply,
0V to 5V analog input voltage range, 15mW power dissipation, and 100us conversion time.
Since the resolution of ADC0804 is 8 bits, the analog input is divided into 2 8, or 256 discrete
ranges. With 5V reference voltage, each range represents 5/256=0.01953V. Thus the digital
output code 0000 0000 (00H) corresponds to an analog input voltage of 0.00V, and 1111
1111 (FFH) represents 4.9805V. The unadjusted error, which contains full-scale, offset and
nonlinearity errors, is +/- 1 LSB or 0.01953V.
The connection diagram of ADC0804 is shown in Fig. 8-1. When data is to be read from the
output port D0 – D7, the combination of both CS and RD being low will enable the 3-state
output latches to provide the 8-bit digital outputs.
Fig 8-1 ADC0804
The ADC0804 converter is started by having CS and WR simultaneously low. This resets the
8-bit register. When WR goes high, the converter starts the conversion process. The CLK IN
(pin 4) is the input pin of clock pulses whose frequency can be from 100 to 800 kHz. The
INTR pin remains high during the conversion and will make a high-to-low transition if the
conversion is completed.
3
The analog differential input voltage is applied to the pins Vin(+) and Vin(-). If a single-end
input is desired, the Vin(-) should be connected to ground. The AGND is the ground for
analog signal and the DGND is for digital signal.
Fig. 8-2 shows an analog-to-digital converter with the ADC0804.
Fig 8-2 ADC0804 Circuit
Apparatus
(1) Module KL-92001
(2) Module KL-94001
(3) DMM
(4) PIC32MX130 Microcontroller Development board
(5) Potentiometer
(6) PICKIT 3
Procedure
ADC0804 ADC
1. Locate ADC0804 circuit on Module KL-94001. Power on the power supply.
2. Using DVM, measure the voltage at Vref/2 input (pin 9) and slowly adjust the VR1 until
measured voltage reaches 2.5V. This sets the ADC0804 analog voltage input from 0V
to 5V.
3. Measure the analog input (pin 6) and slowly adjust the VR2 until the measured voltage
reaches 0V.
4. Insert the connect plug from J1. This will hold the digital outputs. Observe LED display
states and record the results in Table 8-1.
4
5. Remove the connect plug from J1. The digital output will vary with the change of
analog input.
6. Carefully adjust the VR2 to get other analog input voltages listed on Table 2-1 and
repeat steps 4 and 5. Complete Table 2-1
Questions for ADC0804
1. Give your comments on the purpose of R3 and C1 in ADC0804 circuit.
2. What is the unadjusted error of the ADC0804?
3. The above circuit is designed for full scale 5V analog input. Explain how to redesign it
for full scale 3V analog input.
4. If the full scale analog input is 3V. Calculate its step size.
5. Explain the function of CS, RD, WR, and INTR pin.
PIC32MX130
1. Locate the ADC input channel for the RB0 (port B) pin on the PIC32MX130.
Input Pin
RB0
ADC Channel
2. Connect the potentiometer as shown below to the AN2 of the PIC32MX130.
5
3. Write the code for the initialization of ADC module.
4. Write the code to set the Port A as output.
5. Write the code to set Port B as input.
6. Write the code to acquire data from the analog input, channel 2.
7. Write the code so that Port A bit 0 will be turned ON when the analog reading is
greater than 100.
Note: The output of the 10-bit converter can be formatted for integer or fixed-point
arithmetic, signed or unsigned, 16-bit and 32-bit output
8. Slowly rotate the potentiometer until the LED at RA0 pin turned ON. Measure the
analog input voltage of the potentiometer.
LED ON ADC reading
100
Analog input voltage at AN2
9. Repeat step (6) and (7) for analog input of 200.
LED ON ADC reading
200
Analog input voltage at AN2
10. Calculate the step size from the data obtained from the above steps.
11. Calculate the maximum analog input voltage for this ADC.
6
Questions for PIC32MX130
1. What type of ADC data conversion technique is used by the PIC32MX130?
2. How many ADC channels are available for the PIC32MX130?
3. What is the minimum and maximum sampling time for the PIC32MX130?
4. What is the conversion time for the PIC32MX130?
5. Explain monotonicity of a ADC.
7
Table 2-1
8