Unformatted text preview:

EECS 100 ADC Laboratory B Boser University of California Berkeley Department of Electrical Engineering and Computer Sciences EECS 100 Professor Bernhard Boser LABORATORY 10 v1 ADC LABORATORY Microcontrollers and computers in general for that matter operate with digital data However many real world signals such as temperature are analog in nature An analog to digital converter is needed to input such signals into a microcontroller Analog to digital converters or ADCs for short are available as standalone electronic components or built into more complex devices Fortunately our microcontroller has an ADC built in In this laboratory we will use this ADC to interface the weight scale designed in an earlier laboratory to the microcontroller and have the bar graph display the number of weights put on the scale ADCs compare an analog input Vin e g 1 387V to a reference voltage Vref to produce a digital number representing the ratio of the analog input to the reference rounded to the nearest integer For example the ADC in our microcontroller converts analog voltages to digital numbers according to the following equation 1023 For example with Vref 3V and Vin 1 387V N 473 Negative input voltages and inputs exceeding the reference produce are clipped to zero and 1023 respectively The program skeleton below shows the code for using the ADC and configures P1 7 as its input Conversion results are stored in the variable ADC10MEM int main void Stop watchdog timer to prevent time out reset WDTCTL WDTPW WDTHOLD ADC10CTL1 INCH 7 ADC10CTL0 SREF 0 ADC10SHT 2 ADC10ON P1OUT 0 P1SEL BIT7 P1DIR 0x7f initialize P1 0 6 are digital IOs P1 7 is A7 P1 direction is output for ADC10CTL0 ENC ADC10SC while ADC10CTL1 ADC10BUSY if ADC10MEM bar 1 P1 7 is ADC input reference is VCC sample rate enable ADC enable and start conversion wait for conversion to complete display result on bar graph Page 1 EECS 100 ADC Laboratory B Boser LAB REPORT Lab Session Name 1 SID Name 2 SID 1 Testing the ADC Complete the program such that the bar graph represents graphically the input voltage of the ADC for Vref 3V I e no LEDs on for Vin 50mV and LEDs 0 to 6 on for Vin 2950mV with linear interpolation inbetween Hand in your program at the beginning of the lab Completed program of 10 P Test your program in the laboratory by attaching a 500 potentiometer between VCC and GND with the slider connected to port P1 7 Do not forget to remove the LED jumper for P1 7 2 Weight Scale Rebuild the weight scale from Laboratory 4 and connect the output of the instrumentation amplifier to P1 7 Use the laboratory supply to power the weight scale and connect its ground to the ground of the microcontroller board Modify your program such that the bar graph indicates the number of weights placed on the scale Show the result to the laboratory GSI Weight scale with bar graph output Page 2 of 10 M EECS 100 ADC Laboratory B Boser SUGGESTIONS AND FEEDBACK Time for completing prelab Time for completing lab Please explain difficulties you had and suggestions for improving this laboratory Be specific e g refer to paragraphs or figures in the write up Explain what experiments should be added modified how or dropped Page 3 EECS 100 ADC Laboratory B Boser PRELAB SUMMARY Lab Session Name 1 SID Name 2 SID Summarize your prelab P results here and turn this in at the beginning of the lab session Completed ADC test program Page 4


View Full Document

Berkeley ELENG 40 - ADC LABORATORY

Documents in this Course
Lecture 3

Lecture 3

73 pages

Lecture 1

Lecture 1

84 pages

Guide 4

Guide 4

8 pages

Diodes

Diodes

7 pages

Quiz

Quiz

9 pages

Load more
Loading Unlocking...
Login

Join to view ADC LABORATORY and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ADC LABORATORY and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?