In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Chong wrote: Changed my login name. I think MadMax was getting too much attention. I'm a member of several forums, I try to stick to the same usernames to keep my end of things simple. More serious forums deserve less goofy names anyways. Sam, I realize that I do have to reset the appropriate reg's on reentry to main. I planned to do that at the beginning of the destination loops that the ISR would JMP to. Geunther: I am attempting to scan a GPIB to look for a certain chain of bytes put across 8 I/O lines. I have loops set up to do comparisons when a DAV line is asserted true. In essence my intention is to wait in a minor loop for an ATN line to be asserted false (this indicates a device specific command or data). Once the ATN line is false (high) the first loop looks for the first byte in my sequence when the DAV (data ready) line is true (low). When the first byte is found, the loop exits to look for the second byte in my sequence. If the second byte does not occur on the next DAV assertion, (i.e. wrong byte value) the second minor loop JMPs to the first loop looking for the first byte again. I wish to use interrupts to detect if the ATN line becomes true during the search loops because if this occurs, the message being sent across the bus is a bus management command which I am not interested in. It also indicates that the chain of bytes I'm looking for is not coming in this bus sequence so the search should reset to looking for the first byte. I am also looking to use interrupts to detect a mode switch being flipped which should halt the byte sequence search and set the device to an adjustment mode where the user can change device settings. I'm using polling for the byte searches beause I need relatively fast response. The refresh rate on the data lines can pass 1Mbyte which is pretty quick. I've stretched out the time that a byte is available with an 8bit latch which holds the value until the DAV line is recycled so I at least don't have to catch a byte in the short time that the bus holds it valid (the byte may change while DAV is false). I'm hoping to use interrupts because the flag checking code might add extra cycles in the byte searching loops. It's already kind of bad that I will be losing 3 cycles per loop refilling the pipe while spinning in a byte comparison loop. At 50Mhz that's not too bad because I should get around 10 looks at the data pins per loop. If I put in flag comparisons I'll be down to 6 or 7. Usually I work with the Basic Stamps. Most of my electromechanical things can't really react all that fast in the physical world so I've gotten away with higher level programming. I did think about using a SX chip in a simpler capacity though. Initially I was planning to use it for just the byte comparison job to tell the Basic module to do it's thing. In the end, I think I'd like to integrate everything into the SX processor because the code on the Basic module is actually pretty simple too so I might as well save the extra cost of the Basic module. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=103601#m103906 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)