Skip to main content
Explorer
October 2, 2024
Question

Need help fetching transfer complete interrupt with DMA and DAC

  • October 2, 2024
  • 2 replies
  • 1122 views

I'm trying to output a triangular wave, i'm very new to this so let me know if i'm doing anything wrong. 

I'm using stm32 f3 discovery board with stm32f303vc, I selected circular mode, started timer 7 with some frequency and update event mode, configured dma with channel 3 so it can go to dac channel 1. I'm trying to lookout for the transfer complete interrupt, when detected i'd like to increment dac channel 2 value. however i'm not sure how to look for the interrupt? i'm using HAL and i looked through the examples but i couldn't find how to enable the appropriate interrupt and how to look for it. 

I found a callbackmethod in dac.c that was weak type and i defined that in my main.c file and put a break point in it. but nothing happened i think because i haven't enabled the interrupt. 

I was also wondering if circular mode would be appropriate for my needs, is normal mode better for this? but i'm not sure who to trigger the dma manually. 

Any links to tutorials and helping material will be very appreciated. Thanks 

    This topic has been closed for replies.

    2 replies

    ST Employee
    October 2, 2024

    Hello @manhoosbilli1 ,

    Could you please check DAC_SignalsGeneration example available in our firmware package? You can find it under this path:

    STM32CubeF3/Projects/STM32F303RE-Nucleo/Examples/DAC/DAC_SignalsGeneration at master · STMicroelectronics/STM32CubeF3 · GitHub

     

    With regards,

    Explorer
    October 16, 2024

    Thanks for pointing that out. For some reason I can't see in my stm32 file tree such an examples folder. But upon inspection in github space i found that while there are examples that deal with DMA and DAC seperately. There isn't one that deals with them in union like there is for Flash to RAM with DMA i think I'd need something that will deal with peripheral. All further advice will be appreciated. 

     

    Regards, 

    Shoaib,

    Undergraduate Physics, 

    COMSATS Islamabad, Pakistan

    ST Employee
    November 12, 2024

    Hello @manhoosbilli1 ,

    Although there may not be an available example that combines DMA and DAC, you can create one by merging distinct examples. For this process, I highly recommend using STM32CubeMX as it helps you to configure peripherals and generates necessary initialization code for you.

     

    With regards,