Hi,
I have used PWM example, given in SDK. The code has been modified so that 50Hz signal will generate from PWM_Submodule0 (both from PWMA & PWMB pins). The code is working fine.
Now, I want to count the number of rising edges in the signal. Can anyone help in how exactly this can be done?
Thanks,
Devaharsha
Hello,
Could you elaborate further? or could you give an explanation about the solution you want to achieve?
Best regards,
Pavel
Hi,
For generating PWM signal, I am using modified SDK example such that the signal will be of 50 Hz.
I am using this signal as the input to stepper motor. What I understood is, the stepper motor steps every time a rise edge signal is detected. So, if I want lets say 50 degrees that corresponds to 200 steps, there should be 200 rising edges as the input.
Can you help with this issue on how to count number of rising edges in the PWM signal?
Thanks
Devaharsha
Hello,
Thanks for being clear, I suggest using the FTM input capture to detect the rising edge and count, to do that there is no example available for that solution in the SDK.
I recommend reviewing this app note this is for LPC but using the same module of eflexPWM maybe could help you to get more details to implement in your application.
Stepper Motor Control on LPC55S3x (nxp.com)
Best regards,
Pavel