Could be RMW issue if those T# are on same port, better in that case to change them all at once like PortB=%00000100 PortB = %00000011