it's not going to work with XOR... ^1 would work.

AndrewC, post your Whole code, sure enough you have something else on the top of it. As usual check for multiplexed stuff on the offending I/O.