In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Why are you using [b]reti[/b] and [b]retiw[/b] instructions in your interrupt routine? Only the [b]retiw[/b] uses the value of W to properly update the RTCC count. Also, unless you are really pressed for cycles, it's a good practice to have only a single exit point in any routine, but especially interrupt routines. Why? Well, using your interrupt as an example, suppose you need to change the interrupt rate. If you have multiple places where you set W and then do an retiw, you'll have to find all of them and change all of them. If you have a single exit point, then you only have a single place to update. [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=109670#m109673 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)