In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Ken, I would use RTCC to count the mag pulses. And update the servo in the program loop. Something like: [WARNING...UNTESTED CODE AHEAD!] [code] (replace this text with your code) OPTION = %11111111 ' Setup RTCC inc from external pin (Mag pulse) servoPos = 150 ' 1.5 milliseconds DO RTCC = 0 FOR cnt=1 TO 50 servoPin = 1 PAUSEUS servoPos * 10 servoPin = 0 servoPos = 255 - servoPos PAUSEUS servoPos * 10 servoPos = 255 - servoPos ' Delayed 2.550 milliseconds so far PAUSE 17.45 ' Make total delay 20mSec NEXT magCnt = RTCC ' Do something with magCnt LOOP Bean. [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=147881#m147932 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)