This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM Frequency Measurement on nRF52 with SDK 11

Hi,

I need to measure the frequency of a PWM signal with 50% duty cycle through one of the GPIO pins. The frequency of input PWM signal ranges between 100Hz to 1000Hz.

I am hoping to measure the PWM frequency in the following way: I'll wait for the signal to go HIGH, start timing, then wait for the signal to go LOW and stop timing. Then I'll repeat the same process but this time from LOW to HIGH, and then find the average of the two half periods measured.

I know the above process gives me half of a full period, but since the duty cycle of my PWM signal is 50% I can calculate the PWM frequency based on the averaged value.

How can I implement the above process?

Is there a better way for measuring PWM signals?

Thanks

Related