https://onlinedocs.microchip.com/oxy/GUID-BA964748-63AC-4D4B-AD5F-E96EAA995DF8-en-US-22/GUID-F5752F82-5814-4C59-A68D-AE5697778E8B.html
19.3 LATx - Output Latch
The Data Latch ( LATx registers) is useful for Read-Modify-Write operations on the value that the I/O pins are driving. A write operation to the LATx register...
outputlatch