Page 1 of 1

Decoding a PWM signal from a rc car receiver

PostPosted: Sun May 29, 2016 2:02 am
by kahlenberg
Hello,
I want to decode a PWM signal with PIC16F877A. As you can see in the attached picture, there is a noise in front of the signal. I want to ignore them, I think those 3 jumps after noise are start of the signal, because they are same in every condition (I tested). After start condition there are 17 pulses. I want to measure the on-time and off-time of every pulses. How can I do that?
Can I make it with Capture module? And how?


Image


One question regarding capture mode:
Does the TIMER1 start immidiately after initializing? Or it waits until a falling edge comes to RC2/CCP1 input and then starts.

By the way: This signal is comming from a 27 MHz receiver in a RC-car.
Thanks.

Re: Decoding a PWM signal from a rc car receiver

PostPosted: Sun May 29, 2016 6:18 am
by Joseph Watson
You might want to check out the operation of encoder/decoder chip sets similat to PT2262 and PT2272. If it looks like your transmitter's signal resembles what a PT2262 sends, you might find that understanding what a PT2272 does might help you design your software. I cannot be sure that is what you have there but these things are quite common and their pulse patterns look similar to yours.

Re: Decoding a PWM signal from a rc car receiver

PostPosted: Sun May 29, 2016 12:55 pm
by kahlenberg
Thanks for answer,
I looked at datasheets of PT2272 and 2262, it seems that they are working with digital data rather than PWM signals. So, they are not compatible with my transmitter and receiver.

Re: Decoding a PWM signal from a rc car receiver

PostPosted: Sun May 29, 2016 7:50 pm
by Joseph Watson
I gather, then, that as you move the steering control slowly through its range, you see one of the pulses in that pulse train that you are displaying on the scope slowly get wider and narrower to indicate the degree of activation of the control? If that is the case, I am curious as to the number of channels of proportional control that are coded into that pulse train?