Hello Edgar,
Thank you for the additional information.
There are several ways to do it.
You can use either the Back-to-back One-Shot mode as shown in the below examples and then trigger the PDB back-to-back mode again with a SW trigger.
Example S32K144 PDB ADC back-to-back test S32DS12
Example S32K144 PDB ADC trigger DMA ISR S32DS
Or use the Back-to-back Continues mode.
For example: Initial SW trigger, first ADC conversion triggered by DLY[0], then back-to-back.
However, you need to read all the ADC result register to clear the COCO flags before the PDB back-to-back operation gets triggered again, before it reaches MOD.
void PDB_Init(void)
{
PCC->PCCn[PCC_PDB0_INDEX] |= PCC_PCCn_CGC_MASK;
PDB0->SC |= PDB_SC_TRGSEL(0xF) |
PDB_SC_PDBEN_MASK;
PDB0->CH[0].C1 |= PDB_C1_BB(0x1E) | PDB_C1_TOS(0xFF) | PDB_C1_EN(0x1F);
PDB0->MOD = FFFF;
PDB0->CH[0].DLY[0] = 1;
PDB0->SC |= PDB_SC_LDOK_MASK;
}
Also, you can use the PDB interrupt (configured by PDB_IDLY < MOD) and read the ADC results.
Or you could use the delay registers for all ADC channels.
Regards,
Daniel