2023-06-08 11:30 AM
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 ?
Solved! Go to Solution.
2023-06-08 11:55 AM - edited 2023-11-20 03:37 AM
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
2023-06-08 11:55 AM - edited 2023-11-20 03:37 AM
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
2023-06-08 01:16 PM
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
2023-06-09 12:26 AM
it's clear, thanks for all !