Mark Peterson wrote: > > If RBIE, the RB port change interrupt bit in the INTCON register, is set to > 1, will a change on any RB bit result in an interrupt? I'm wondering if an > interrupt is generated only if a change is detected on an RB bit that has > been designated as in input, or, will an interrupt also be generated if a > an RB bit that has been designated as an output changes state as a result > of the PIC program itself writing something to it. > > Thanks. Only pins RB4 - RB7 have interrupt on change. Looking at the data sheet for a portb pin with interrupt on change capabillity, you can see that this interrupt is ANDed with the TRIS line so that it is inactive if the pin is set as an output. During the interrupt, don't forget to read from portB to reset the changed condition, then clear the RBIF flag. If you fail to do this, you will have a repeated interrupts if you keep RBIE and GIE set. -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com