In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: CBMeeks, Another (potential) option is to use a smaller pre-scale, and multiple interrupts to accumulate the exact time you need. For example, if you set your pre-scale to 1:2, then "retiw w, #-250" would give you 250 * 2 = 500 clocks. Do this five times, and you have accumulated a total of 5 * 500 = 2500 clocks. When this happens, you change the return line to be "retiw w, #-21", which will give you 21 * 2 = 42 clocks, for a total of 2542 clocks. Of course, this assumes that you can divide up your work in the interrupt handler across multiple interrupts. IF you can't, then you example of the 1:16 pre-scale is the way to go. [list]Thanks, PeterM[/list] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=144847#m145248 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)