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.

MSP430FR2672: Changing capTIvate tuning parameters at runtime

Part Number: MSP430FR2672

So I am manually try to manage the tuning configuartaions and have setup a PERSISTENT variable that defines which tuning to use.  This variable can be set by another processor and it is retained through power cycles.  in main I look a the variable to see which tuning should be used and then call a function to change the parameters that are different.

void AdjustForTuning(uint8_t tuning_mode)
{
switch(tuning_mode)
{
default: // default = model = C; System tuning. 
case C_PLASTICS:
SLD00_E00.ui8TouchThreshold = 5;
SLD00_E01.ui8TouchThreshold = 5;
SLD00_E02.ui8TouchThreshold = 5;
SLD00_E03.ui8TouchThreshold = 5;
SLD00_Params.SliderBeta = 200;
SLD00.ui16ConversionCount = 850;
SLD00.ui8FreqDiv = 4;
SLD00.ui16ProxThreshold = 50;
SLD00.ui16NegativeTouchThreshold = 100;
g_uiApp.ui16WakeOnProxModeScanPeriod = 100;
break;

case C_OPEN_AIR:
SLD00_E00.ui8TouchThreshold = 9;
SLD00_E01.ui8TouchThreshold = 10;
SLD00_E02.ui8TouchThreshold = 10;
SLD00_E03.ui8TouchThreshold = 10;
SLD00_Params.SliderBeta = 100;
SLD00.ui16ConversionCount = 650;
SLD00.ui8FreqDiv = 3;
SLD00.ui16ProxThreshold = 14;
SLD00.ui16NegativeTouchThreshold = 30;
g_uiApp.ui16WakeOnProxModeScanPeriod = 103;
break;
}

return;

}

Using the debugger I see the variables do change and stay at the values requested, but the tuning always seem to use the values that were generated in "CAPT_UserConfig.c"

How do I get capTIvate to use the changed parameters?  I assume the parameters are being copied into some library function before I actually call my function to change them.

Jon

  • Hi Jon,

    Before each measurement, the next cycle configuration (which can include from 1 to 4 channels) is read from the sensor structs in CAPT_Userconfig.c, then those values are loaded into the Captivate peripheral. So as long as you modify those sensor structs, your changes should replace the previous settings and be used for subsequent measurements.  This is how the Captivate Design Center GUI is able to modify tuning parameters in real-time. Sending new values should replace the previous value in the struct and when its time to measure or calibrate, those new settings will be used.

    So for your C_PLASTICS case, you are saying if you change from .ui16ConversionCount = 200 to 100 in real time,  then when you stop and examine those structs you are seeing .ui16ConversionCount remains at 100, correct?

  • Yes, I see that the value has changed, but it does not have impact on the tuning.

  • Let's try this...First, set reasonable parameters to start with.  Always set the conversion gain to 100. Set the conversion count to 250.

    Start the application and let it perform the normal calibrations. Not sure how you are reading the real-time data, but you should read ~250 for the measured conversion count, LTA, etc and if you put your finger on the electrode, the count should go lower.

    Then have the application change the .ui16ConversionCount to say 300.  Have the application force a re-calibration.  Does the reported measured conversion count now ~300?

  • Hi Jon,

    Do you have an update on your progress?

**Attention** This is a public forum