PortA = PortA & %00001111 would only work if the lower 4-bits were already set,
and would guarantee the higher 4-bits would be 0.
You want to OR the port with %00001111 to leave the higher 4-bits unaffected.
PortA = PortA | %00001111 would set the lower 4-bits, leaving the higher 4-bits
as-is.






Bookmarks