LAT replaces PORT command?


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: LAT replaces PORT command?

    It is all clearly explained in the device data sheet - with further clarification in the MCHP Family Reference Manual.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: LAT replaces PORT command?

    PORTx and LATx are not commands, they are registers (basically RAM location in the PIC).

    Because of the way the PIC works internally (using a read-modify-write cycle) and depending on what the output pins are driving you can get the problem you had. Writing to the port latch (LATx) instead of directly to the port (PORTx) avoids the problem because the read-operation of the read-modify-write cycle is then performed agains the port latch instead of against the actual output pins.

Members who have read this thread : 2

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