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.

MSP430FR2676: Measure SNR without GUI

Part Number: MSP430FR2676

Hi,

My customer want measure SNR without "Design center GUI" because the structure of their application makes it impossible to connect wiring for communication.

How do they measure SNR without GUI?

Best regards,
Sasaki

  • Hi Sasaki,

    Which SNR? ADC module? or others?

    Could you help to provide more details about this?

    Thanks!

    Best Regards

    Johnson

  • I think it will be easier to answer if you share more details. Like which hardware you're using etc.

  • Hi Johnson-san,

    It's the SNR of the GUI below.

    They want to do this "Measure SNR" without a GUI

    Best regards,
    Sasaki

  • Zain-san,

    Hardware : Customer's original board(mutual button)

    Software : CCSv11.2,  Design Center v1.83

    I will check if there is any other information you need

    Best regards,
    Sasaki

  • Hi Sasaki,

    This function is design for check if the hardware design is good, thus I think offline function is OK.

    Why customer need this function without GUI?

    Thanks!

    Best Regards

    Johnson

  • Hi Hohnson-san,

    Thank you for your repoly.

    Why customer need this function without GUI?

    The structure of their application makes it impossible to connect wiring for communication.

    Best regards,
    Sasaki

  • Hi Sasaki,

    It is difficult for porting SNR Measure function from GUI to MCU, but there are another method can read the Noise Level in MCU:

    SNR.c
    /* --COPYRIGHT--,BSD
     * Copyright (c) 2017, 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.
     * --/COPYRIGHT--*/
    //*****************************************************************************
    // Development main.c for MSP430FR2522 and MSP430FR2512 CapTIvate devices.
    //
    // This starter application initializes the CapTIvate touch library
    // for the touch panel specified by CAPT_UserConfig.c/.h via a call to
    // CAPT_appStart(), which initializes and calibrates all sensors in the
    // application, and starts the CapTIvate interval timer.
    //
    // Then, the capacitive touch interface is driven by calling the CapTIvate
    // application handler, CAPT_appHandler().  The application handler manages
    // whether the user interface (UI) is running in full active scan mode, or
    // in a low-power wake-on-proximity mode.
    //
    // \version 1.80.00.30
    // Released on March 26, 2019
    //
    //*****************************************************************************
    
    #include <msp430.h>                      // Generic MSP430 Device Include
    #include "driverlib.h"                   // MSPWare Driver Library
    #include "captivate.h"                   // CapTIvate Touch Software Library
    #include "CAPT_App.h"                    // CapTIvate Application Code
    #include "CAPT_BSP.h"                    // CapTIvate EVM Board Support Package
    #include "AJB.h"
    #include "CAPT_EMC.h"
    #include "CAPT_Type.h"
    
    char NoiseState = 0;
    uint16_t NoiseLevel = 0;
    uint16_t NoiseCount = 0;
    uint16_t buffer[2];
    
    void EMCLevel_Change(void)
    {
        if(NoiseState == 3)
        {
            g_EMCConfig.selfModeOversamplingStyle = e16xOversampling;
            g_EMCConfig.coeffA = _IQ31(0.01087),
            MAP_CAPT_loadEMCConfig(&g_EMCConfig);
    //        BTN00.ui8CntBeta = 2;
    //        BTN00_E00.ui8TouchThreshold = 5;
    //        BTN00_E01.ui8TouchThreshold = 5;
    //        BTN00_E02.ui8TouchThreshold = 5;
    //        BTN00_E03.ui8TouchThreshold = 5;
        }
        else if(NoiseState == 2)
        {
            g_EMCConfig.selfModeOversamplingStyle = e16xOversampling;
            g_EMCConfig.coeffA = _IQ31(0.01088),
            MAP_CAPT_loadEMCConfig(&g_EMCConfig);
    //        BTN00.ui8CntBeta = 2;
    //        BTN00_E00.ui8TouchThreshold = 5;
    //        BTN00_E01.ui8TouchThreshold = 5;
    //        BTN00_E02.ui8TouchThreshold = 5;
    //        BTN00_E03.ui8TouchThreshold = 5;
        }
        else if(NoiseState == 1)
        {
            g_EMCConfig.selfModeOversamplingStyle = e16xOversampling;
            g_EMCConfig.coeffA = _IQ31(0.01092),
            MAP_CAPT_loadEMCConfig(&g_EMCConfig);
    //        BTN00.ui8CntBeta = 2;
    //        BTN00_E00.ui8TouchThreshold = 7;
    //        BTN00_E01.ui8TouchThreshold = 7;
    //        BTN00_E02.ui8TouchThreshold = 7;
    //        BTN00_E03.ui8TouchThreshold = 7;
        }
        else
        {
            g_EMCConfig.selfModeOversamplingStyle = e4xOversampling;
            g_EMCConfig.coeffA = _IQ31(0.01092),
            MAP_CAPT_loadEMCConfig(&g_EMCConfig);
    //        BTN00.ui8CntBeta = 2;
    //        BTN00_E00.ui8TouchThreshold = 6;
    //        BTN00_E01.ui8TouchThreshold = 6;
    //        BTN00_E02.ui8TouchThreshold = 6;
    //        BTN00_E03.ui8TouchThreshold = 6;
        }
    }
    uint16_t lastnoiseState= 0;
    void EMCLevel_Evaluation(void)
    {
        NoiseLevel = CAPT_getGlobalFilteredNoiseLevel();
        lastnoiseState = NoiseState;
        if( NoiseLevel>60)
        {
            NoiseState = 3;
        }
        if( NoiseLevel>46)
        {
            NoiseState = 2;
        }
        if( NoiseLevel>5)
        {
            NoiseState = 1;
        }
        else
        {
            NoiseState = 0;
        }
        if (NoiseState != lastnoiseState)
            EMCLevel_Change();
    }
    
    void main(void)
    {
        //
        // Initialize the MCU
        // BSP_configureMCU() sets up the device IO and clocking
        // The global interrupt enable is set to allow peripherals
        // to wake the MCU.
        //
        WDTCTL = WDTPW | WDTHOLD;
        BSP_configureMCU();
        Panel_Init();
        __bis_SR_register(GIE);
    
        //
        // Start the CapTIvate application
        //
        CAPT_appStart();
    
        //
        // Background Loop
        //
        while(1)
        {
            //
            // Run the captivate application handler.
            //
    
            CAPT_appHandler();
    
    //
            NoiseLevel = CAPT_getGlobalFilteredNoiseLevel();
    //        buffer[1] = NoiseState;
            buffer[0] =  NoiseLevel;
            CAPT_writeGeneralPurposeData(&buffer[0], 1);
    
            //
            // This is a great place to add in any
            // background application code.
            //
            __no_operation();
    
            //
            // End of background loop iteration
            // Go to sleep if there is nothing left to do
            //
    
        } // End background loop
    } // End main()
    

    Step1: Enable noise immunity 

    Step2: Run CAPT_getGlobalFilteredNoiseLevel();

    Thanks!

    Best Regards

    Johnson

  • Hi Johnson-san,

    Thank you for your support.

    I will contact the customer with this information.

    Thanks!

    Sasaki

**Attention** This is a public forum