18f1320 - Tris = Ok, Lat = ?

Status
Not open for further replies.

UTMonkey

Member
Hi All,

I have been reviewing all the documentation I have on PICs, now I have my first PIC to program I am trying to make sense of my first Blinky LED program (I think BlueRoomElectronics wrote it).

It all makes sense except I am not sure what LATA does (Latch A)?

Any help gratefully received.

Mark
 
Glad to hear it, try the PORT instruction should still work.
The 18F1320 can be reprogrammed at least 100,000 times so you'll probably never wear it out
 
Well you need to use the PORT register while reading (TRIS must be 1 for any pin you're reading). Always use the LAT register while assigning the output pin (TRIS must be 0 for those pins). PORT does technically work but has the read-modify-write prob and even though that doesn't show up in most circumstances there's no reason at all to be using it.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…