Interrupts in SX/B
![Invent-O-Doc](https://forums.parallax.com/uploads/userpics/096/nZ43CVNLJ1E1P.jpg)
I've ready that using interrupts in SX/B, it is necessary to
1) put the interrupt code in first before the main code, so it is in the first memory page and
2) specify the amount of time (or cycles) the interrupt routine will take to execute
Assuming the above assumptions are correct, what is a straightforward way to find out how long the interrupt code takes to execute so as to provide that information in the SX/B INTERRUPT command.
Any help with this is most appreciated!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thomas Talbot, MD
Gunpowder, MD, USA
1) put the interrupt code in first before the main code, so it is in the first memory page and
2) specify the amount of time (or cycles) the interrupt routine will take to execute
Assuming the above assumptions are correct, what is a straightforward way to find out how long the interrupt code takes to execute so as to provide that information in the SX/B INTERRUPT command.
Any help with this is most appreciated!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thomas Talbot, MD
Gunpowder, MD, USA
Comments
It's easier to specify interrupt rate and you can do that right on the INTERRUPT declaration line. You don't need to find out how long an interrupt takes, you decide how frequently you want it to execute. You just have to make sure that any code you put into the interrupt doesn't run longer than the period you've specified.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thomas Talbot, MD
Gunpowder, MD, USA
While not frequently used, you can manually set the interrupt rate by leaving off the information after INTERRUPT and then using the cycles parameter after RETURNINT. If you do this then you'll need to set the OPTION register as well (usually at the beginning of your program). For the most part, using the Rate parameter of INTERRUPT will be the easiest way to go. The nice thing about using the Rate parameter is that it does the calculations for Cycles and sets the Option register appropriately (use Ctrl-L to look at the List File and you'll see these things in the Start and Interrupt code).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thomas Talbot, MD
Gunpowder, MD, USA
Thanks for the Template. Jon W.,,, My Son and I have been playing w/ the SX/B useing the Program from Your N/V's Mag. Artc. ...Not only can We both spell "Interrupt", But We can use Them as well,,,,"After A brief Forum discussion"...Looking foward to the next Artc. In Jan."We hope Santa C. will bring it sooner".......................This is A neat lil. chip,And it's dirt cheap$
______________didn't mean to "Interrupt" this Post_______________$WMc%______________