Thank you for your help Paul. This looked like a logical solution, but now RB4 goes high on powerup, and stays there. I tried adding "LOW PORTB.4" after the ENDIF, and it goes low and never goes high! Strange behavior, I think.