2025-02-25 2:26 AM
Hi there
I'm working on a project where I need to create 4 different pulse trains on 4 different GPIO pins
I've created and formatted a uint32_t array to be able to directly write to the GPIO BSRR register
I want to use DMA memory to peripheral in circular mode
To trigger the DMA transfer I need to pick a timer
According the the drawing on page 151 in the reference manual for STM32F030F4P6 it looks like there are trigger inputs from the basic timers TIM14, TIM16 & TIM17 to trigger the DMA transfer
But all the examples I've been able to find in videos and in descriptions are all using advanced timers and are using an trigger event TRGO to trigger the transfers of new data from memory to GPIO port at fixed intervals
When I'm looking on the setting options for these basic timers TIM14, TIM16 & TIM17, I do not have any option for an trigger event (TRG0) from these timers. I'm only able to pick Input Capture, Output Compare & PWN generation from the available options in CubeMX
Can these basic times be used for my project, or do I need to use one of the advanced timers that do have the TRGO setting.
And if so, please explaing how these basic timers can be used. Which settings etc.
Br Steen
2025-02-25 2:54 AM
> all the examples I've been able to find in videos and in descriptions are all using advanced timers and are using an trigger event TRGO to trigger the transfers of new data from memory to GPIO port at fixed intervals
This does not make sense. TRGO does not directly trigger DMA (TRGI does, but that's another story, and in fact means a trigger source which is outside this given timer).
Read description of the DMA-triggering bits in TIMx_DIER register in RM.
JW
2025-02-25 4:01 AM
Hi waclawek.jan
All these examples are using TRGO event to trigger the transfer via a timer:
https://community.st.com/t5/stm32-mcus-products/stm32f0-timer-dac-dma/td-p/458451
https://controllerstech.com/dac-in-stm32/
https://www.youtube.com/watch?v=8z-pJSTi7ME (3 minutes into the video)
https://www.youtube.com/watch?v=0N4ECamZw2k ( 6m minutes into the video)
Thanks for your hint, but I need to read more about the DIER register.
Unfortunately I cant find examples how to use this register to trigger the DMA from the basic timers
Br Steen
2025-02-25 5:54 AM - edited 2025-02-25 6:04 AM
> According the the drawing on page 151 in the reference manual for STM32F030F4P6 it looks like there are trigger inputs from the basic timers TIM14, TIM16 & TIM17
I don't see TIM14 on there. I see the other two.
> When I'm looking on the setting options for these basic timers TIM14, TIM16 & TIM17, I do not have any option for an trigger event (TRG0) from these timers. I'm only able to pick Input Capture, Output Compare & PWN generation from the available options in CubeMX
I have no issues setting DMA in CubeMX on TIM16. With TIM14, it's not there because it's not an option.
TRGO options don't seem relevant here. These timers don't have one per the RM. Use the update event to trigger the transfer. Or the CH1 event.
I suspect you're mistaking TIM14 for TIM15 in the manual. They're very different.