2017-02-27 03:06 PM
Device: STM32F437
The code I am working on was setup to use interleaving but after doing some reading I get the impression that interleaving is only for multiple ADCs and we are using 2 channels on ADC3. So it seems we should use ADC_Mode_Independent. It is still not working and at least 3 questions come to mind.
Is interleaving only for multiple DMAs?
Can ADC_RegularChannelConfig() be used in non-interleaved mode? I changed .ADC_Mode to ADC_Mode_Independent but the data still seems interleaved.
We are using 2 channels on ADC3 with DMA interrupts but there is only one interrupt for DMA2 stream 0. When will the interrupt occur, after one channel is transferred or both? Is this the purpose of ADC_DMARequestAfterLastTransferCmd()?
Thanks,
JH
2017-02-27 03:38 PM
Interleaved might be better described as overlapping, where the sampling/conversion switch between a pair of ADC so the sustained throughput increases. You'd typically use One DMA channel, Two ADC, and read both samples via the CDR (Common Data Register), so a 32-bit read of two 16-bit registers.
Dual (ADC1 and ADC2) or Triple (ADC1, ADC2 and ADC3) mode is where the 2 or 3 samples share a common measurement epoch.
Interleave (ADC1 and ADC2), tighter sampling than ADC with multiple channels or continuous
2017-02-27 10:28 PM
For fun, was building a different SW low level APIs for STM32F437 where the 'spec' of the peripheral was C coded and buried in the code itself, leaving the programmer to just express their needs using application level terms. Here is an extract of this effort. Consider it as pseudo code. The interleave or any ADC cascading to boost the sampling rate goes above this ADC object (and did not take the time for it). In case it helps.
________________ Attachments : Adc.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyro&d=%2Fa%2F0X0000000bDL%2FuCk3LmsQMkUbc3Jw1zsaJfVwlBk9eJamK5bmX2FAt.g&asPdf=falseAdc.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyqc&d=%2Fa%2F0X0000000bDH%2F0MAINHIWKW.CwrvV9uxfVPzCH5na352IfxqTMbkoImQ&asPdf=false