problem with 16f877 and display


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    9

    Default problem with 16f877 and display

    I'm getting trouble with a HD44780 compatible lcd display
    and a pic16f877a that doesn't work togheter!
    Display it's ok when connected to another circuit made around a PIC16f628

    Data and control signals are on port "A"

    data are from A0 to A3
    RS is on A5
    E is on A4

    at the top of the program i put the following defines

    (In the program there aren't other assignment for PORT A)

    //

    DEFINE LCD_DREG PORTA 'LCD data port

    DEFINE LCD_DBIT 4 'LCD data starting bit 0 or 4

    DEFINE LCD_RSREG PORTA 'LCD register select port
    DEFINE LCD_RSBIT 5 'LCD register select bit

    DEFINE LCD_EREG PORTA 'LCD enable port
    DEFINE LCD_EBIT 4 'LCD enable bit

    DEFINE LCD_BITS 4 'LCD bus size 4 or 8

    DEFINE LCD_LINES 2 'Number lines on LCD

    DEFINE LCD_COMMANDUS 2000 'Command delay time in us

    DEFINE LCD_DATAUS 50 'Data delay time in us

    //

    then the first output on LCD is simply made using:

    //
    PAUSE 1000

    LCDOUT $FE,1, "TEST LCD"
    //



    result: no output on LCD


    what's wrong !?!?!?!?




    Steve

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    When this is all you programmed, then you forgot sommething.
    When you do nothing else then this in your programm, the A port is complete an analog port. (see datasheet)
    Try
    ADCON1 = 7
    maybe it helps!

  3. #3
    Join Date
    Jan 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Damn!

    i forgot it wasting the time checking in the wrong way.....


    thanks a lot Mat...

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


    Did you find this post helpful? Yes | No

    Default Port A

    Hi Steve,
    PortA.4 has open drain output, I believe will require external pullup resistor.
    JS

  5. #5
    Join Date
    Jan 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Problem solved.... it work!!!

    first i forgot to define ADCON1 = 7 and the pull-up resistor
    on A4 (open drain) (thanks to Mat and Joe)

    Then another error found was on

    DEFINE LCD_DBIT 4

    instead of

    DEFINE LCD_DBIT 0

    Thanks for help......

    Steve

Similar Threads

  1. LCD problem with 16F877
    By alexx_57 in forum General
    Replies: 10
    Last Post: - 25th July 2007, 13:47
  2. need help on display problem
    By sixty9sandals in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 30th March 2007, 03:57
  3. Display Vref 16f877
    By tico in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th January 2007, 11:34
  4. ISD4003 & 16F877 Interface
    By sayzer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th December 2006, 17:50
  5. Serial from 16F877 to VB
    By jrudd in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th March 2005, 23:33

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