I need to detect a servo signal from a RC Rx and repeat to the servo.
If the PIC detects a fail in the signal it will put the servo in a pre recorded position.
I am thinking to use a 12F683.
[]'s
Ismael
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Wed Aug 27, 2008 8:19 am
This sounds like a trivial problem.
1) Set a timer longer than the max servo signal period.
2) Look for a servo signal starting edge.
3) Check just before the minimum valid pulse time to see if the pulse is still there.
4) Check just after the maximum valid pulse time to see if the pulse has ended.
5) If everything is fine, zero a Bad Data counter and restsart the timer.
6) If the timer times out or either of the checks is bad, increment the Bad Data counter.
7) When the Bad Data counter gets too big, substitute the fixed position data.
Implementation is left as an exercise for the student. _________________ The search for better is endless. Instead simply find very good and get the job done.
Last edited by SherpaDoug on Wed Aug 27, 2008 12:29 pm; edited 1 time in total
iscarelli
Joined: 26 Aug 2008 Posts: 2
Posted: Wed Aug 27, 2008 10:31 am
Hi!
Thanks for the reply!
Can you give some examples or material to study about timer implementation in CCS?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum