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.

Moderators: barthess, RoccoMarco

robert_o
Posts: 35
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 4 times

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

Postby robert_o » Mon Jan 01, 2018 6:10 pm

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

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

Postby Giovanni » Mon Jan 01, 2018 7:33 pm

hi,

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

The only issue are the shared IRQs.

Giovanni

robert_o
Posts: 35
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 4 times

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

Postby robert_o » Mon Jan 01, 2018 8:38 pm

I thought about the timer for the os (#define STM32_ST_USE_TIMER).

User avatar
Giovanni
Site Admin
Posts: 10823
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 318 times
Been thanked: 268 times
Contact:

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

Postby Giovanni » Mon Jan 01, 2018 10:46 pm

Hi,

The OS timer needs one CCR.

Giovanni

robert_o
Posts: 35
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 4 times

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

Postby robert_o » Mon Jan 01, 2018 10:55 pm

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

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

Postby Giovanni » Mon Jan 01, 2018 11:06 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 3 guests