-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing DMA for DAC #50
Comments
Almost there ;-) First off, you should be using circular DMA instead of oneshot. Use the half-done / full-done to implement a simple double buffered scheme. In DAC->CR, you need to enable an external trigger (no underrun or such). The external trigger (TSEL) should be set to TIM7_TRIG. TIM7 is used for Tone()/noTone(), so it seems appropriate to use that one. You can look at the stm32l4_wiring_tone.c code to see how it's kind of used, except you don't need to interrupt callback. |
Thanks for the help GrumpyOldPizza. I have implement the Timer7 at 1MHZ and enabled the appropriate TSEL and TEN1. The DAC appears to be working off that source now. Plugging values into the second channel (DHR12R2) transfer correctly. With a circular DMA how does it know when to do transfers? Do i need to point the Timer 7 to the DMA as well? Here is the code so far.
|
So it seems that calls to the DAC take quite a bit of time so I would like to implement DMA transfers.
I tried my hand to use your DMA library but I cant seem to get it to fire. My code will complile but nothing happens :/
DMA feeding DAC code:
The text was updated successfully, but these errors were encountered: