cancel
Showing results for 
Search instead for 
Did you mean: 

Can FreeRTOS software timer generate PWM?

HMSEdinburge
Associate II

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 ?

19 REPLIES 19
mƎALLEm
ST Employee

As said by @Andrew Neil ,

There are 14 timers in STM32F446:

mALLEm_1-1777538987864.png

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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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


@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 ..

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Does it imply i should use Xilinx FPGA??

 

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,


@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.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
AScha.3
Super User

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% ) ?

 

If you feel a post has answered your question, please click "Accept as Solution".

Xilinx is one of the choice.. 

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. 

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.

If you feel a post has answered your question, please click "Accept as Solution".