This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430AFE253 SD24_A Unipolar Conversions No Good

Other Parts Discussed in Thread: MSP430AFE253

I have two functional hardware prototypes that I am working on developing firmware for the MSP430AFE253.  This design happens to use Channel 0 of the SD24 in unipolar mode (single-ended input).  I am using a task scheduler to set the start conversion bit to acquire a new sample once every two seconds.  I am letting the firmware run for a several seconds before halting the debugger to view the SD24MEM0 register contents that have just been written to a volatile uint16_t variable (I am using the 1024 bit filter).  I have checked the voltage at the physical pin 1 of the MSP430 and it changes from about 0.20V to 1.15V.  Pin 2 is open, and Vref of 1.25V is supplied externally to pin 7, which has been verified and is stable at 1.25V.  The way the hardware is designed, the SD24 should read near full-scale (max) when open circuit.  The problem is while the conversion results do change, they only range from about 50 to 99 (decimal).  This phenomenon is occurring on both hardware prototypes.  I have poured through the forums and can't find anyone else having problems using the SD24 AFE in unipolar mode. 

The attached file shows my SD24 initialization routine.  If anyone has any suggestions as to what the problem could be, I would greatly appreciate it.  Thanks.

#define	ADC_CTL_REG				SD24CTL
#define	ADC_CH0_CTL_REG				SD24CCTL0


void init_SD24A (void)
{
	ADC_CTL_REG = SD24SSEL0;					// SMCLK
	ADC_CH0_CTL_REG = SD24OSR_1024 | SD24SNGL | SD24IE | SD24UNI;	// Single conv, enable interrupt
}

  • I've gotten the feeling TI is avoiding the problems people are having with this chip.  Specifically the SD24_A module.  Is there anyone who can chime in on what could be wrong with the implementation of the SD24 in unipolar mode?  I've had such consternation with this device I'm going to the trouble of creating a separate troubleshooting board that will enable other hardware options for troubleshooting, as the product prototype boards I have don't lend themselves well to experimenting with the SD24 inputs.    Any feedback from anyone who has used the SD24 in unipolar mode with success, or knows anyone who has, would be greatly appreciated.

    Thanks,

    Clint

  • Hi.

    I have just started looking at the MSP430AFE series and I am also interested in the SD24_A module operation. I am planing on using the example code to get things working before trying to customize the SD24 for my own application. 

    Not sure if it will help but here is the example code for the MSP430AFE25x chips that I plan on using, it shouldn't be too hard to modify to the chip you are using as well as for the compiler you are using.

    http://www.ti.com/lit/zip/slac487


    Personally, I would just get an example going until I get some meaningful readings, then worry about changing to unipolar mode. 

  • That's the problem...  All their example code is utilizing the SD24 as a differential-input A/D.  I already know it works this way.  As soon as I configure it as single-ended (unipolar) I get garbage readings.  A differential-input A/D with 24-bit resolution is a nice feature, but what I need is a single-ended input.  

  • If you can't get it to work in single-ended mode, simply tie the negative input to GND and use it in differential mode.

  • My example code just polls the SD24, reads the results and outputs to USART. The DCO is set to 8MHz and USART is set to 19200 baud. I seem to have no problems between unipolar and bipolar conversions. They both work fine.

    In unipolar mode, only the A1.0+ pin seems to be used, the A1.0- pin does not affect the result at all, I tested this by connecting it to GND or to VREF/2. Also in unipolar mode, by measuring A1.0+ for CH0 I managed to get all the values from VREF to GND. The code below can be made to work in unipolar by adding + SD24UNI; to the end of CCTL0;

    Will try it with interrupts later. 

    Sorry if the code looks messy, new to MSP430 and I don't tidy my code while mucking around and learning.

     //Set up DCO and UART here

    volatile unsigned long adc;

    SD24CTL = SD24REFON + SD24SSEL_1 + SD24XDIV_3 + SD24VMIDON;                                 
    SD24CCTL0 = SD24SNGL + SD24LSBTOG + SD24OSR_1024;  //Have selected automatic toggle when reading result register


    while (1)
    {
        SD24CCTL0 |= SD24SC; 
        while ((SD24CCTL0 & SD24IFG)==0); 
        adc = SD24MEM0;    //Add the MSB result
        adc = (adc << 8);       //Shift MSB by 8 places
        adc +=  SD24MEM0;            //Add the LSB result

        //adc now contains the 24bit SD value. Print it out to view it
        printf("%ul \r\n", adc);



    Edit1: Forgot to enable the SD24VMIDON bit in the above code. It's fixed now.
    Edit2: The high value only needs to be shifted by 8 not 16. Whoops. Fixed. 
    Edit3: Further addition to coment section 

**Attention** This is a public forum