Hi
We use the Timer 1 Event Trigger to sample the ADC value and alert the main application when 120 samples are reached.
It started to run normally, but after some time(No more than 5 minutes), the sensor control will not alert the main application, but the main application still runs normally.
Please see the following code in detail:
//Initialization code
gpioClearOutput(AUXIO_O_GREEN_LED);
// Schedule the first execution
evhSetupTimer1Trigger(0, 128, 5); //1 Second
//Event Handler
// Select ADC input
adcSelectGpioInput(AUXIO_A_ADC_INPUT);
// Enable the ADC
adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);
adcGenManualTrigger();
U16 n = state.count;
adcReadFifo(output.adcTest);
state.count += 1;
//Reset the count
if (state.count == (BUFFER_SIZE)) {
state.count = 0;
}
if (n == (BUFFER_SIZE-1)) {
//For LED debug
state.test = ~state.test;
if (state.test == 0) {
gpioClearOutput(AUXIO_O_GREEN_LED);
} else {
gpioSetOutput(AUXIO_O_GREEN_LED);
}
fwGenAlertInterrupt();
}
adcFlushFifo();
// Disable the ADC
adcDisable();
evhSetupTimer1Trigger(0, 2, 0); //2K Sample Rate
SDK Version : 3.40
Sensor Control Studio Version : 2.6
Do you have any suggestions for us?
Thanks.
BR
Trevor