Can I use TIM7 for DAC1 Channel1 and TIM6 for DAC1 Channel2 (two different timers..) ?
Second question, there is HAL_DAC_ConvCpltCallbackCh1 however I cannot find HAL_DAC_ConvCpltCallbackCh2, does it exist for the DAC1Channel2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-16 3:54 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 9:54 AM
- See the DAC chapter of given family's Reference Manual. Look at the registers. Is there a separate item to select trigger for both DAC channels? If yes, that means that you can use different trigger sources for the two different DAC channels.
- https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac.c#L223 : user can add his own code by customization of function pointer HAL_DAC_ConvCpltCallbackCh1() or HAL_DACEx_ConvHalfCpltCallbackCh2(). Note the extra "Ex" in the name and that whomever wrote that sentence, copy/pasted it from above and forgot to omit the "Half". HAL_DACEx_ConvCpltCallbackCh2() is indeed defined (as weak), and called in https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac_ex.c#L587
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-16 4:56 PM
Which STM32?
If 'F2/'F4, then answer to first question is yes.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 3:10 AM
Hi VNado.1,
- Yes, you can. Please refer to the STM32CubeXX FW package, where XX is the product you are working with. You can find DAC examples.
- Yes it exists. Please refer to the hal_dac drivers in the STM32CubeXX FW package
Best Regards,
Ons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 7:43 AM
It is a L4+. I guess it also works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 9:54 AM
- See the DAC chapter of given family's Reference Manual. Look at the registers. Is there a separate item to select trigger for both DAC channels? If yes, that means that you can use different trigger sources for the two different DAC channels.
- https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac.c#L223 : user can add his own code by customization of function pointer HAL_DAC_ConvCpltCallbackCh1() or HAL_DACEx_ConvHalfCpltCallbackCh2(). Note the extra "Ex" in the name and that whomever wrote that sentence, copy/pasted it from above and forgot to omit the "Half". HAL_DACEx_ConvCpltCallbackCh2() is indeed defined (as weak), and called in https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac_ex.c#L587
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 2:29 PM
- This is what I found in the manual,
"Dual DAC channel independent or simultaneous conversions
• External triggers for conversion
The DAC channels are triggered through the timer update outputs that are also connected to different DMA channels."
2. I also saw this, but I wasn't sure if it was an error or something I was missing out.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-18 3:13 AM
Hi VNado.1,
In case your question is answered, please mark it by selecting the best answer.
Best Regards,
Ons.
