Skip to main content
infor
Associate III
May 7, 2015
Question

Problems using DMA on DAC channel 2

  • May 7, 2015
  • 2 replies
  • 644 views
Posted on May 07, 2015 at 11:17

I am experimenting STM32F429 on a discovery board.

After creating set board settings with STM32CubeMX, I created a few lines to generate a wave on DAC channel 2 using DMA.

Everything seems correct in the registers, but I see no changing values. On the other hand, if I push directly the values calling HAL_DMA_SetValue() everything works fine.

Any hints?

    This topic has been closed for replies.

    2 replies

    infor
    inforAuthor
    Associate III
    May 7, 2015
    Posted on May 07, 2015 at 13:00

    Perhaps the problem was a misinterpretation of the datasheet.

    In facts, it seems that the DMA needs an external trigger, for example from a timer, to feed new values to the DAC. This peripheral itself cannot control the DMA transfer, so setting PFCTRL bit has no effect.

    waclawek.jan
    Super User
    May 7, 2015
    Posted on May 07, 2015 at 13:31

    > This peripheral itself cannot control the DMA transfer, so setting PFCTRL bit has no effect.

    ''control'' is a misleading term here (as in naming of PFCTRL as well). I'd prefer to clearly distinguish in terminology the ''DMA request'' signal (which DAC is capable to, but only after being triggered as you said above) from ''DMA external stop'' or something similar, which is what PFCTRL is gating at the DMA side.

    We all know that the documentation suc^H^H^Hleaves a lot to be desired. That Cube/CubeMX/SPL introduces further terminology pearls is just an added malus, and a well-deserved punishment for those who use them... ;)

    JW