Page 1 of 1

Use TIM7 for ChibiOS free running timer?

Posted: Tue Feb 21, 2017 5:11 pm
by codeslinger
I have a project where I'm already using TIM{2, 3, 4, 5} to generate external PWM signals and the part I use (STM32F446) doesn't have TIM21 and TIM22. It seems like these are the only timers available to be used as free running timers.

I modified st_lld.c / st_lld.h to also support TIM7, which is a basic control timer that doesn't have external outputs and can be used for the DAC. I did some initial tests and it seems to be working normally. This makes me wonder why TIM6 and TIM7 is not officially supported to be used as free running timer, are there any downsides to use this timer instead of e.g TIM3?

Re: Use TIM7 for ChibiOS free running timer?

Posted: Tue Feb 21, 2017 5:36 pm
by Giovanni
Hi,

TIM6 and TIM7 do not have the comparator register used by the ST driver code.

Giovanni

Re: Use TIM7 for ChibiOS free running timer?

Posted: Wed Feb 22, 2017 4:25 pm
by codeslinger
Thanks! I will figure out a way to use one of the other timers then.