Use of LATX register

Use of LATX register

Postby tulan.kansagara » Fri Jul 25, 2014 5:56 am

Need to know in detail about LATx Register.
tulan.kansagara
 
Posts: 2
Joined: Fri Jul 25, 2014 5:38 am

Re: Use of LATX register

Postby vloki » Fri Jul 25, 2014 9:41 am

It should be described in the datasheet ;-)
(view the figure, try to understand and come back with questions in detail)

lmgtfy
vloki
Verified identity
 
Posts: 176
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

Re: Use of LATX register

Postby tunelabguy » Fri Jul 25, 2014 6:51 pm

tulan.kansagara wrote:Need to know in detail about LATx Register.

Writing to it is the same as writing to the corresponding PORTx register. Reading from it reads the last thing written, not necessarily what is read from the PORTx pins right now. The reason they could be different is if external circuit loading prevents the pin from achieving the state that was commanded. Also a pin that is configured as an input pin will obviously not follow what is written to the PORTx or the LATx register. The real benefit of having a LATx register as distinct from the PORTx register is when executing a Bit Clear or Bit Set instruction. The LATx register does what you expect. The PORTx register might not do what you expect. Setting or Clearing one bit might also change some other bit, but if you do that with the LATx register that does not happen. For more information look for info on the "Read-Modify-Write" problem in the old PICs that did not have the LATx registers.

P.S.: I'm glad Dario posted a link to this forum from the old broken official Microchip forum. Thanks Dario.
User avatar
tunelabguy
Verified identity
 
Posts: 29
Joined: Sun Jul 20, 2014 9:41 pm
PIC experience: Professional 5+ years with MCHP products

Re: Use of LATX register

Postby vloki » Fri Jul 25, 2014 7:53 pm

Hi Robert, nice to "see" you :!:
vloki
Verified identity
 
Posts: 176
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

Re: Use of LATX register

Postby ric » Sat Jul 26, 2014 1:43 am

tunelabguy wrote:...

P.S.: I'm glad Dario posted a link to this forum from the old broken official Microchip forum. Thanks Dario.

Welcome aboard :)
Send me a PM on the official forum just to confirm you are you. ;)
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 452
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to Digital I/O Ports

Who is online

Users browsing this forum: No registered users and 1 guest