In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: In your last sentence, you exactly describe what happens when you leave the ISR, using a JMP instead of a RETI instruction: The PC, FSR, STATUS, and W (and the M in SX48/52 devices) will not be restored. If you really want to make use of an interrupt to detect level changes at the rb.0 and rb.1 inputs, you could have both inputs activate the ISR. Within the ISR, you check which input caused the interrupt, and set global flags, i.e. two bits on a register to indicate which input caused the interrupt. In the main loop, you can then check these flags, and branch into different code in the main loop. Don't forget to reset the flags in the main loop after testing them in order to "arm" them for the next interrupt. Instead of polling the two flags, you might consider directly polling the inputs. It depends on how short puses occuring at the inputs are, and how often you can poll the inputs in order not to miss any. Instead of polling the inputs, you may also read the WKPND_B register (without having interrupts enabled) in order to catch very short pulses. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=103601#m103604 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)