Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 63733

Forum Post: Trying to use channel 0 and channel 1 of SD24 atod converter

$
0
0
I am trying to use channels 1 and 2 of the SD24 atod for the msp430afe253 chip. I am reading channel 0 ok but what I am reading for channel 1 doesn't seem right. I am wondering if you could look over my code and see if I have a setup problem. SD24CTL = SD24REFON + SD24SSEL0; // 1.2V ref, SMCLK SD24CCTL0 |= SD24GRP+SD24DF; // Group with CH1 SD24CCTL1 |= SD24GRP+SD24DF; // Group with CH2 for (i = 0; i < 0x3600; i++); // Delay for 1.2V ref startup // SD24CCTL2 |= SD24SC; // Set bit to start conversion P1DIR |= (BIT0|BIT1|BIT2|BIT3|BIT4); // Set P1.0 to output direction P1OUT = 0; P1OUT |= (BIT0|BIT1|BIT2|BIT3|BIT4); SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } ADCval0[1] = SD24MEM0; SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } ADCval0[2] = SD24MEM0; ADCval0[0] = (ADCval0[1] - ADCval0[2]); SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } ADCval1[1] = SD24MEM1; SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } SD24CCTL2 |= SD24SC; // Set bit to start conversion while(!(SD24CCTL2 & SD24IFG)) {; } ADCval1[2] = SD24MEM1; ADCval1[0] = (ADCval1[1] - ADCval1[2]); Steve

Viewing all articles
Browse latest Browse all 63733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>