In SX Microcontrollers, SX/B Compiler and SX-Key Tool, joelfriend wrote: Nearly all code that interacts with real-world entities has a loop that does nothing but kills time (switch de-bouncing, blinking LEDs, etc.). Does anyone know if there is a simple calculator that figures out what values to use for the timer variable in these loops (using assembly language)? Something where you enter your clock speed and desired pause in seconds, and it would give you the values to use plus any remaining cycles to kill. Example: pause for 1/4000 second at a clock of 4MHz PAUSE mov timer, #250 :LOOP djnz timer, :LOOP nop nop ;pause completed, code here I want to give this calculator the speed of 4MHz and .00025 seconds, and it should tell me variable #1 = 250, 2 leftover cycles. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=397751 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)