{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ME461_Lab3 - ME 461 Laboratory#3 Analog-to-Digital...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ME 461 1 Lab #3 ME 461 Laboratory #3 Analog-to-Digital Conversion Goals: 1. Learn how to configure and use the MSP430’s 10 bit SAR ADC. 2. Measure the output voltage of your home made DAC and compare it to the expected value. 3. Calibrate and use the MSP430’s internal temperature sensor. 4. Design and implement an RC anti aliasing filter. 5. Solder a microphone circuit to the breakout board and use it to sample audio signals. Exercise 1: (40 points) In this exercise you will configure the MSP430’s 10 bit analog to digital converter (ADC) to sample the output of the lowpass filter you designed in lab 2. This would be a good time to take another good look at, especially, Lecture #4 slides 36 44, the MSP 430 User’s Guide ADC10 section, and the “msp430x22x2.h” header file. As you have heard many times already, control register names and predefined constants with (relatively) easy to remember names are declared in the “msp430x22x2.h” header file. For example, on slide #43 of Lecture #4 the example code includes the following line: ADC10CTL0 = SREF_0 + ADC10SHT_2 + ADC10ON + ADC10IE; On line 172 of the “msp430x22x2.h” header file you will find: #define SREF_0 (0*0x2000u) /* VR+ = AVCC and VR = AVSS */ Obviously, zero times anything is zero and we can assign this value of SREF_0 to ADC10CTL, as in ADC10CTL0 = SREF_0; The binary representation of ADC10CTL0 will then be %0000 0000 0000 0000. Note that the three most significant bits are ‘000’ and, referring to the MSP 430 User’s Guide and/or Lecture #4 slide 34, you will see that setting the three most significant bits of ADC10CTL0 to ‘000’ tells the microprocessor to use V CC as the positive voltage reference (V R+ ) and V SS (Ground) as the negative voltage reference (V R ). As you know from Lab #2, the full scale range of your home made DAC is V SS = 0V to V CC = 3.3V. This means you can use the example above to help get you started with the configuration of the ADC. Note that because we are using a voltage reference set that is already available on the board (V CC and GND), you do not need to worry about using any of the reference generator features. On line 167 of the “msp430x22x2.h” header file you will find: #define ADC10SHT_3 (3*0x800u) /* 64 x ADC10CLKs */
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ME 461 2 Lab #3 Thus, the binary representation of ADC10SHT_2 = %0001 1000 0000 0000. We could now add SREF_0 and ADC10SHT_2 together, as in ADC10CTL0 = SREF_0 + ADC10SHT_2; Now the binary representation of ADC10CTL0 = %0001 1000 0000 0000. Note that three most significant bits remain ‘000’ but the fourth and fifth most significant bits are now ‘11’. Again referring to the MSP 430 User’s Guide and/or Lecture #4 slide 34, you will see that setting the three most significant bits of ADC10CTL0 to ‘000’ tells the microprocessor to use V CC as the positive voltage reference (V R+ ) and V SS (Ground) as the negative voltage reference (V
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern