How to measure the duration of PWM

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
alma_284856
Level 3
Level 3
First like received

Hey everyone,

   

I know that there are lot of topic about it, but I didn't find a good one which works. I would like to measure the signal PWM from a receiver R/C. The high pulse duration is between 1ms-2ms with a frequency of 60Hz

   

I try to use a timer but I don't achieve to get a good value.

   

I put a timer in UDB but I don't understand what should I use.

   

I want to start the timer when I have a rising edge, and go to an interrupt when I have a falling edge, after in my interrup I read the timer, obtain the duration and reset the timer

   

But there are too much pins and I don't know what to choose and connect:

   

   

 

   

Thank you

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Attached a project you can consider.

   

 

   

Regards, Dana.

0 Likes