Vasile Surducan wrote: > On 5/16/07, Jim wrote: >> I am using RB4-RB6 inputs to detect changes to a couple of Normally closed >> switches and raise an interrupt. This technique I have used successfully in >> the past, But I also have a number of Normally Open switches on RC0 - RC5 >> that I want to trigger a RB interrupt too. What I am proposing is to add a >> 1N4148 diode pointing to the RB input from each of the RC switches in DDL >> style - Is this likely to work? What should I watch for? >> >> >> >> >> +5v >> --+-- >> | >> | >> \ >> / Pullup R >> \ >> / >> | >> | NO Switch >> To Pic ----+-----------O O--------+ >> RC Input | | >> | | >> ---- | >> \/ | >> ---- --- >> | GND >> | >> To Pic --+ >> RB Input > Maybe in the configuration below, a pull down resistor on RB > (10K-100K) will help having a controlled current flow through diode. > When NO will be closed, the falling edge may be sensed on RB. A pull-down resistor would create a voltage divider with the pull-up, wouldn't it? I'd probably use pull-ups all around and reverse the diode: +5V | pull-up1 | Normal input1 -+------switch---Gnd | -- /\ diode | Interr input --+ | pull-up Int | +5V You can also use all pull-downs, connect the switch to positive and reverse the diode. Depending on the type of inputs used (ST or TTL), one or the other gives you a better safety margin. Using Schottky diodes also helps with this. But with the RB ext. interrupt input being normally ST IRRC, having a Vil of 1V (at 5V Vdd), the ~0.7V it gets is fine. (Using pull-downs wouldn't help with ST inputs, because their margins are symmetrical.) Additional inputs get their own pull-up and add another diode to the interrupt input. This is then what's called a "wired or" or something the like. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist