Skip to main content
Explorer
March 26, 2024
Question

Chaining two timers on the STM32G4

  • March 26, 2024
  • 1 reply
  • 1098 views

I need to chain two timers together to get one 48-bit timer that counts microseconds, I'm thinking of using TIM2 as the master and TIM3 as the slave.

I have the feeling some of the answers are contained in this table in the Reference Manual but I can't for the life of me figure out what it's trying to tell me:

c_shearer_cooper_0-1711461609158.png

Here's how I how I have it set up currently:

c_shearer_cooper_1-1711461683863.pngc_shearer_cooper_2-1711461691949.png

Am I on the right track?

Thanks,
Chris

 

    This topic has been closed for replies.

    1 reply

    ST Employee
    April 22, 2024

    Hello @c_shearer_cooper, sorry for the delayed answer

    To achieve a 48-bit timer using TIM2 and TIM3, you would typically configure TIM2 as the master timer to count the lower bits and TIM3 as the slave timer to count the overflow from TIM2, effectively counting the higher bits. 

    >>Am I on the right track? Yes, you are 

    I hope that worked for you! if there are any related issues, do not hesitate to get back to this thread