Use TIM7 for ChibiOS free running timer?

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
codeslinger
Posts: 2
Joined: Tue Feb 21, 2017 5:03 pm

Use TIM7 for ChibiOS free running timer?

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Use TIM7 for ChibiOS free running timer?

Post by Giovanni »

Hi,

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

Giovanni
codeslinger
Posts: 2
Joined: Tue Feb 21, 2017 5:03 pm

Re: Use TIM7 for ChibiOS free running timer?

Post by codeslinger »

Thanks! I will figure out a way to use one of the other timers then.
Post Reply