S32K14 - Example to send and read PWM signal?

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

S32K14 - Example to send and read PWM signal?

1,188 Views
Poley
Contributor V

Hi all,

 

How would I go about sending out a PWM signal on 1 and then reciew a different PWM on a seperate PIN and work out the duty cycle in Simulink?

 

Thanks

0 Kudos
Reply
2 Replies

1,115 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley 

We might have the right example for you in our toolbox, which does exactly what you want, generating the PWM example on PWM 0 and reading the characteristics on other pins, using the Dual Edge Capture blocks for MBDT for S32K1xx. The example is called ftm_dual_edge_s32k14x and it is delivered in our toolbox.

Please let us know if this is what you are looking for!

mariuslucianand_0-1689860411225.png

Regards,

Marius

 

 

 

0 Kudos
Reply

752 Views
Poley
Contributor V

Hey @mariuslucianand 

So I have managed to set this up on the S32K144EVB but I am only able to read either duty cycle or frequency at the moment. How do I go about measuring frequency at the same time as the frequency changes and therefore the duty cycle needs to be scaled depending on the frequency. I will attach the modified version of the able example you mentioned. This output the duty cycle but I have fixed the 10Hz frequency as it is known:

Poley_0-1714426328385.png

Also, how do I detect frequencies 0-10Hz? It seems from the UINT16 calcs that the lowest frequency that can be read is 9.54Hz? Frequency = 1/(65535/625000).

Here is the range I need to detect and calculate duty cycle in:

Poley_1-1714426758402.png


Thanks!

0 Kudos
Reply