Another simple program misbehaving


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Another simple program misbehaving

    What happen if you change your High & red definition with
    Code:
    Red         var LATB.5
    Green       var LATB.4
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default Re: Another simple program misbehaving

    Quote Originally Posted by mister_e View Post
    What happen if you change your High & red definition with
    Code:
    Red         var LATB.5
    Green       var LATB.4
    ...magically all my problems seem to go away now. I've never needed to use LATX before. Maybe you can educate me a little on why I needed to this time. The datasheet seems to imply that writing to the latch is just a more direct way of writing to the port, but maybe I'm not catching the nuance.

    Thanks
    David

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Another simple program misbehaving

    You should also do it with PIC18 and with all PIC having LATx register. This is to avoid the R-M-W issue. The datasheet explain it, like you said. For further details you may want to have a look at this document

    http://www.cornerstonerobotics.org/c...mw_problem.pdf
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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