Hello,
Since all three switches will be set up to cause an interrupt on a falling edge, the inputs are effectively NANDed together before being fed to the edge sensitive interrupt circuitry within the MCU. This means that, while any one input remains low, no further edges can be generated - the logic level at the output of the combining gate will be continuously high.
At this point, the particular active switch should be determined, and the interrupt disabled for that input, to allow further interrupts to occur for the other inputs. The switch states would then need to be peridically tested, to determine when each individual interrupt should be re-enabled. For a mechanical switch, the process will also need to implement a suitable debounce delay, to prevent multiple interrupts occurring for a single switch closure.
For the device you are using, it is possible to alter individual inputs for positive edge interrupt, which might at first appear to solve the problem for the toggle switch input. However, there will be a serious side effect - the internal pullup then becomes a pulldown, and the pullup/down cannot be disabled during KBI operation. So any external pullup resistor you might provide would conflict with the internal pulldown.
As Tony P suggested, the simplest solution may be to periodically poll the state of the toggle switch (from within the main program loop) for both on and off states. For a hand-held (presumably battery operated) equipment, another issue may be the continuous current drawn by the internal pullup whilst the toggle switch remains active. The pullup may need to be periodically enabled for a short period only, just prior to polling the switch state.
Regards,
Mac
Message Edited by bigmac on 2009-03-24 01:04 PM