----- Original Message ----- From: brah To: Sent: Thursday, December 28, 2000 4:15 AM Subject: [PIC]:RB0 int pin > I'm presently using portb to drive 3 seven seg displays, multiplexed > with common drives from porta 0,1 & 2. > I need an external interrupt, and I've tried using RB7, with poor > results, mainly due to determining the polarity of the interrupt signal. > I'd like to try RB0 as an interrupt, because of it's settable edge > triggering facility. (I need to interrupt on a falling edge only.) > However, when RB7 is not used as an interrupt, or anything else - it's > not connected - I only have to copy a full byte to the port, and it's > done. What happens to RB7 doesn't matter. > OK - but if I, say, configure RB0 as an input, the rest outputs, setup > RB) as an interrupt pin, set the edge triggering correctly, then get my > byte of data for the 7 segment led, and RLF once (garbage in bit0) and > then write it to portb, I'll be OK on the leds, but what's the effect on > RB0? > I've read a lot on this, and I may have attention deficiency syndrome > (an accute possibility) but I can't find out exactly what happens if you > write to an port bit that's configured as an input. E.G. if the port > bit is held up, a byte is written to the whole port, and the bit in > question just happens to be low. Does the port bit input buffer go low > momentarily, then get pulled back high again once the write operation is > over? If it doesn't then OK, but if it does, would that trigger an > interrupt? > However, even if I don't have an interrupt problem looming, I'd like to > know what happens anyway. > Regards to you all, > Howard. Just remember this: When you read you read the pin. When you write you write the port latch. This means that you'll trash the port latch for RB0 each time you RLF the port, but you will _NOT_ affect the pin value, nor (AFAIK and I'm pretty sure) will you have any trouble with interrupts. The place to watch out is that if you then change RB0 from an input to an output it will immediately start outputting the last value written to the port latch. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads