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, change PRX00.ui16ConversionGain in main loop

Part Number: MSP430FR2522

How do I change PRX00.ui16ConversionGain (from CAPT_UserConfig.c) in the main loop so the microcontroller uses the updated value? When it gets a new value, it doesnt change the gain being used, its like this value is used once at power up then then any changes are ignored. I don't know how update the runtime value. I want scale the prox signal directly based on a pot reading without having waste computation time scaling filterCount.ui16Natural with a float.


// Run the captivate application handler.

PRX00.ui16ConversionGain = 64 + rawPOTADC>>6;//this doesnt change the gain


} // End background loop


  • Hi Rick,

    Can you check if your Structure is the PRX00.ui16ConversionGain? Or please check if your structure has defined in the CAPT_UserConfig.h .

    I do the same test, but the ConversionGain value change.

  • Hi Joe, Yes, it changes in that structure, but the it doesn't affect the final result - PRX00.pCycle[0]->pElements[0]->filterCount.ui16Natural, because the value isn't the working value its just the initialized value that is no longer read from after the controller starts. Changing the gain while the microcontroller is running  doesn't effect the filtercount because its loaded once at the start. I was hoping there was a way to change it during run time that would have an effect on the touch pad reading. 

  • Hi Rick,

    I can change the value of Sense.ui16ConversionGain to 50. Maybe you can check you "CAPT_UserConfig.h" , add the structure(PRX00 in you code)

    Best regard


**Attention** This is a public forum