Hi, xiangjun.rong
Thanks for your reply. By synchronization, I mean a trigger on the edge of the signal, as in an oscilloscope (see attached picture). I call it synchronization so that there is no confusion with the start trigger of HSADC.

In the chart above, the trigger is set to the position x = 0, y = 0, and if there were no delay the signal would cross this point. However, the signal crossed the point x = -120, y = 0, respectively, we have a delay of 120 samples of HSADC.
I’ll try to explain the problem with an example.
We set up the HSADC threshold level as follows:
#define TRIGGER_LEVEL_DEF (HSADC_MAX_SAMPLEVAL / 2)
Chip_HSADC_SetThrLowValue(LPC_ADCHS, 0, TRIGGER_LEVEL_DEF);
Chip_HSADC_SetThrHighValue(LPC_ADCHS, 0, TRIGGER_LEVEL_DEF);
Chip_HSADC_EnableInts(LPC_ADCHS, 1, (HSADC_INT1_THCMP_UCROSS(0)));
In the HSADC interrupt handler, we simply switch the debug output of the microcontroller:
__RAM_FUNC void ADCHS_IRQHandler(void)
{
LPC_GPIO_PORT->B[3][7] = 1;
LPC_GPIO_PORT->B[3][7] = 0;
uint32_t status = Chip_HSADC_GetIntStatus(LPC_ADCHS, 1) & Chip_HSADC_GetEnabledInts(LPC_ADCHS, 1);
Chip_HSADC_ClearIntStatus(LPC_ADCHS, 1, status);
}
We connected the first channel (yellow beam) of the external oscilloscope to the input of the HSADC, and the second channel (blue beam) to the debug output of the microcontroller. You can see in the figure below a delay of about 1.5 μs between the crossing of the threshold level of the HSADC and the triggering of the interrupt.

P.S. During the check, we noticed that when we turn on code optimization (O3), the delay decreases to 250 ns (see the picture below), but this is also a lot and the code works with errors.
