> I still don't know what limits the counter to count binary 000 to 111 > and then restart at 000 does not continuously count up That puzzled me too. The lower 4 bits of PIR1 are all R/W, but maybe the problem was actually the port, not PIR1. Although it is probably very bad practice to use SFRs as general purpose RAM unless you can really justify it and accept responsibility when it all goes horribly horribly wrong, they should work as such. In your case I didn't see anything in PIR1 that would affect a simple program What you could be interpreting as restarting may not be so 0000 0001 .... .... 0110 0111 1000 If you aren't seeing the "!" on the port you might assume that the counter has reset. It's the same effect as AND b'00000111' -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.