Skip to main content
EThom.3
Senior II
August 26, 2024
Question

STM32 event system – connection to timers

  • August 26, 2024
  • 2 replies
  • 986 views

I have an STM32G473 on an existing board, and now the need to trigger Timer 2 in "One Pulse Mode" from a hardware input has come up. No problem, I thought, as I knew that the MCU has an event system. I simply assumed that I could generate an event with the EXTI, and use that as a trigger for Timer 2.

Yeah, I know. Never assume.

As I read the manual, the events generated by EXTI cannot be connected to the trigger input on the timers. In order to do this, I apparently need to use one of the TIMx_ETR inputs. Otherwise, I am pretty much stuck with what is available in the manual's table 272 - 277.

If I am wrong about this, please let me know. That would save me some impractical hardware changes with super-thin wires on teeny-tiny component pins, and such.

This topic has been closed for replies.

2 replies

TDK
August 26, 2024

You should be able to use the DMA to trigger the timer if you want.

Set up DMA/DMAMUX to trigger from the EXTIx event and have it write to the TIMx->CR1 register to turn on CEN bit. You'll have to write the entire CR1 register, not just a single bit.

"If you feel a post has answered your question, please click ""Accept as Solution""."
EThom.3
EThom.3Author
Senior II
August 28, 2024

That is an interesting approach that I certainly did not think of. Will look into it.

Thanks!