cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103RGT6 - How many timer are available..

jlecl.1
Associate III

Hello,

I'm little bit confuse.

I have design a pcb with the STM32F103RGT6 (LQFP64pins) and during a check with with MXCube i have a doubt.

My need ( at least :(

> 2x TIMx mode encoder.

> 2x TIMx pwm mode

> 1x TIMx for my program.

On MXcube Selector > 14 timers available.

On MX cube pin configurator :only 4 timers are available.

On Datasheet : 17....

Do you have an idea ?

1 ACCEPTED SOLUTION

Accepted Solutions

The data sheet should be authoritative provided you identify the part/die in use.

Pins may ultimately limit usability for certain applications.

You can use TIM that don't actually escape to pins for you're own timing purposes.

You can also use SysTick and schedule things

Each TIM has a single counting element, and usually 4 or 2 channels.

2 Channels CH1/CH2 are used for Encoder mode.

The F1 only has 16-bit TIM so no better choices.

One TIM can drive 4 channels at the SAME frequency, ie SERVOs at 50 Hz / 20 ms

The angle being driven by the CCRx registers. If you divide the counter to 1 MHz (via PSC) you can use the CCR as 16-bit microsecond values for angle, notionally 1000-2000 (1-2ms) with 1500 as a top-center. You could get more resolution, but doubtful that its helpful.

Data Sheet, and my math says 14..

https://www.st.com/resource/en/datasheet/stm32f103rg.pdf


_legacyfs_online_stmicro_images_0693W00000dDQX8QAO.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

The data sheet should be authoritative provided you identify the part/die in use.

Pins may ultimately limit usability for certain applications.

You can use TIM that don't actually escape to pins for you're own timing purposes.

You can also use SysTick and schedule things

Each TIM has a single counting element, and usually 4 or 2 channels.

2 Channels CH1/CH2 are used for Encoder mode.

The F1 only has 16-bit TIM so no better choices.

One TIM can drive 4 channels at the SAME frequency, ie SERVOs at 50 Hz / 20 ms

The angle being driven by the CCRx registers. If you divide the counter to 1 MHz (via PSC) you can use the CCR as 16-bit microsecond values for angle, notionally 1000-2000 (1-2ms) with 1500 as a top-center. You could get more resolution, but doubtful that its helpful.

Data Sheet, and my math says 14..

https://www.st.com/resource/en/datasheet/stm32f103rg.pdf


_legacyfs_online_stmicro_images_0693W00000dDQX8QAO.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

The biggest number in datasheet counts up also RTC, watchdog(s) and SysTick, but that's listed below that biggest number.

Some timers (TIM6, TIM7) don't have any pins, so they can't appear in the pin configurator in CubeMX.

Maybe it's better not to rely on CubeMX, but read thoroughly the DS and RM and draw your own conclusion.

JW

jlecl.1
Associate III

it's clear, thanks for all !