18F2620 Comparator Problems


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    Thanks for the reply.

    After I spent the better part of a day trying to figure out what I was doing wrong in software, I finally realized just what you spotted about the LCD drive signals - double duh on my part! I was about to post that I found the problem, but you beat me to the punch.
    In my production code however, I had the comparator mux set up so the offending LCD drive signal was deselected (or so I thought), so I'm a bit puzzled about why it affected the comparator. Anyway, moving E and RS to another port fixed it.

    The code snippet that I posted was actually a piece of test code I wrote just for this post to illustrate that just turning on the comparator causes the problem. Obviously I rushed and didn't check some of the other things you spotted. In my actual production code, everything is as you suggest it should be, except the LCD "Dbit" specifier. It actually works with a "1" instead of a "4", so I suspect that anything other that a "0" will work similarly - I'll check.

    Thanks for being so thorough. Sometimes another set of eyeballs locks right in on a problem that might have eluded one for hours.

    Joe

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe Rocci View Post
    In my actual production code, everything is as you suggest it should be, except the LCD "Dbit" specifier. It actually works with a "1" instead of a "4", so I suspect that anything other that a "0" will work similarly - I'll check.
    I looked thru the PBP library files, and you're correct.

    The way it uses LCD_DBIT is always the same ...
      if ((LCD_DBIT) == 0)

    So anything other than 0 will be treated like a 4.

    I had thought you were starting the Data bus on PORTB.1, which wouldn't have worked.
    My mistake.
    <br>
    DT

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    It may work with 1, and automatically default to bit 4, but I wouldn't rely on this for anything down the road. The correct arguments are 0 or 4. If they make some change to a library file down the road, and you have 1 VS 4, this may screw-the-pooch after an update.

    I would opt for the correct arguments as shown in the manual just to be safe. I have seen stuff like this change with compiler updates, and it can end up being a real headache to debug.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. In Circut Debug (ICD) buttons palet is disable for 18F2620
    By muskut in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th June 2010, 05:21
  2. 18F2620 tmr0 and interrupts
    By astouffer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th March 2009, 00:56
  3. X-10 and the proper XOUT statement for 18F2620
    By JohnP in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th December 2007, 22:04
  4. 18F2620 compile problems in PBP
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th August 2006, 10:11
  5. How can I find Code Loader 18F2620 files ?
    By muskut in forum General
    Replies: 1
    Last Post: - 14th October 2005, 12:26

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