cancel
Showing results for 
Search instead for 
Did you mean: 

Chaining two timers on the STM32G4

c_shearer_cooper
Associate III

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

 

1 REPLY 1
Sarra.S
ST Employee

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 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.