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.

MSP430FR2522: Captivate Noise Threshold

Part Number: MSP430FR2522

Dear MSP430 team,

my customer designs with MSP430FR2252 and he wants to read out the noise detected status flag.

Do you have a recommended procedure for this?

Can you provide some example software?

Thanks and best regards,

Joe

  • Hi,

    Noise flag is here, belong to tElement.

    //! The noise detected flag indicates that noise was found on the channel.
    //
    bool bNoiseDetected : 1;

    I think you can also use this function instead:

    NoiseLevel = CAPT_getGlobalFilteredNoiseLevel();

    Eason

  • Hallo Eason,

    have you got any software example how i can use the bNoiseDetected flag in combination with an callback?

    My own example code does not work, because of the flag ist not in the struct.

    Thanks

    Greetings

    Markus

    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();
    	__bis_SR_register(GIE);
    
    	//
    	// Start the CapTIvate application
    	//
    	CAPT_appStart();
    
    	//
    	/* Adding Callbacks for pairing-button, proximity */
    	//
    	MAP_CAPT_registerCallback(&Proximity, &my_proximity_callback);
    
    	//
    	// Background Loop
    	//
    	while(1)
    	{
    
    	    CAPT_appHandler();
    
    		//
    		// 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
    		//
    		CAPT_appSleep();
    		
    	} // End background loop
    } // End main()
    void my_proximity_callback(tSensor* pSensor)
    {
        if(pSensor->bNoiseDetected == true)
        {
            LED1_ON;
            __delay_cycles(5000);
            LED1_OFF;
            __delay_cycles(10000);
            LED1_ON;
            __delay_cycles(20000);
            LED1_OFF;
            __delay_cycles(10000);
            LED1_ON;
            __delay_cycles(5000);
            LED1_OFF;
        }
        else
        {
            if(pSensor->bSensorProx == true)
            {
                LED1_ON;
    
            }
            else
            {
                LED1_OFF;
    
            }
        }
    }

  • Here is an example:

    pSensor->pCycle[i]->pElements[j]->bNoiseDetected

    But I think it will be much easy if you use CAPT_getGlobalFilteredNoiseLevel();

**Attention** This is a public forum