2019-02-14 02:01 PM
Hi,
I am using DMA to transfer the conversion of two injected channels of the ADC module (registers ADC1_JDR1 & ADC1_JDR2) to a buffer in ram. The conversion is started by software (JSWSTART).
Since the transfer is for two consecutive records, I have set the following configuration:
DMA1_CCR1:
MINC = 1
PINC = 1
DIR = 0
EN = 1
DMA1_CNDTR1 = 2
DMA1_CPAR1 = &ADC1_JDR1
DMA1 _CMAR1 = &buffer_ram
Unexpectedly only the record ADC1_JDR1 is transferred, although Number of Data Transfer is 2.
Only for test purposes I have changed PINC = 0 and then the record ADC1_JDR1 is transferred 2 times, as expected.
What is wrong ??
2019-02-15 11:36 AM
In the case of PINC=1, what exactly happens - you see content of ADC1_JDR1 in buffer_ram[0] and unchanged content of buffer_ram[1]? What is in the status bits of DMA?
JW
2019-02-17 05:03 AM
Yes,
with PINC=1:
buffer_ram[0] = ADC1_JDR1
buffer_ram[1] = Unchanged
with PINC=0
buffer_ram[0] = ADC1_JDR1
buffer_ram[1] = ADC1_JDR1
However, I have seen in the reference manual that only the conversion of the regular channels triggers dma !!!. Injected channels don't. Therefore, I don't know what I was seeing.
I have changed the software to use the end-of-conversion interrupt (JEOC) and it works fine.
Thanks for the reply.
2019-02-17 12:09 PM
Thanks for the info.
JW