Bit masking is another method, using the AND and OR (& = AND, | = OR). AND is a way to turn off selected pins without affecting others: LATB = PORTB & 111110 would turn off PORTB.0. LATB = PORTB | 000001 would turn on PORTB.0. LATB = PORTB & 110000 would turn off the low nibble while LATB = PORTB | 001111 would turn on the lower nibble. Doing it this way leaves the pins you don't want to mess with alone. They remain totally unaffected. This would apply to pins tied to PWM, INTERRUPTS, or anything else.