I think it's probably working, but you don't realize it.
In your code, the only thing you're reading is GP1, and prior to that it writes to GP1, so you're thinking you should read the same value back.
But when you write to GP1, the value is actually written to OLAT1.
Reading GP1 reads the state of the pins, not what was written to GP1.
<br>
Bookmarks