Hi,
I use ADC0, ADC1, PDB0, PDB1 to convert ADC bandgap voltage at the same time. The CPU is S32K146. In some boards, the value converted by ADC1 is lower than ADC0. Can ADC0 and ADC1, or PDB0 and PDB1 be used at the same time?
The ADC bus clock is SIRCDIV2, conversion clock is input clock/2, trigger mode is HW trigger. System clock is FIRC.
PDB0 and PDB1 use same config:
PCC->PCCn[PCC_PDB0_INDEX] |= PCC_PCCn_CGC_MASK;
PDB0->SC |= PDB_SC_TRGSEL(0xF) | PDB_SC_PRESCALER(1) |PDB_SC_MULT(0) | PDB_SC_PDBEN_MASK;
PDB0->CH[0].C1 |= PDB_C1_BB(0xFE) | PDB_C1_TOS(0x00) | PDB_C1_EN(0xFF);
PDB0->SC |= PDB_SC_LDOK_MASK;
Then I enable sw trigger of PDB0 and PDB1 at the same time and read the result:
PDB0->SC |= PDB_SC_SWTRIG_MASK;
PDB1->SC |= PDB_SC_SWTRIG_MASK;
while(((ADC1->SC1[7] & ADC_SC1_COCO_MASK)>>ADC_SC1_COCO_SHIFT) == 0);
rawvalue0 = ADC0->R[1];
rawvalue1 = ADC1->R[1]