Need help with LAT instruction


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Need help with LAT instruction

    More specifically, READ from PORTX.Y where the port is deemed an INPUT. This way you can see where the port is. LAT controls OUTPUT. Never tried reading a LAT register when using the port as an INPUT.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Need help with LAT instruction

    Not wishing to be argumentative but it's reading individual bits that is the problem with RMW. Imagine that the bit we want to write to has a capacitive load. To write to a bit (using PORT) the PIC reads all 8 bits, modifies the specified bit and writes back. If we now write to another bit but the load has prevented the original bit from changing, the PIC reads all 8 bits (getting a wrong value from our original bit), modifies and writes back. That why the problem is called Read Modify Write. There are 2 ways to overcome this, either buffer in software or use LAT, both of which "remember" what value was last written.
    George

Similar Threads

  1. Replies: 125
    Last Post: - 24th June 2018, 15:44
  2. Instruction cycle measurement
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 6th August 2012, 08:50
  3. LAT replaces PORT command?
    By markscotford in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd December 2011, 17:37
  4. Instruction times
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th June 2009, 10:16
  5. What does this MCLR instruction mean?
    By bartman in forum General
    Replies: 16
    Last Post: - 30th November 2004, 01:32

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts