CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Detecting servo signal

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iscarelli



Joined: 26 Aug 2008
Posts: 2

View user's profile Send private message

Detecting servo signal
PostPosted: Tue Aug 26, 2008 9:49 am     Reply with quote

Hi!

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

View user's profile Send private message

PostPosted: Wed Aug 27, 2008 8:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Aug 27, 2008 10:31 am     Reply with quote

Hi!

Thanks for the reply!

Can you give some examples or material to study about timer implementation in CCS?

[]'s
Ismael
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group