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
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!
Regards,
Marius
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:
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:
Thanks!