In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote: Yes, I was thinking along those lines, the SX has only one "Interrupt" that starts at org $000. I got overly excited when I saw the description for the SX48/52, in terms of internal interrupts. I thought this was alluding to some hidden feature in the SX48/52. Just to make sure I have the basic concept down, ASM Interrupt RETI SX/B INTERRUPT RETURNINT when initiated by the correct option call, in this particular case, their is an interrupt that occurs on roll over, which happens to be 256 cycles. So, the code inside the interrupt, which has its own cycle count, meaning the commands that are used get run, goes back to the main code, where it left off, and then 256 cyles later, interrupt occurs, forever if you wish. Now, we can shorten the RTCC time by adding ASM mov W,#-50 RETIW SX/B RETURNINT (50) ;interrupt occurs every 50 cycles? So, what basically occurs is that instaed of having to wait for the default time of 256 cycles, you now only have to wait, your new designated value, cycles. In affect you now have a means of controlling how quickly the interrupt will occur. From a programming stand point, your main code execution gets controlled by your occurences, or cycle time of the interrupt. I was trying to think of a condition when you would want your main code execution being interrupted every, lets say 5 cycles. But then I thought of Peter's (pjv) RTOS. The concept I am still having some difficulty with is mov W,#-50, in the manual it states that now the interrupt will occur every 50 cycles. Some where else I read that by using a negative (-), you are really reducing the 256 value by the designated negative amount. So in essence by using a -50 you are really reducing the 256 count down to 206, and that would be 206 cycle instead of a 50 cycle. Or is it -50 is 50 cycles into the new roll over time. If this is the case then why shouldn't I just keep everything straight, and just use mov W,#50, that is the same result isn't it. Thanks Ray ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=104346#m104374 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)