Quote Originally Posted by texas5 View Post
"PortA = PortA -1, although I don't think I'd use this method. I'd use another variable to do the counting and then copy that variable into portA"

what method do you prefer to use???what is the meaning of PortA = PortA -1 in this case???sory to ask,i'm a newbie in this thing.thanx once again for your reply...
If you use PortA = PortA - 1, you may run into issues with the PIC.
PortA=PortA - 1 will read the actual values on the pins, subtract one, and write it back.
Sounds good in theory, doesn't always work that way in practice. Might work well, might not.
I think a better way would be to read that PortA value into a temporary variable, subtract 1, then write that value back. At least then you have a copy of that value in that temporary variable to mess with, and without messing with the actual Port itself.