LCD R/S works on Port A but not Port B


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Try adding this to your code. FLAGS=0 and for the 627A add cmcon=7 to disable the comparators on portA. It is just me but I would initialize the Ports before the Tris with PortB = 0 and PortA = 0 and lose this: OPTION_REG = $80. OPTION_REG = $80 sets WPU when portB is set as input, since you are using it as outputs, it is not needed.
    Last edited by Archangel; - 10th February 2009 at 05:46.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You've screwed up your defines...

    Instead of...

    Define LCD_RSREG PORTB

    you've written...

    define RSREG PORTB

    PICBasic doesn't error on define typo's, and you must have chosen the default setting in the option that works.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    You've screwed up your defines...

    Instead of...

    Define LCD_RSREG PORTB

    you've written...

    define RSREG PORTB

    PICBasic doesn't error on define typo's, and you must have chosen the default setting in the option that works.
    SHARP EYES ! Good catch.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Jan 2008
    Location
    Carrollton, TX
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie and Joe,

    And I had even read Melanies post about not screwing up the DEFINE statements!
    What happened was that I had copied some defines from the pbppic14.lib file and then modified them for PBP, but I missed changing them to upper case.

    This is a good example of why you should post your code when you ask a question. No telling how long it would have taken me to find that.

    thanks again
    TDon

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 works at 4MHz, but not 12 or 16MHz
    By Max Power in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th June 2008, 01:23
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Running an LCD on different port
    By malc-c in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 18th December 2006, 06:41

Members who have read this thread : 1

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