I've also played around with RC pulse a fair bit and the system I use uses the TMR0 function of a 4Mhz part to time and generate RC pulses. If you use it with the pre-scaler set to divide by 8 then you end up with 125 ticks being a millisecond. Using 1.5 ms as the mid point of the RC pulse (and subtracted on input added on output as described by ken) means that you can use a value of +-64 to represent the servo position (or whatever). The nice thing about this sort of range is that you can perform a fair bit of manipulation of values etc. using only 8 bit arithmetic it is easy to put together functions/macros to limit things to this range, create deadbands etc. I've used this system to create simple mixers, and various other systems that require RC inputs to be combined with real world measurements before being used to control an RC servo. just a thought Andy -----Original Message----- From: ken To: PICLIST@MITVMA.MIT.EDU Date: Sunday, January 11, 1998 4:20 PM Subject: Re: HELP! R/C Servo Code problems-Can U find problem. >Just out of interest the servo control pulse never goes below about >0.9mS so measuring this part of the input is a waste of resolution if >you want to keep to 8 bits. What I do is have fixed delay of about 875uS >and then I start measuring the input pulse, this gives me 5uS resolution >and a count of FF is about 2.035mS. In the output routine I have the >same fixed delay before I start the variable part. You must keep the >steps as small as possible if you go up to 10uS resolution the servos >will jitter and buzz. If anyone wants my basic input and output routines >email me and I will send them out to you. > >Ken. > >+-----------------------------+--------------------------------------+ >| Ken Hewitt G8PWC | Email ken@welwyn.demon.co.uk | >| /\/\/\/\/\/\/\/\/ | Homepage www.welwyn.demon.co.uk | >+-----------------------------+--------------------------------------+ >