Skip to main content
FTrnp
Associate
February 14, 2019
Question

PROBLEM WITH PERIPHERAL POST-INCREMENT USING DMA - STM32F100VC

  • February 14, 2019
  • 3 replies
  • 1095 views

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 ??

    This topic has been closed for replies.

    3 replies

    waclawek.jan
    Super User
    February 15, 2019

    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

    FTrnp
    FTrnpAuthor
    Associate
    February 17, 2019

    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.

    waclawek.jan
    Super User
    February 17, 2019

    Thanks for the info.

    JW