You don't seem to set PortB.1(Drive) to output anywhere. Use LOW,HIGH,OUTPUT or TRISB.1=0.

/Ingvar