LCD problems when EBIT is changed


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    66

    Default LCD problems when EBIT is changed

    I am using a 28pin PIC16F73 (compatible with 16F877).

    If I connect my pic to a LCD using PORTB pin 3 as the EBIT, my LCD works perfectly.

    DEFINE LCD_DREG PORTA
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50


    TRISB=0 ' PORTB is output
    TRISA=0 ' PORTA is output

    ADCON1 =7 ' PORTA is digital


    However, I need PORTB to connect a keypad and if I now change the EBIT definition to PORTA pin5:

    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 5

    and move the connection to RA5, then my LCD suddenly won't work?

    I have tried anything but cannot understand why this is happening.
    Last edited by passion1; - 9th June 2007 at 14:24.

  2. #2
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    My circuit looks exactly like the one on p.96 of the PBP manual that shows the default setup for connecting a LCD. (except for the fact that I am using a pic16f73 and a 20MHz crystal).

    Thus default connections for LCD.

    Any help or suggestion is appreciated!

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


    Did you find this post helpful? Yes | No

    Default Analog Goodies

    Quote Originally Posted by passion1 View Post
    My circuit looks exactly like the one on p.96 of the PBP manual that shows the default setup for connecting a LCD. (except for the fact that I am using a pic16f73 and a 20MHz crystal).

    Thus default connections for LCD.

    Any help or suggestion is appreciated!
    This PIC has a lot of analog stuff, make sure to disable the comparators, and the Capture compare/PWM goodies, also check data sheet RE: SSP Module as that port is used for that , you may have to set registers to disable. Try CMCON = 7 to turn off the comparators.
    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
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Passion1,

    Did you add a pull up resistor to RA4? It is an open drain type of pin when used in the digital mode.

    BobK

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BobK View Post
    Hi Passion1,

    Did you add a pull up resistor to RA4? It is an open drain type of pin when used in the digital mode.

    BobK
    That's true, but he's on RA5...

  6. #6
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello,

    Yes I did understand he is on RA5 and what he is using each pin for but wouldn't the lack of a pull up also affect the proper operation if he didn't have a high level on RA4?

    BobK

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. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  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