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: How to turn of calibration at start up

Part Number: MSP430FR2522

Hi, I am using the FR2522 as a capacitive sensor by reading filterCount. The sensor will start sometimes in open air and sometimes in the presence of an object. I want to keep the calibration when starting in the presence of air so I don't get negative filterCount values. How would I turn of the start up calibration or get the startup calibration values and hard code them? How would I do this in CCS? I have already built a project and it would probably take longer If changes where made back in the captivate gui.

Cheers

Rick

  • This is how the prox sensor is already set, and I am getting the startup calibration problem when starting in the presence of material;

    tSensor PRX00 =
    {
        // Basic Properties
        .TypeOfSensor = eProx,
        .SensingMethod = eSelf,
        .DirectionOfInterest = eDOIDown,
        .pvCallback = NULL,
        .ui8NrOfCycles = 1,
        .pCycle = PRX00_Cycles,
        .pSensorParams = (tGenericSensorParams*)&PRX00_Params,
        // Conversion Control Parameters
        .ui16ConversionCount = 1000,
        .ui16ConversionGain = 80,
        .ui8FreqDiv = 1,
        .ui8ChargeLength = 1,
        .ui8TransferLength = 1,
        .bModEnable = true,
        .ui8BiasControl = 3,
        .bCsDischarge = true,
        .bLpmControl = false,
        .ui8InputSyncControl = 0,
        .bTimerSyncControl = false,
        .bIdleState = true,
        // Tuning  Parameters
        .ui16ProxThreshold = 60,
        .ui16NegativeTouchThreshold = 30,
        .ui16ErrorThreshold = 8191,
        .ui16TimeoutThreshold = 65535,
        .ProxDbThreshold.DbIn = 1,
        .ProxDbThreshold.DbOut = 0,
        .TouchDbThreshold.DbIn = 1,
        .TouchDbThreshold.DbOut = 0,
        .bCountFilterEnable = true,
        .ui8CntBeta = 1,
        .bSensorHalt = false,
        .bPTSensorHalt = true,
        .bPTElementHalt = true,
        .ui8LTABeta = 7,
        .bReCalibrateEnable = false,
    };

  • rawCount during run time is also adjusted based on startup calibration

  • FR2633_selfmode.zip

    You can refer to this code. It will record the calibration when the code first run.

  • Thanks Eason. I had trouble debugging the code, but it was still useful. I ended up running this one time after the normal start up calibration;

        extern tCaptivateElementTuning CapSensorTuning[4] =
    {
        { 251, 2, 11 },
        { 246, 2, 11 },
        { 218,  2, 12 },
        { 214, 2, 12 }
    };
        
        int i=0;
        for (i=0;i<4;i++){
            g_uiApp.pSensorList[0]->pCycle[0]->pElements[0]->pTuning[i]=CapSensorTuning[i];
        }

**Attention** This is a public forum