Maximun Cable Length for PIC to LCD


Closed Thread
Results 1 to 40 of 53

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I think the problem is that it is just plain too cold where you live!
    Charles Linquist

  2. #2
    Join Date
    Nov 2005
    Location
    Ontario Canada
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    That's a good laugh. I thought someone would have that reply.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by wildbilly
    Darrel I have installed the Highjack routines and also included the LCD_Anypin.pbp and VirtualPort.bas in the PBP folder. I then added the Include file in my main program just below the define Parameters.
    Excellent!

    Does your main program have this section (modified for your hardware of course).
    The old lcd DEFINES can be commented out.
    Code:
    ;----[ Change these to match your LCD ]---------------------------------------
    </i></b></font><b>LCD_DB4   </b><font color="#008000"><b>VAR </b></font><b>PORTA</b>.<font color="#800000"><b>0
    </b></font><b>LCD_DB5   </b><font color="#008000"><b>VAR </b></font><b>PORTB</b>.<font color="#800000"><b>3
    </b></font><b>LCD_DB6   </b><font color="#008000"><b>VAR </b></font><b>PORTB</b>.<font color="#800000"><b>7
    </b></font><b>LCD_DB7   </b><font color="#008000"><b>VAR </b></font><b>PORTC</b>.<font color="#800000"><b>1
    </b></font><b>LCD_RS    </b><font color="#008000"><b>VAR </b></font><b>PORTD</b>.<font color="#800000"><b>4
    </b></font><b>LCD_E     </b><font color="#008000"><b>VAR </b></font><b>PORTA</b>.<font color="#800000"><b>1
    </b></font><b>LCD_Lines     </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>2    </b></font><font color="#0000FF"><b><i>' # of Lines on LCD,  1 or 2 (Note: use 2 for 4 lines)
    </i></b></font><b>LCD_DATAUS    </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>50   </b></font><font color="#0000FF"><b><i>' Data delay time in us 
    </i></b></font><b>LCD_COMMANDUS </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>2000 </b></font><font color="#0000FF"><b><i>' Command delay time in us 
    
    </i></b></font><font color="#008000"><b>INCLUDE </b></font><font color="#FF0000">&quot;LCD_AnyPin.pbp&quot;  </font><font color="#0000FF"><b><i>; *** Include MUST be AFTER LCD Pin assignments ****</i></b></font>
    DT

  4. #4
    Join Date
    Nov 2005
    Location
    Ontario Canada
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel. I added the list below and no longer have the error but no longer have a display on
    the LCD. I only have two black bars.

    'LCD_DB4 VAR PORTB.0
    'LCD_DB5 VAR PORTB.1
    'LCD_DB6 VAR PORTB.2
    'LCD_DB7 VAR PORTB.3
    'LCD_RS VAR PORTB.4
    'LCD_E VAR PORTB.7

    The list below works fine.

    'LCD Parameters
    '============
    DEFINE LCD_DREG PORTB ' LCD Data port
    DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' LCD Register Select port
    DEFINE LCD_RSBIT 4 ' LCD Register Select bit
    DEFINE LCD_EREG PORTB ' LCD Enable port
    DEFINE LCD_EBIT 7 ' LCD Enable bit
    DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 4 ' Number of lines on LCD
    DEFINE LCD_COMMANDUS 2000 'Command delay time in us
    DEFINE LCD_DATAUS 50 'Data delay time in us

    My LCD is connected just like your example " http://www.pbpgroup.com/files/2_LCDs.gif

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


    Did you find this post helpful? Yes | No

    Default

    Bummer,

    OK, let me re-create it here.
    Back at ya soon.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    OK,

    Just to make sure, I went thru the steps again myself.
    Have it working here on a 16F88. One thing I had to add that wasn't mentioned here, although it was in the other thread ...
    Code:
    PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this,
                                         ;  but some displays are picky)
    But so that I can compare Apples to Apples, What PIC are you using?

    I bought 25ft of ribbon today, just to make sure. But haven't hooked it up yet.
    DT

  7. #7
    Join Date
    Nov 2005
    Location
    Ontario Canada
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    I added the code
    PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD
    with the same result. I am using the 16F877a

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  3. DS1820 Max Cable length ?
    By dccch in forum General
    Replies: 2
    Last Post: - 24th January 2008, 08:44
  4. Measure cable length with a PIC?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th July 2007, 19:45
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07

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