LCD with PIC16F687


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    I had a similiar problem. Turned out I was configuring registers wrong. I notice some of the pins that you are using can also be analog. You need to make them digital for the LCD command to work. Try making ANSEL = %11111111. I can't remember if %00000000 is analog or digital, but I thought it was analog.

  2. #2
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    You also need to make anselh=%00001111. Anselh is the analog register for port C while ansel is the register for port A. Like I said though I may have the 0's and 1's backwards. I always get confused and have to experiment. The four 0s at the beginning are don't cares.

  3. #3
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Apparently that was what I needed to do. I did not have the ANSELH register set. To set each pin to the Digital function, each bit must be set to a "0", so ANSELH = %00000000. Thanks.

    My LCD works now and gives me the Hello World example that I have seen in numerous examples. Thanks.

  4. #4
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Would you have any advice for setting the configuration bits? Now I am manually changing them before I load the program into the microcontroller.

    I want to disable the watchdog timer and master reset to be internal.

    Thanks.

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


    Did you find this post helpful? Yes | No

    Default

    read the FAQ, there's a huge thread about that http://www.picbasic.co.uk/forum/showthread.php?t=543
    Steve

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

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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