2026-04-29 7:02 AM - last edited on 2026-04-30 2:51 AM by mƎALLEm
Hello, i am using F446 and i am contemplating using FreeRTOS CMSIS V2 software timer to generate PWM to control motors via motor drivers (IC chipset). Is this possible? Or must I use the hardware timer, TIM1~7 ?
2026-04-30 1:51 AM
As said by @Andrew Neil ,
There are 14 timers in STM32F446:
You are using half of timers resources in your case only 1 to 7 in your case.. So why bothering yourself with the software timer usage?
2026-04-30 4:35 AM
Hi there, i got total 63 motors to control. F446 has 14 timer, TIM6 and TIM7 is a general timer, does not have CCR and AAR registers, so cant use for PWM.
Anyone has the source code for software timer using FreeRTOS CMSIS V
2026-04-30 4:43 AM - edited 2026-04-30 8:39 AM
@HMSEdinburge wrote:
Hi there, i got total 63 motors to control.
Anyone has the source code for software timer using FreeRTOS CMSIS V
63 motors to be controlled with STM32F446 with FreeRTOS software timer to generate PWM?
I don't think this is feasible. Think about the CPU load and the accuracy of the PWM duty cycle!
This is something that needs to be done with hardware ..
2026-04-30 6:55 PM
Does it imply i should use Xilinx FPGA??
2026-04-30 11:29 PM
Sorry boy, but your question lacks info. Ask PWM say one channel PWM to regulate energy. This you can regulate over ISR and tables for every GPIO for example MCU with 204 gpio can have 204 one hw/sw timer controlled PWMs channels. But exist various motors... RTOS here is absurd,
2026-05-01 1:24 AM
@HMSEdinburge wrote:Does it imply i should use Xilinx FPGA??
Xilinx is not the only FPGA!
FPGA is not the only possible approach; eg, maybe consider multiple MCUs.
You need to do a better analysis of your requirements - especially the PWM frequency/ies and resolution(s) - and then think about what solution(s) are appropriate to meet those requirements.
You haven't given enough information for anyone to be able to give a meaningful answer.
Anyhow, it seems that your original question - "Can FreeRTOS software timer generate PWM?" - has been answered.
So please mark the solution on whichever post provided the answer (not this one!).
Start a new thread for a new question.
2026-05-01 9:22 AM - edited 2026-05-01 9:24 AM
Hi,
to get good info, you should also give some good info:
- how many motors need control at same time ?
- which kind of motor and driver ? (DC, stepper, 3-phase ...etc)
- needed speed of pwm or control signal ?
- and resolution of pwm needed (how many steps from 0...100% ) ?
2026-05-01 6:12 PM
Xilinx is one of the choice..
2026-05-01 6:14 PM
These are the motors i m using, BLDC, stepper, servo actuators, stepper motor need 1/32 steps, BLDC needs PWM, and their various motor drivers, gate drivers etc. Total 63 motors.
2026-05-02 9:50 AM
So to answer your question:
>Can FreeRTOS software timer generate PWM?
yes.
+
can you control 64 motors of different kind in real time just by using some RTOS:
no.