In SX Microcontrollers, SX/B Compiler and SX-Key Tool, George Herzog wrote: Hi Bean, Well, it is r/c PWM, which is roughly a 20 microsecond pulse, but wanders. And the ON cycle is between 1 and 2 microseconds or according to Guenther's text it may only need to be between 1.3 and 1.7 microseconds. From what I understand you don't need to measure the width of the whole pulse, merely the width of the on time. How accurately? Is 1% asking too much? Obviously, the rougher the measurement, the easier it is to do, but I am unsure of how rough is useful. 1/256 of 2 microseconds would require one byte; 1/16th would require one nibble. I suspect those the most convienent choices as I would be counting in a File Register. I suppose that given those parameters, all I have to do is poll and increment the four inputs rather than actually to a capture/compare emulation. As I understand it, the R/C reciever outputs the pulses in series [one after another] and if I know the sequence I can start with the #1 in an ISR and move immediately on to #2 after #1 shuts down. [In otherwords, I do not have to seek information from all 4 in a random sequence or simultaneously]. Alternatively, I may be wrong and all the Pulses are arriving concurrently. This would require a different strategy. This is an old challange as I was trying to write an Assembly language equivalent of the SAMs Autopilot and the jump from C to Assembly for this is a bit unclear. You discussion of Timers revived my interest. Still I wonder if capture/compare happen to be something that Virtual Periphercal can or cannot do. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=109161#m109164 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)