PWM issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM issue

Jump to solution
1,488 Views
Ayaz
Contributor III

I am using S32K344 to generate PWM via eMIOS and flexio using OPWMB?

i have some dough regrade to the formular for calculating  the PWM frequency ?

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

I am using this formular for Emios can i use it also for flexio?

0 Kudos
Reply
1 Solution
1,443 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

FlexIO PWM frequency = AIPS_PLAT_CLK/ Clock prescaler / Period[ticks]=48MHz/1/200=240 kHz

View solution in original post

0 Kudos
Reply
11 Replies
365 Views
ESAKKI_MBD
Contributor II

I have a issue with OPWFMB mode for variable frequency & variable duty cycle. can you help me with this mode with an example?

I am encountering with the OPWFMB mode for variable frequency and duty cycle. can you help me with examples in understanding and troubleshooting such complexities.

Your expertise in this matter would greatly contribute to resolving the issue efficiently.

Thank you in advance for your attention to this matter. I look forward to your guidance and insights.

0 Kudos
Reply
1,469 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

I don't think this formula for eMIOS can be used for Flexio_PWM. Have a look at Flexio_Pwm_Ip_Example_S32K344:

Flexio_Pwm_Ip_Example_S32K344_RTD300 FlexIO AIPS_PLAT_CLK.pngFlexio_Pwm_Ip_Example_S32K344_RTD300 Clock prescaler Period.png


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,463 Views
Ayaz
Contributor III

what is the formula for flexio_pwm ?

0 Kudos
Reply
1,444 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

FlexIO PWM frequency = AIPS_PLAT_CLK/ Clock prescaler / Period[ticks]=48MHz/1/200=240 kHz

0 Kudos
Reply
1,449 Views
Ayaz
Contributor III

 first 1)

is the formular i am using for eMIOS correct ?

 PWM frequency = CORE_CLK / global prescaler / internal prescaler / (period ticks+1) or shoud it be 

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (period ticks).

second 2) when i have for example period for 2400 ticks and i set duty cycle into 2400,100% duty cycle is not giving any output,but if i decrease the duty cycle only be  one ticks then the period then it will gives an output of 98,7%.

my setup is 

CORE_CLK=48MHz

global prescaler=1

internal prescaler=1

mcl 

Skærmbillede 2023-114.pngSkærmbillede 2023-11-27 093140.png

 

0 Kudos
Reply
1,437 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

eMIOS PWM frequency has been discussed in S32K344 hardware PWM frequency, which is:

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

0 Kudos
Reply
845 Views
ESAKKI_MBD
Contributor II
in this formula I can't be able to understand what is B1?
0 Kudos
Reply
1,432 Views
Ayaz
Contributor III

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

under the example you send me this formular is for OPWFMB mode

does this formular applies on OPWMB mode also? 

0 Kudos
Reply
1,321 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Note Clock prescaler(Internal Prescaler) Will only have an effect in OPWFMB and OPMCB modes.(Shown in S32 Configuration Tool). If OPWMB mode is selected, only global prescaler(Master Bus Prescaler) is active by using S32CT.

Clock prescaler Will only have an effect in OPWFMB and OPMCB modes.png

0 Kudos
Reply
1,429 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Yes, I think it's the same.

0 Kudos
Reply
1,419 Views
Ayaz
Contributor III

is it normal that if i apply 2399 ticks for period and i set the duty cycle 2399 to get 100% duty cycle ,is not giving my any output ,from the test i did ,the duty cycle most always be one ticks less the period to get 100% duty cycle ,it is for emios 

0 Kudos
Reply