It would help if you posted your entire code, which PBP version and assembler. A schematic of your circuit is always a good idea.

Robert