Reading the LATB register does not show the actual state of the pins.
Reading PORTB does, so you might want to add PORTB to your LCD readout like in the image below.
I've run your program in Proteus and everything seems fine.
I did add PORTB to the LCD, it's on the third line.
Obviously, a simulator doesn't prove that it will work on real hardware, but Proteus is really really good.
If your LAT register shows 1's, and the TRIS register is 0's then the PORT register should show the same values as the LAT register.





Bookmarks