Jump to content
Mark Harris

PIC - read a PPM servo signal

Recommended Posts

I know how to generate a servo signal with a pic microcontroller, but i'm needing to read a signal and find out how long it was high for.

Would anyone happen to have some code to get me on the right path?

Share this post


Link to post
Share on other sites

Trying to use someone elses code is harder than writing your own I think. Its better to do it yourself and then you understand how it works.

I wrote a program for a car speed controller on a 16c71 about 10 years back, not 100% sure of the details but I set it so the incomming pulse would reset the RTCC and the end of pulse would read the RTCC and store the value. This wasted half the count as the first 1ms never changes but still left 128 steps for the controller. Im sure you could cascade the counter to gain more steps if you need them.

Terry

Share this post


Link to post
Share on other sites

Terry,

Thank you for the response. I really am just looking for code for an idea how to programatically go about reading the times. I'm not quite sure where to start so its a little hard to write my own :) I work as a software developer so code rarely confuses me :) I haven't done a great deal of programming on PIC systems so i'm still a newb as far as it goes.

- Mark

Share this post


Link to post
Share on other sites

Im probably not the right person to help as I am only just getting back into pic's and only just wrote my first simple program on a modern pic. What pic are you using and what are you making ?

Terry

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×