I have two SWV settings (low freq) and (high freq). I always have had a hard time understanding how to correctly calculate when to sample the current using the sample delay variable. The repo states the equation is < (1/Frequency)/2 - 0.2*/.
If Frequency = 25 hz then sample delay = (1/25)/2 - 0.2 = -0.18 ms?
If Frequency = 300 hz then sample delay = -0.19 ms?
Generally does this mean we do not change this variable? My parameter at low freq 25 hz is set to 2.0f (ms) and seemingly works ok.
Here is the code:
pRampCfg->SeqStartAddr = 0x10; /* leave 16 commands for LFOSC calibration. */
pRampCfg->MaxSeqLen = 1024 - 0x10; /* 4kB/4 = 1024 *
pRampCfg->RcalVal = 10000.0; /* 10kOhm RCAL*/
pRampCfg->ADCRefVolt = 1820.0f; /* The real ADC reference voltage. Measure it from capacitor C12 with DMM. */
pRampCfg->FifoThresh = 1; /* Maximum value is 2kB/4-1 = 512-1. Set it to higher value to save power. original 480 */
pRampCfg->SysClkFreq = 16000000.0f; /* System clock is 16MHz by default */
pRampCfg->LFOSCClkFreq = LFOSCFreq; /* LFOSC frequency */
pRampCfg->AdcPgaGain = ADCPGA_1P5;
pRampCfg->ADCSinc3Osr = ADCSINC3OSR_4; //
/* Step 2:Configure square wave signal parameters */ LOW FREQUENCY
pRampCfg->RampStartVolt = 0.0f; /* -1.4V */
pRampCfg->RampPeakVolt = 600.0f; /* -0.1V */
pRampCfg->VzeroStart = 1300.0f; /* 1.3V */
pRampCfg->VzeroPeak = 1300.0f; /* 1.3V */
pRampCfg->Frequency = 25; /* Frequency of square wave in Hz */
pRampCfg->SqrWvAmplitude = 50; /* Amplitude of square wave in mV */
pRampCfg->SqrWvRampIncrement = 4; /* Increment in mV*/
pRampCfg->SampleDelay = 2.0f; /* 10ms. Time between update DAC and ADC sample. Unit is ms. */
pRampCfg->LPTIARtiaSel = LPTIARTIA_1K; /* Maximum current decides RTIA value */
pRampCfg->bRampOneDir = bTRUE;
===========================================
/* Step 2:Configure square wave signal parameters */ HIGH FREQUENCY
pRampCfg->RampStartVolt = 0.0f; /* -1.4V */
pRampCfg->RampPeakVolt = 600.0f; /* -0.1V */
pRampCfg->VzeroStart = 1300.0f; /* 1.3V */
pRampCfg->VzeroPeak = 1300.0f; /* 1.3V */
pRampCfg->Frequency = 300; /* Frequency of square wave in Hz */
pRampCfg->SqrWvAmplitude = 25; /* Amplitude of square wave in mV */
pRampCfg->SqrWvRampIncrement = 5; /* Increment in mV*/
pRampCfg->SampleDelay = 0.2f; /* 10ms. Time between update DAC and ADC sample. Unit is ms. */
pRampCfg->LPTIARtiaSel = LPTIARTIA_1K; /* Maximum current decides RTIA value */
pRampCfg->bRampOneDir = bTRUE;//bTRUE; /* Only Measure Ramp in One Direction leave as true - omeed */
pRampCfg->floor = 0;
Added the part number to the product page
[edited by: JEstayo at 1:42 AM (GMT -5) on 4 Mar 2024]