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.

[FAQ] MSP430I2020: Measuring SD ADC noise

Part Number: MSP430I2020
Other Parts Discussed in Thread: MSP-TS430RHB32A

Tool/software: TI C/C++ Compiler

Test condition:

- MSP-TS430RHB32A board

- GAIN 1

- Measuring result = 10 data average

- sample program "sd24_ex4_singleConversionSingleChannelPolling"

- supply volt.: 3.3V (Tenma 72-10480 DC Power supply)

I have test the 24-Bit ADC function and capture the data.

However, I find got many noise even I short the pin of A0 and A1. (the result is attached)

the max volt = 0.00017767 V, the min. volt. = 0.000158358

diff. volt. = 19.3 uV

Best regards,

Mr. Hung

short_Tenma3V3.xlsx

  • Hi,

    Have you used a DMM or oscilloscope on the input signal to make sure that the noise isn't present on the input?

    Regards,
    Nathan
  • I have use the battery (Duracell AA) to retest again, it has got 12uV for 27 records. Can I improve this?

    bat_SHORT_GAIN4_2.xlsx

  • Hi,

    Again, have you checked to make sure that the noise isn't due to the input signal?

    Regards,
    Nathan
  • YES, since the A0, A1 is short together, it should be the same voltage.

  • Sorry that I'm short the A0+ and A0- together. (not A0 and A1)

    Besides, I have use Agilent 34401A 6/1/2 Digit multimeter to check that , the input source is only 3uV change. Should not be measuring such large ADC vibration

  • Hello Hung,

    Did you see my follow-up in the following thread about converting the ADC measured result to voltage?

    Also, what you're observing is the ADC's rms noise and 19uV is not surprising. You can get better results if you average your samples by software oversampling, as I mentioned in the thread above. For example, if you sample at 4000Hz, in your SD24 ISR, you can keep a running sum of the samples and then divide them by the number of samples. Let's say that you average every 4 samples. This gives you an effective sample rate of 1000Hz but should help lower the rms noise. It's basically a low pass filter done in software. I call it software oversampling because it's not the hardware oversampling (OSR) for the SD24 module.

  • For the above measuring result, I have take already take 10 sample average. Did it can add a circuit or component that can reduce the no. of samples?

    Mr. Hung

  • Hello Mr. Hung,

    Have you been able to resolve this inaccuracy issue? If you're averaging the samples, using the target board, and reading all 24-bits, then you should be able to achieve what I've observed.

    Regards,

    James
  • I can't got your result, after use the 10 sample average. when I input 75mV for test, it got 34uV vibration range (quite large) for 52 samples.

    Best regards

    Hung

    75mv.xlsx

  • Hello Hung,

    I'm attaching the code I used for this testing. Using a software oversampling (or averaging) factor of 16, I achieved less than 10uV noise between 100 samples on Sigma Delta ADC Channel 0 (shorted A0.0+ and A0.0- with jumper wire) using i2041 target socket board. I pause the code at the while(1) function, add the "results[]" array to the Watch window in CCS, copy the array into Excel, subtract the offset from the samples (I'm using bipolar format), and convert to voltages. Then, I find the maximum difference for the noise value.

    msp430i20xx_sd24_03_modified_for_sw_oversampling.c

    /* --COPYRIGHT--,BSD_EX
     * Copyright (c) 2013, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *******************************************************************************
     *
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //  MSP430i20xx Demo - SD24, Continuous Conversion on a Single Channel
    //
    //  Description: This program uses the SD24 module to perform continuous
    //  conversions on a single channel. A SD24 interrupt occurs when a conversion
    //  has completed.
    //
    //  Test by applying voltages to the input channel and setting a breakpoint
    //  at the indicated line. Run program until it reaches the breakpoint, then use
    //  the debugger's watch window to view the conversion results.
    //
    //  Results (upper 16 bits only) are stored in the array "results"
    //
    //  ACLK = 32kHz, MCLK = SMCLK = Calibrated DCO = 16.384MHz, SD_CLK = 1.024MHz
    //  * Ensure low_level_init.c is included when building/running this example *
    //
    //  Notes: For minimum Vcc required for SD24 module - see datasheet
    //         100nF cap btw Vref and AVss is recommended when using 1.2V ref
    //
    //               MSP430i20xx
    //             -----------------
    //         /|\|                |
    //          | |                |
    //          --|RST             |
    //            |                |
    //   Vin1+ -->|A0.0+      VREF |---+
    //   Vin1- -->|A0.0-           |   |
    //            |                |  -+- 100nF
    //            |                |  -+-
    //            |                |   |
    //            |           AVss |---+
    //
    //  T. Witt
    //  Texas Instruments, Inc
    //  September 2013
    //  Built with Code Composer Studio v5.5
    //******************************************************************************
    #include "msp430.h"
    
    /* Array to store SD24 conversion results */
    volatile int j, index = 0;
    volatile unsigned long sum = 0;
    unsigned long results[100];                     // Final results from running average
    
    /* Defines */
    #define SW_OVER_SAMPLING_FACTOR                 16
    
    /* Main Function */
    void main(void) {
        WDTCTL = WDTPW | WDTHOLD;                   // Stop WDT
    
        SD24CTL = SD24REFS;                         // Internal ref
        SD24INCTL0 = SD24GAIN_1;                    // Set gain on Channel 0
        SD24CCTL0 |= SD24IE;                        // Enable interrupt, OSR = 256 (default)
    
        __delay_cycles(3200);                       // Delay ~200us for 1.2V ref to settle
    
        SD24CCTL0 |= SD24SC;                        // Set bit to start conversion
        __bis_SR_register(GIE);                     // Enable interrupts
    
        while(1) {                                  // Loop endlessly, SET BREAKPOINT or PAUSE HERE
        }
    }
    
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=SD24_VECTOR
    __interrupt void SD24_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(SD24_VECTOR))) SD24_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        long temp = 0;
        switch (__even_in_range(SD24IV,SD24IV_SD24MEM3)) {
            case SD24IV_NONE: break;
            case SD24IV_SD24OVIFG: break;
            case SD24IV_SD24MEM0:
    
                // Capture ADC data
                SD24CCTL0 &= ~SD24LSBACC;           // Clear LSBACC bit
                temp = SD24MEM0;                    // Read upper 16 bits of SD24MEM0
                SD24CCTL0 |= SD24LSBACC;            // Set LSBACC bit
                temp = temp*256 + (SD24MEM0&0xff);  // Read lower 16 bits of SD24MEM0, combine with upper bits
    
                // Perform software oversampling
                sum+= temp;                         // Add result to running sum
                j++;
                if(j >= SW_OVER_SAMPLING_FACTOR) {  // Calculate and store average
                    results[index++] = sum/SW_OVER_SAMPLING_FACTOR;
                    sum = 0;
                    j = 0;
                }
    
                if(index >=100) {
                    index=0;
                }
                break;
            case SD24IV_SD24MEM1: break;
            case SD24IV_SD24MEM2: break;
            case SD24IV_SD24MEM3: break;
            default: break;
        }
    }

    Regards,

    James

  • Dear James,

    Thanks your code!
    since our operation is need to use to measure the range from 0V to 450mV, the gain 16 cannot measure the 450mV as our special requirement. (At my setting , I choose gain = 2)

    Best regards,
    Theo
  • Hi Hung,

    I'm sorry for the confusion. The factor of 16 in my code is the number of averaged samples (on software side). I'm summing the hardware samples then reporting the averaged result after a certain number of samples have been captured (here it's 16). My code is actually using a GAIN value of 1 (on hardware side). Does this make sense?

    Regards,

    James

**Attention** This is a public forum