More specifically, READ from PORTX.Y where the port is deemed an INPUT. This way you can see where the port is. LAT controls OUTPUT. Never tried reading a LAT register when using the port as an INPUT.
More specifically, READ from PORTX.Y where the port is deemed an INPUT. This way you can see where the port is. LAT controls OUTPUT. Never tried reading a LAT register when using the port as an INPUT.
Not wishing to be argumentative but it's reading individual bits that is the problem with RMW. Imagine that the bit we want to write to has a capacitive load. To write to a bit (using PORT) the PIC reads all 8 bits, modifies the specified bit and writes back. If we now write to another bit but the load has prevented the original bit from changing, the PIC reads all 8 bits (getting a wrong value from our original bit), modifies and writes back. That why the problem is called Read Modify Write. There are 2 ways to overcome this, either buffer in software or use LAT, both of which "remember" what value was last written.
George
Bookmarks