In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi Peter; It takes a little doing figuring out what you're up to. My comments are: 1) In the SX48 M is saved/restored on entering/exiting the ISR. Not so with the SX20/28. How to get around that, I'm not sure. 2) You can context switch any time; inside the ISR or in the mainline. To eliminate the wait, why not simply test the size of the RTCC register to see how close to an interrupt you are, and then decide to wait for that, or force a switch. 3) Can't help you here.... this is Bean's turf. Some other points..... Are the register saves (PUSHes after the POPs) not redundant ? Perhaps I don't understand and need to study what you are doing some more. You need to deal with the issue of making a context switch when the interrupted code was in the middle of a "skip" instruction. Messing with the STATUS register during such an occurrence will cause you to drop the skip on returning. (Took a LONG time to figure that out because it usually happens so infrequently) There is also the issue of dealing with the SX's internal interrupt flag... context switching/returning can mess that up, forever keeping your interrupts off (or on, I can't recall for sure). Caveat: these additional points are for the SX20/28; and probably the SX48, but I have not tested that because of your point number 1). Looks like you're having fun though! Cheers, Peter (pjv) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=174063#m174089 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)