I profiled the latency from ADC HWI to its SWI, below is the code
HWI
void ADCINT_ISR(void)
{
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
GpioDataRegs.GPBTOGGLE.bit.GPIO59 = 1;
SWI_post(&ADC_swi); // post a SWI
}
SWI
void AdcSwi(void)
{
GpioDataRegs.GPBTOGGLE.bit.GPIO49 = 1;
}
I captured GPIO59 and GPIO49 pin with an oscilliscope, the time difference between GPIO 59 and GPIO49 is 4us. But every 7 ADC interrupts, the latency will go up to 9us, so the latency pattern is 4us, 4us, 4us, 4us, 4us, 4us, 4us, 9us, 4us, 4us, 4us, 4us, 4us, 4us, 4us, 9us, 4us, ...
Does anyone encounter the similar situation? And my goal is to eliminate the latency spike.
Tim