S32K SKD - PWM

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

S32K SKD - PWM

3,259 Views
radekpivokonsky
Contributor I

Hi,

I've started to setup the PWM outputs over FTM timers. When I try to set the PWM output with the PWM frequnecy in the range of approx. 80 - 250 Hz, the PWM period is not consistent. It genererates additional pulse among the rest of expected PWM pulses - see attached file. For the project SDK drivers are used (for PWM the FTM_PWM driver is used).

I attached two files, first is the pwm setting file generated by Proc. Expert and second one shows the PWM curve on the osciloscopue.

Please can you explain me what is wrong. If I change PWM period (also PWM prescaler must be changed) e.g. to 1ms, 500us... the period is really precisely set.

Thank you.

Radek

Labels (1)
0 Kudos
Reply
2 Replies

2,922 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

I think the problem is caused by: FTM_UPDATE_NOW. If you try to update the duty cycle the counter will be reset and you won't have fixed frequency.

To avoid this issue please use FTM_WAIT_LOADING_POINTS and enable one of the loading point ( true, /* Max loading point state */). In this set-up no Mather when you update duty the update will be made just after finishing current period.

Best regards,

Razvan

2,922 Views
radekpivokonsky
Contributor I

Thank you for your help. Now, all the tested frequencies are precisely set.

Best Regards,

Radek

0 Kudos
Reply