2022-08-10 08:09 PM
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?
Solved! Go to Solution.
2022-08-12 01:04 AM
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
2022-08-12 12:50 AM
Hello,
assuming that your MCU version is a SPC574S
and looking into the corresponding reference manual (motor control -> FlexPWM):
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:
hen it will enable the driver FLEXPWMD2:
Best regards
2022-08-12 01:00 AM
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
2022-08-12 01:04 AM
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
2022-08-21 06:59 PM
Hi,
sorry again. I got confused between channel and the driver? Can you explain to me
2022-08-23 02:09 AM
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.