🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Variable frequency PWM is limited

User: "liu fred"
Altair Community Member
Updated by liu fred

Variable frequency PWM 

Why the output frequency is limited to 0.25~4 times of the fundamental frequency

image

image

imageimage

My PWM_Base_Frequency is set at 31250,but the output PWM_Frequency is limited to 7812.5Hz~125000Hz ( 31250*0.25~31250*4 )

 

 

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Albert_Dunford"
    Altair Employee
    Updated by Albert_Dunford

    The reasons we limit PWM variable range from ¼ to 4 times are as follows:

    1. Set a bigger multiplier may affect PWM period accuracy (especially for higher frequency).
    2. When PWM period changes to a small interval, PWM interrupt may become too busy.

    For example, the base PWM frequency is 10KHz, the interrupt routine execution time is 20us.

    When PWM frequency is changed to 40KHz, the PWM period becomes 25us. The 20us interrupt routine

    is a big burden for the system(only 5us for other tasks).

    1. When allowing low frequency in variable frequency, the generated code needs to change multiple registers

    that increases the overhead of frequency change.

    User: "liu fred"
    Altair Community Member
    OP
    Updated by liu fred

    The reasons we limit PWM variable range from ¼ to 4 times are as follows:

    1. Set a bigger multiplier may affect PWM period accuracy (especially for higher frequency).
    2. When PWM period changes to a small interval, PWM interrupt may become too busy.

    For example, the base PWM frequency is 10KHz, the interrupt routine execution time is 20us.

    When PWM frequency is changed to 40KHz, the PWM period becomes 25us. The 20us interrupt routine

    is a big burden for the system(only 5us for other tasks).

    1. When allowing low frequency in variable frequency, the generated code needs to change multiple registers

    that increases the overhead of frequency change.

    Thank you for the good suggestion.