Maximun Cable Length for PIC to LCD


Closed Thread
Results 1 to 40 of 53

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Apples it is ..

    Built a 16F877A breadboard. With LCD on the above mentioned ports.
    Still haven't hooked up the ribbon yet, just wanted 1 LCD at this point.

    Here's the Breadboard.

    Click image to enlarge

    And here's the program it's running.
    Code:
    @  __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    
    ADCON1 = 7
    CMCON = 7
    
    DEFINE OSC 4
    
    ;----[ Change these to match your LCD ]---------------------------------------
    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
    LCD_Lines     CON 2    ' # of Lines on LCD,  1 or 2 (Note: use 2 for 4 lines)
    LCD_DATAUS    CON 50   ' Data delay time in us 
    LCD_COMMANDUS CON 2000 ' Command delay time in us 
    
    INCLUDE "LCD_AnyPin.pbp"  ; *** Include MUST be AFTER LCD Pin assignments ****
    
    PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this,
                                         ;  but some displays are picky)
    
    LCDOUT $FE,1,"Hello wildbilly",$FE,$C0,"Must be something",$FE,$94,"In the Hardware"
    
    Main:
    ;    toggle LED
        pause 1000
    goto Main
    Can you see anything I've done different??
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Your apple must be the Macintosh because yours is working and mine is not.
    Ok, here is what I have found. I have loaded your code to a new main program and could not compile it. I am getting this error: "opcode expected instead of '_config' "
    for this line @ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF

    and I get these errors for this line : INCLUDE "LCD_AnyPin.pbp"
    "opcode expected instead of 'writeport' "
    "opcode expected instead of 'delayus' "
    "opcode expected instead of 'outputport' "

    I have checked the Hijack code included in the PBPPIC14.lib file and I think it was modified correctly. Any clues?

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    I am getting this error: "opcode expected instead of '_config'
    Ah Ha, You aren't using MPASM as the assembler.

    Almost anything written with ASM mixed in the program, needs to be compiled with MPASM. The assembler that comes with PBP is OK for PBP itself, but it just doesn't have the capabilities needed for ASM, even though sometimes it will compile OK.

    Here's a hex file for mine if you want to try it.
    If yours isn't runnung at 4Mhz, I'll change it to your crystal.
    <br>
    Attached Files Attached Files
    DT

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Apples it is ..

    Built a 16F877A breadboard. With LCD on the above mentioned ports.
    Still haven't hooked up the ribbon yet, just wanted 1 LCD at this point.
    <br>
    I can't add anything more on Darrels suggestions, but have to admit that the breadboard is very tidy good looking! An art in breadboarding!

    The background that seems like a pcb, what is it?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for noticing Ioannis,

    The first breadboard I ever bought came with a box of 3M pre-cut jumpers.
    I just thought that's the way it's supposed to be done.

    Thanks to my "Glowing Eyed Monsters",
    I also learned to trim the leads off of the parts so they sit flat on the breadboard.
    There's another breadboard of mine in that thread too. Same style.

    I never knew how bad a breadboard could be till I ran across this ...
    http://cs.nyu.edu/~jhan/ledtouch/
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Yeah! He is indeed very neat. I am inspired to do the same. The background looks like a chair seat. Darrel your wildbilly.hex file ran ok. I have never used MPASM. I should try and get it going.

    Thank you.

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


    Did you find this post helpful? Yes | No

    Default

    The background looks like a chair seat.
    DING! Give that man a cigar.
    I forgot to answer it. oops.

    I have never used MPASM. I should try and get it going
    Just go here... at the bottom of the page, install the MPLAB IDE v8.00 Full Release Zipped Installation
    http://www.microchip.com/stellent/id...&part=SW007002

    Are you using MicroCode Studio for the IDE?
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    one of the less neat prototype i've never ever saw ...
    http://www.botmag.com/articles/bionic_stamp.shtml

    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel. I am using Microcode Studio.

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


    Did you find this post helpful? Yes | No

    Default

    Great. That makes it easy.

    After installing MPLAB ...

    In MCS, go to the View | Compile and Program Options | Assembler Tab

    Click the Find Manually ... button and point it to
    C:\program files\microchip\mpasm suite

    Then check the Use MPASM checkbox.

    You should be good to go.
    <br>
    DT

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, 19:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. DS1820 Max Cable length ?
    By dccch in forum General
    Replies: 2
    Last Post: - 24th January 2008, 07:44
  4. Measure cable length with a PIC?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th July 2007, 18:45
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23: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