hw5.s10 - CPE/EE 323 Introduction to Embedded Computer...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CPE/EE 323 Introduction to Embedded Computer Systems Homework V 1(20) 2(25) 3(20) 4(20) 5(25) Total (110) Problem #1. (20 points) . ADC, DAC A (5 points). A sensor device gives an analog voltage that is directly proportional to atmospheric pressure. The sensor output voltage is always in the range of 0.5 V (min) to 1.5 V (max). How would you configure the MSP430’s ADC12 to perform analog-to-digital conversion with maximum resolution? What is the digital value that corresponds to 1.25 V input voltage? Explain. B (5 points). What is the analog voltage at the output of the MSP430’s DAC if we use 2.5 V reference voltage and 8-bit resolution? The data register DAC12_DATA = 0x007A.
Background image of page 1

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

View Full DocumentRight Arrow Icon
C (10 points). Analyze the following code. Add missing comments in the code below. What does this program do? // ACLK = 32kHz, MCLK = SMCLK = default DCO 1048576Hz, ADC12CLK = ADC12OSC // // MSP430xG461x // ----------------- // | XIN|- // Vin0 -->|P6.0/A0 | 32kHz // Vin1 -->|P6.1/A1 XOUT|- // Vin2 -->|P6.2/A2 | // Vin3 -->|P6.3/A3 | // | | //****************************************************************************** #include "msp430xG46x.h" volatile unsigned int A0results[8]; volatile unsigned int A1results[8]; volatile unsigned int A2results[8]; volatile unsigned int A3results[8]; unsigned int Index; void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog P6SEL |= 0x0f; // Enable A/D inputs ADC12CTL0 = SHT0_8 + MSC + ADC12ON; // // // ADC12CTL1 = SHP + CONSEQ_3; // ADC12IE = 0x08; // ADC12MCTL0 = INCH_0; // ADC12MCTL1 = INCH_1; // ADC12MCTL2 = INCH_2; // ADC12MCTL3 = EOS + INCH_3; // while (1) { ADC12CTL0 |= ENC; // ADC12CTL0 |= ADC12SC; // __bis_SR_register(LPM0_bits + GIE); // LPM0 } } #pragma vector = ADC12_VECTOR __interrupt void ADC12_ISR(void) { A0results[Index] = ADC12MEM0; // A1results[Index] = ADC12MEM1; // A2results[Index] = ADC12MEM2; // A3results[Index] = ADC12MEM3; // Index = (Index + 1) & 0x7; // __no_operation(); // SET BREAKPOINT HERE __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 }
Background image of page 2
Problem #2. (25 points) ADC, DAC. Your task is to write a program that samples an analog signal
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

hw5.s10 - CPE/EE 323 Introduction to Embedded Computer...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online