In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: If you're going to do ISR-based serial I think it best to use assembly and switch banks manually; the code is very trim and will consume less time in the ISR. SX/B wants to point to bank 0 for normal variables so by putting your serial variables into an array (which forces them into something beyond bank 0) you end up preserving your "normal" variable space. I lifted the serial routines from Al Williams' book and use them all the time in my SX/B programs when I need background serial. I've attached my UART VP work file that you can experiment with. Just set your ISR to 1/4 the fastest bit time you expect. The program that's attached has bit settings for 2400 to 57.6K baud. Note, too, that flags and tix variables are assigned first -- there's a reason for this: If you look at the list file you'll see that the first three bytes of an SX28 program will make it into the global space ($00-$0F) so this means these variables can be accessed without concern of the current bank setting. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=179709#m179812 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)