4-line LCD Help - using PortA instead of B


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Exclamation

    Interestingly, I see that the Crystalfontz displays require a pretty substantial intitialization routine. I can't tell if that is the same as what PBP send as standard or not.

    I downloaded a demo app, and it sets the bits E,RS,etc. high and low for about 10 seconds in a pattern that looks like it must be matching the tech notes for their displays. It takes the PC parallell port driver about 10 seconds to send all the bit settings, so I'd guess it is much more than 'standard'..

    The Crystlfontz guys don't seem to be able to provide details about exactly WHAT bits need to be sent and in what order to initialize the LCD.

    I think my time is better spent switching to an LCD that we KNOW works with PBP, which is too bad because CrystalFontz LCDs really look nice.

    Thanks as ususal for all the help folks!

    TG

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


    Did you find this post helpful? Yes | No

    Default

    can you try something for me and post your results?


    Code:
    ' place your LCD define here and all the others
    
    pause 2000
    FLAGS=0
    pause 500
    LCDOUT $fe,1
    pause 500
    
    start:
         LCDOUT $FE,1,"Hello"
         Here: goto Here
    Last edited by mister_e; - 25th March 2005 at 15:49.
    Steve

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

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Thanks - I ran the following:

    ' VERY SIMPLE LCD TEST

    OSCCON=%01111000
    DEFINE OSC 8

    Include "modedefs.bas" ' Include serial modes
    @ __CONFIG _CONFIG1H, _OSC_INTIO67_1H
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    @ __CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
    @ __CONFIG _CONFIG4L, _LVP_OFF_4L & 0bfh ;_XINST_OFF_4L

    ADCON1 = 7

    TrisA = %00000000
    PortA = %00000000

    DEFINE LCD_DREG PORTA ' Set data pin of LCD to
    DEFINE LCD_DBIT 0 ' PORTA.0-PORTA.3

    DEFINE LCD_RSREG PORTA ' Set RS bit of LCD to
    DEFINE LCD_RSBIT 5 ' PORTA.5

    DEFINE LCD_EREG PORTA ' Set E bit of LCD to
    DEFINE LCD_EBIT 4 ' PORTA.4

    DEFINE LCD_LINES 4 ' 4 Lines LCD


    pause 2000
    FLAGS=0
    pause 500
    LCDOUT $fe,1
    pause 500

    start:
    LCDOUT $FE,1,"Hello"
    Here: goto Here

    END

    -- No response from the LCD. I did use an LED to see if the lines were getting data - testing E, RS, and the 4 data lines, there is activity going on, so the PIC is sending data. I have to assume that the Crystalfontz LCD needs some sort of more advanced setup routine be sent to it.

    TG

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Tom,

    I guess you have double and triple checked you wiring.

    if so
    there must be something special with CrystalFontz.
    I use a lot of LCDs and have tried a lot of brands (except CrystalFontz), without any problems at all.

    Has anyone on the forum ever used a CrystalFontz - CFAH2004L-YYB-JP with a PIC ?
    Last edited by NavMicroSystems; - 25th March 2005 at 20:15.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    I just took a peek at the Hitachi 44780 LCD controller data sheet.
    The initialization routine shown in the Crystalfontz part is the same - taken word-for-word from the Hitachi 44780 specs. So PBP should be initializing it properly.

    Arch

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Arch,

    that's what I thought, as it has an embedded 44780.

    Assuming Tom has got his hardware wired up properly I don't know how to slove his problem.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    The Mfg sent along this note:


    --------------------------------------------------------------------------------
    quote: "All I see are row 1 and 3 with shading, rows 2 and 4 blank, and no text."
    --------------------------------------------------------------------------------

    This is a sign that the lcd controller is not initialized. A typical init sequence is:

    0x38 [wait 4mS] 0x38 [wait 100uS] 0x38 0x38 0x08 0x01 0x06 0x0C

    just like the data sheet shows. Apparently LCDOUT is not performing the init. I think it has an internal flag to keep track of the init, and it probably thinks it doesn't need to do it again. I'm not really familiar with that code.
    __________________

    Does anyone know how to 'manually send' those commands? What is 0x38, etc?

    Tom

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Tom,

    You definitely don't have to worry about "initialisation" with PBP and a 44780 (or compatible),
    PBP does it for you.

    you have either got a bug in your wiring or your LCD is "dead" (or even both)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  9. #9


    Did you find this post helpful? Yes | No

    Default

    I have to agree with Ralph,you have a short somewhere or bad connection.

  10. #10
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    OK, folks. Thanks for the help. I am going to rewire this to another LCD and see what happens. I agree something must have gotten messed up or fried, it just is not that complicated.

    Tom

Similar Threads

  1. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  2. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 09:06

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