Maximun Cable Length for PIC to LCD


Closed Thread
Results 1 to 40 of 53

Hybrid View

  1. #1
    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.

  2. #2
    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

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


    Did you find this post helpful? Yes | No

    Default

    OOPs, one more thing to get that to compile.

    In your PBP folder, open the 16F877A.INC file, and comment out the __config line with a semicolon ;

    Now you should be good to go.


    mister_e,

    At least now I know where to go if I need some extra wire.
    Sheesh.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel. I have installed MPLAB IDE v8.00 Full Release and setup was done as mentioned.
    Now when compiled I get the MPASM window showing the process and then shows 18 errors.
    This goes by very fast and starts green and then goes red. The errors are similar to what I had before. Here are a few. I have omitted the path for each error.

    205 : Found label after column 1. (WritePort)
    205 : Illegal opcode(_Char)
    234 : Illegal opcode(_LCD_DATAUS)
    249 : Found label after column 1.(DelayUS)
    267 : Illegal opcode(LCD_COMMANDUS)

    and many more

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


    Did you find this post helpful? Yes | No

    Default

    Arrrrgh!

    Sorry to put you thru all this, it shouldn't be that hard.

    I can't really say what's happening from the errors you showed.
    I could probably see what's wrong if you could send the .LST file.

    It'll be too big to post, but you could email it to
    darrel at pbpgroup.com

    It should've worked
    <br>
    DT

  6. #6


    Did you find this post helpful? Yes | No

    Default

    you all must have cringed when i posted my first blinky on bread board. lol mine are true ratsnests. guess it's time to buy some neato jumpers and stop being a disgrace. sniff lol

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    mister_e,

    At least now I know where to go if I need some extra wire.
    Sheesh.
    <br>
    Have a look at the last lines of the link... About The Author.. i'm afraid
    Steve

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

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Have a look at the last lines of the link... About The Author.. i'm afraid
    And to think I did not have to go to school to be that messy
    Dave
    Always wear safety glasses while programming.

  9. #9
    dideco's Avatar
    dideco Guest


    Did you find this post helpful? Yes | No

    Default

    A CMOS chip as a buffer (such as 4050) can be added to the parallel cable to use longer wires. Also some resistors will help to make a kind of current loop by placing 2.2-4.7 Kohms close to inputs of the LCD unit.

    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

    "Data delay time" should be longer, such as 500 microseconds or longer. This will help the commads to reach display safely. Pulse decreases because of cable capacitance and resistance (RC time constant). LCD displays can load data in its register buffers in a very short period but cannot execute it as fast as loading. Thats why command delay time is 40 times longer.

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


    Did you find this post helpful? Yes | No

    Default

    Thanks Dideco for your input, I will carry on with Darrel's method for now as I find it quite interesting and I have been at it for a while. Darrel, here is what I have found so far. I have been able to get your Hijack routines to work without any errors. I am now able to see a perfect display on long lengths of cable. I have tried 20 to 40 ft of 22 awg multi-cable and the display is perfect. I did not need to adjust any delays. I have not been able though, to get the displays to switch properly using the method you described for your 2 LCD's on one pic display method. Have a look at Display_1 and you will see the display is correct using your sample code. On Display_2 you will notice that there are problems on both displays when using the hijack routines.

    Thanks.
    Attached Images Attached Images   

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