In SX Microcontrollers, SX/B Compiler and SX-Key Tool, amiller wrote: Think of your problem in a different way.... 1) Let the virtual peripherals work in the background via the ISR, constantly updating registers with the most recent R/C input values. 2) The main code loops, pulling the input values from the virtual peripheral's registers and acting on those values. Using the most recent data to update the ouputs. No need to worry about the 20ms timing, nor the order of the input channel pulses. This is the beauty of the SX's speed, and of the transparency of a well crafted virtual peripheral. Your big timnig/programming concerns are simplified into several smaller/easier tasks. Even better, once you create a virtual peripheral to read a particular input, or to send a particular output, you can reuse that code in project after project, no long piece of linear code that is application specific, no counting of assembler instructions to get the timing tweaked just right, no wasted time rewriting code for problems you've already solved. -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#m109568 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)