cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable the FlexPWM driver setting based on the pwm pin configuration on spc5 board?

Angle
Associate II

Hi, can anyone explain to me about this FlexPWM driver?

What is SM0 stand for? and how i can set the driver based on pin configuration? i did not understand about this setting.

Let say i want to configure pin on PORT_E[5] which is PWM_0/A1_0. So, in this setting which one i need to tick to enable the driver?

0693W00000QNRawQAH.png

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions

I was confused too before to look at the PWM block diagram in the reference manual.

Please open the RM and look to Figure 419. PWM Block Diagram

Best regards

View solution in original post

5 REPLIES 5
ODOUV.1
ST Employee

Hello,

assuming that your MCU version is a SPC574S

and looking into the corresponding reference manual (motor control -> FlexPWM):

https://www.st.com/resource/en/reference_manual/rm0387-spc574sx-32bit-power-architecture-microcontroller-for-automotive-asild-applications-stmicroelectronics.pdf

it seems that SM0 stands for SubModule0 of a PWM module

In your case, using pin Port_E[5] , the A1_0 configuration is linked to the SM1 of PWM0

So in SPC5Studio, you need to enable at least FlexPWM0 SM1:

0693W00000QNYckQAH.pnghen it will enable the driver FLEXPWMD2:

0693W00000QNYgfQAH.png 

Best regards

Okay then may i know how i can recognize whether it its SM0, SM1, SM2 or SM3? I got confuse for this SM0, SM1, SM2, SM3

I was confused too before to look at the PWM block diagram in the reference manual.

Please open the RM and look to Figure 419. PWM Block Diagram

Best regards

Hi,

sorry again. I got confused between channel and the driver? Can you explain to me

Hello,

let me provide more explanations about the PWM driver configuration:

Each PWM IP have 4 submodules, then:

For PWM0, submodules (SM0, SM1, SM2, SM3) are respectively controlled by drivers (FLEXPWMD1, FLEXPWMD2, FLEXPWMD3, FLEXPWMD4)

But if you choose the synchronized option, they are all controlled by the same driver FLEXPWMD1

PWM1 is not present on SPC574S MCU (so drivers FLEWPWMD5 to 8 are deactivated in flewpwm_lld.c)

For PWM2, submodules (SM0, SM1, SM2, SM3) are respectively controlled by drivers (FLEXPWMD9, FLEXPWMD10, FLEXPWMD11, FLEXPWMD12)

But if you choose the synchronized option, they are all controlled by the same driver FLEXPWMD9

Concerning the PWM channels, I don't know, please ask a new specific question in Forum focused on PWM channels.

Best regards.