In SX Microcontrollers, SX/B Compiler and SX-Key Tool, rmayhew wrote: I added a jump to a variation of the SerIn command in the Main, avoids waisting an interupt poll. This leaves the interupt for machine timing. Transmit to the chip in packets ( X number of bytes always, discarding unused bytes in the chip) and don't forget your handshakes at the end of an interupt subroutine. During the receive transmit disabling the interupt worked the best, reenabling after SerIn or SerOut. Also keeping the transmission to a set of number bytes and using the leading and lagging bytes as error handlers helped. Why? Your scan is in the Main more than in the interupt. If Packets are a set size adjusting the machine interupt timing to make up for Comms is easy, this can be done in the simulator. Hand shake from the interupt subroutine places it in a good position for timing adjustments. How? Jump from the Main and handle the pin state for the first byte, then receive the rest of the packet nomally. Error Checking? Valid commands or first and last byte. HandShake? Oh yes, your application should conclude the data was transmitted succesfully and it's a good place to pass variables up stream, do that from the interupt subroutine. ( make sure it fits between interupts ) RS485, LAN, or multichip? That would be part of a packet ID. [url=http://forums.parallax.com/forums/default.aspx?f=7&m=223702]http://forums.parallax.com/forums/default.aspx?f=7&m=223702[/url] Comms is set for 38400. SX 50mhz. Packets can be timed to fit between interupts to avoid timing interuptions.( Not done above though. ) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=2&m=175077#m228600 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)