What are you trying to achieve with the code, what do you have connected to the ports:

portb.1 - ?
portc.1 - ?
portc.2 - ?
portc.3 - ?
portc.4 - ?
portb.2 - ?

Cheers

Paul