I am creating a software for S32K118 (S32 Design Studio 2018.R1 in Windows 10) and one part of it requires reading ADC inputs.
Seems that S32K118 has only one ADC unit (ADC0) and one PDB unit (PDB0), this ok.
But the problem is how to actually read all those 16 ADC.
I have tried to using the ADC PDB back-to-back mode.
So when ADC0-ch0 is first SW triggered and its measurement is completed, it will trigger ADC0-ch1 and so on up to ADC0-ch7.
How do I now continue reading the rest, ADC0-ch8 to ADC0-ch15?
I been reading "S32K1xx Series Reference Manual S32K1XXRM, Rev 11. 06/2019", but it's not quite clear how to do this.
Not sure is it even possible to link all this 16 together, or is it only possible to link 2 different loops of 8 channels.
Preferred way for me would be
1) SW trigger the loop
2) when loop of 16 channels have finished measurement, then ADC_IRQ is triggered
3) read all 16 channels result inside the ADC_IRQ
4) re-trigger this full 16 channel again (with some function in coder or automatically as in "continuous mode", both ways are ok)
Attachment pdb-01: this loop looks good (S32K1xx Manual, page 1166), but there are PDB0 and PDB1, and S32K118 seem to have only PDB0?
Attachment pdb-02, 03, 04: PDB configuration
I was now able to get it working.
Both PDB0 ch0 and ch1 now in use and with correct delay values.
Source code became cleaner and most important, it works perfectly.
Thank you very much for quick help!
you would need to configure back-to-back chain on PDB0 ch1 too, but the ch1 pretrigger 0 must be delayed (using CH1DLY0) to be happen after chain on ch0 is finished.
You can refer to https://community.nxp.com/docs/DOC-343295 for this configuration.
Hope it helps.