PDA

View Full Version : Read Servo Value?



ItsMeNick
09-03-2008, 10:50 AM
I have another circuit which is outputting to a servo.

Can I direct that to an IO pin on a BS2 to see the values it's driving to the servo?
Would I use pulsin?

Any help is appreciated!

Thanks,
-Nick

Mike Green
09-03-2008, 12:02 PM
Yes to both questions. The main problem you will have is synchronizing your measurements with the incoming pulses. It's not a big deal. The issue is that you can't time a pulse if it has already started, so you have to wait for the input to be HIGH, then LOW before starting the PULSIN. The PULSIN will wait for the next pulse to start, then measure its width. If you know (or measure) the time between pulses, you can do something else useful before doing the next PULSIN.