Difference between PORT and LATCH on PIC 18F
The latch is the output latch onto which values are written. The port is the voltage at the actual pin. There are a few situations where they can be different. The one that I’ve encountered most frequently is if you have a pin (accidentally) shorted to ground. If you set the latch high, the latch … Read more