I am using S32K396 for motor control.
I need BCTU to tigger 4 ADC sample, ADC0-2 for current, ADC3 for DC voltage(Now the control board is designed linke this). The original trigger source is eFlexPWM.
In S32K396, ADC0-2 are connected with BCTU0, ADC3-7 are connected with BCTU1.
I need three current sampled in parallel, what interrupt should I use,BCTU0 interrupt,BCTU1 interrupt?
or I should use ADC2 to sample 1 current and DC voltage in serial?
note:
when interrupt is triggered, 4 sample should be all finished.
As I was told, I don't need DMA to transfer ADC data. DMA is used to transfer ADC data in demo code because they want to test DMA performance, it isn't necessary.
Solved! Go to Solution.
Hi,
yes, parallel conversion should be finished at a same time, assuming clock and ADC sample timing setting is same on each ADCs.
I can recommend to use FIFO as a result destination, then with using right FIFO watermark you will know all converted results are available in it.
BR, Petr
Hi,
it depends how BCTU triggers and conversion list are configured, but if there is just single trigger, then parallel conversion will happens normally and should be all finished at the same time. Then it does not matter what interrupt is selected. Anyway you should still check interrupt flags in interrupt to be sure result is ready in data registers or FIFOs.
BR, Petr
Hi,
yes, parallel conversion should be finished at a same time, assuming clock and ADC sample timing setting is same on each ADCs.
I can recommend to use FIFO as a result destination, then with using right FIFO watermark you will know all converted results are available in it.
BR, Petr
Hi,
I do not understand this question. Watermark specify how many stored results in FIFO trigger interrupt or DMA request. Then it should be read out in interrupt or by DMA.
BR, Petr
Hi,
if you have 8 ADC to be converted into same FIFO with watermark=2, then if you read 3 results from FIFO, the interrupt will be called twice.
BR, Petr