Alberto, read about "read modify write" and you'll understand the purpose of LAT. If you write to PORTx and read from LATx you should be squeaky.
Alberto, read about "read modify write" and you'll understand the purpose of LAT. If you write to PORTx and read from LATx you should be squeaky.
George
Mike, I did a little research and came to the conclusion that you should both read and write the LAT register.
My logic is a follows, as you correctly say you must write to LAT (to set the latches and thus remember the correct state of the gpio ) but if you read from the PORT you're still left with the RMW problem. But is you read from LAT that goes away.
Alberto, sorry for the confusion.
George
Bookmarks