Use TIM7 for ChibiOS free running timer?

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

Moderators: RoccoMarco, barthess

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

Use TIM7 for ChibiOS free running timer?

Postby codeslinger » Tue Feb 21, 2017 5:11 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Use TIM7 for ChibiOS free running timer?

Postby Giovanni » Tue Feb 21, 2017 5:36 pm

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?

Postby codeslinger » Wed Feb 22, 2017 4:25 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 19 guests