Bruce, I just re-read your post and see that you already have pull-downs. Hmmmm....... > Then I call this code to read the switches on portb(4..7): > > setb rp0 > mov trisb,#11110000b > clrb rp0 Have you tried a delay here ? Could be some residual charge or capacitance > mov Temp_lvl,portb > swap Temp_lvl > and Temp_lvl,#00001111b BTW, Maarten, the Parallax code in PIC terms is movf portb,w ;copy portb to Temp_lvl movwf Temp_lvl swapf Temp_lvl ;switch values into LSN movlw b'00001111' ;test for '1's andwf Temp_lvl Are internal pull-ups on ? I think nominally they are around 27k, which might marginally balance the 20k pull-downs If they are off, the problem must be elsewhere (duh). Either the port isn't being set up correctly (perhaps a peripheral is enabled ?) or for some external reason the pins really do always have '1' on them. Have you looked at them with a 'scope or meter ? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist