In SX Microcontrollers, SX/B Compiler and SX-Key Tool, amiller wrote: GH, Quit worrying about the order of the input pulses!!! Quit worrying about 20mS timing!!! :) The R/C Input ISR code keeps a counter of all the input pulse lengths. When a pulse ends, the ISR checks if that pulse length was in range (1ms-2ms). If that pulse width is in range the ISR moves that counter into the result register. Your main loop code should only look at the result registers, not at the counters. There is no need for the main loop to wait for all/any of the pulses. The result registers will always have the latest/last valid signal values received. The main code can continuously loop using/re-using these constantly updating values. If your main loop is faster/slower than 200mS, no problem. (The only timing to be concerned with is the 1/128mS timing of the ISR, which you set with retiw, CPU speed, and maybe an ISR multiplexer.) The values in the result registers are 7-bit, shifted to 8-bits. That is still better than 0.5degree of resolution for your +/-30degree transmitter stick. -AGM- ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=109161#m109785 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)