How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

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

Moderator: RoccoMarco

Post Reply
robert_o
Posts: 53
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 6 times

How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by robert_o »

In this post http://www.chibios.com/forum/viewtopic.php?f=16&t=3875 it is said that the STM32 code for ChibiOS needs a comparator register. My question is: does it need just one and if that's the case is it possible to use TIM16,17 for the os, also how to implement TIM16/17 (i know about shared interrupts with TIM1).
Thank you.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by Giovanni »

hi,

PWM just requires one channel, ICU two, GPT none.

The only issue are the shared IRQs.

Giovanni
robert_o
Posts: 53
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 6 times

Re: How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by robert_o »

I thought about the timer for the os (#define STM32_ST_USE_TIMER).
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by Giovanni »

Hi,

The OS timer needs one CCR.

Giovanni
robert_o
Posts: 53
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 6 times

Re: How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by robert_o »

Thank you. Could you please explain if there is a possibility to use TIM16 or 17 for the os. Both have one ccr and are 16bit. (I am using 32F100 Chip - there are no 32bit timers), and which files need changing.
Also is there a problem with the shared interrupt?

Thank you.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: How many CCR Units need Chibios RT on STM32 (Q: TIM16,17 related)

Post by Giovanni »

Hi,

You need to change hal_st_lld.c and hal_st_lld.h. Shared interrupts are a problem if you try to activate the sharing timer with another driver, the ISR name would conflict and the result is a duplicated symbol during linking phase.

Giovanni
Post Reply