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.

EVM430-FR6043: what is the purpose of SAPH_AATM_E = restartCaptureCount?

Part Number: EVM430-FR6043

What's the difference between ussMeasurementConfig.restartCaptureCount and ussMeasurementConfig.restartLowPowerCaptureCount?

They are defined into UltrasonicGasFR6043_02_30_00_01\include\ussSwLib.h as:

typedef struct _USS_Measurement_Configuration_
{
uint_least16_t restartCaptureCount;
//!< This count determined the time to trigger next capture. This
//!< count is based on <b>16 ASQ clock= (HSPLL_CLOCK_FREQ/256)</b> period.
//!< For examples if turnOnADCCount = 15 and ASQ clock is 68 MHz, then next
//!< capture will be triggered \n
//!< (16/ASQ_clock_freq)*(16)*(startADCsamplingCount) = (16/68MHz)*(16)*(15)
//!< = 56.4 usec\n
//!< after acquisiton sequence has been triggered. \n\n
//!< \"restartCaptureCount\" valid range (0x0002 - 0xFFFF)
//!< \n \n <b>Registers modified:</b> <i>SAPH.ATM_E.TimeMarkE</i>

uint_least16_t restartLowPowerCaptureCount;
//!< This should be calculated using the following formula
//!< restartLowPowerCaptureCount=F1/F2*restartCaptureCnt where (F1=PLL/16, F2=32k)

} USS_Measurement_Configuration;

And they are both initialized with the same timing:

1. restartCaptureCount = USS_RESTART_CAP_COUNT = (USS_PLL_FREQ * USS_RESTART_CAP_COUNT_SEC) / 256 = (80e6 * 8.000E-3) / 256 = 640e3 / 256 = 2500
and restartCaptureCount is ticked by 80MHz PLL out / (16*16) => tick period = 3.2usec => timer period = 3.2usec * 2500 = 8000 usec = 8 ms.
This is used to initialize SAPH_AATM_E which is suppose to "Restart the time counter for the next measurement".

2. restartLowPowerCaptureCount = USS_LOW_POWER_RESTART_CAP_COUNT = USS_LFXT_FREQ_IN_HZ * USS_RESTART_CAP_COUNT_SEC = 32768 * 8.000E-3 = 262
and restartLowPowerCaptureCount is ticked by LF 32768Hz => tick period = 30.52us => timer period = 30.52us * 262 = 7995.6 usec = 8ms.
This is used as parameter for the first USS_commonTriggerSingleCapture(CH0, restartLowPowerCaptureCount) call, which is the UPS measurement, and acts as a delay before the second USS_commonTriggerSingleCapture(CH1, 0) call, which is the DNS measurement.
And indeed this seems to create the delay between DNS and UPS.
I tested that when I modify restartLowPowerCaptureCount=262*2 or 262/2 then the delay modifies to 16ms respectively 4ms, while I kept restartCaptureCount=8ms, which looks like restartCaptureCount has no influence?

So the question is what is the purpose of restartCaptureCount? From the description I understood that ASQ should restart by itself the next capture after SAPH_AATM_E, is it so?
But it seems that in the UltrasonicGasFR6043 demo there is only one capture (the UPS) and then after restartLowPowerCaptureCount, the next one (the DNS) is manually retriggered?
Is there some explanations about this architecture choice?
Is it possible to tell ASQ to do the both UPS and DNS captures by itself using SAPH_AATM_E and not using the restartLowPowerCaptureCount manual delay trick?

Thanks,

Daniel

  • Hi,

    So the question is what is the purpose of restartCaptureCount? From the description I understood that ASQ should restart by itself the next capture after SAPH_AATM_E, is it so?

    Yes, it is. 

    But it seems that in the UltrasonicGasFR6043 demo there is only one capture (the UPS) and then after restartLowPowerCaptureCount, the next one (the DNS) is manually retriggered?

    Yes. The library only uses the restartLowPowerCaptureCount in the code. This is from the perspective of power saving. The MCU enters LPM mode after capture UPS channel. And then wait for the delay time to wakeup and captures the DNS channel. 

    Is it possible to tell ASQ to do the both UPS and DNS captures by itself using SAPH_AATM_E and not using the restartLowPowerCaptureCount manual delay trick?

    I think it is possible. But we do not have reference code how to configure the SAPH to capture automatically without this delay. 

    Best regards,

    Cash Hao

**Attention** This is a public forum