If you convert F3 to binary, you have 11110011, wich corresponds to all bits set (1) and RB2, RB3 clear (0). You had those bits analog, so you read a 0 from an analog pin, probably that pins was unconnected or with a low voltage. Try to inicialize ALL pins the very first thing your programs does. No matter you don't use them, is a good policy to leave all non-used pins as outputs and de-activate all analogs, camparators, pwm, ... you are not going to use. And always try to use pull-ups/downs and limiter resistors. I've fried some pins even playing with leds. 2009/5/17 Mahesh P > > Thanks Harold/Tamas. > setting CONFIG3H to make the PORTB[4:0] pins as Digital helped the > simulation. > One thing i could still not understand is: > Why were PORTB[1:0] toggeling (PORTB was 0xF3 when a 0xFF was written to > it) when CONFIG3H told them to come up as analog ? > > Regarding my board, i suppose i have zapped the pin RB5 due to static. > This pin is just connected to a bergstick without any pullup/pulldown. > rest of pins have some PU/PD on it. > > Thanks > -mp > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist