PortB.6 has analog functions. You need to properly set your ADCON0, ADCON1, and ANSEL to turn those off for digital operation.