Newhaven 4x40 LCD, issues!


Closed Thread
Results 1 to 28 of 28

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    Not sure where you saw Darrel connecting RW to the PIC, in fact he says not to in this post.
    http://www.picbasic.co.uk/forum/show...=2388#post2388

    The R/W pin is exactly what it says Read/Write, with 0 being Write.

    Do you have the contrast pin connected to a pot as recommended? That is the most common problem. That should be pin #3 on the display. Not sure why the data sheet does not so it. Got to have contrast control.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    Sorry, it wasn't Darrell. It was NavMicroSystems in this picture. Anyhow, I literally get nothing. I can't even see the screen flicker. I've verified it has 4.8V at the power input and I've tried using a pot to adjust the contrast. I've only used serial LCD's from SEETRON in the past so this is new to me. Is there a basic way to test the screen? Like applying power to the LCD and +5 to another pin will display something?
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    I do not know of a test.
    Post your code and connections/schematic.
    Maybe we will be able to see the problem.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    Here is what I have:

    Code:
    DEFINE OSC 20
    @ __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    @ __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L & _BORV_3_2L & _VREGEN_ON_2L
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_32768_2H 
    @ __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    @ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_ON_4L & _XINST_OFF_4L
    
    
    loopcount var word
    ;----[ Change these to match your LCD ]--------------------------------------- 
    LCD_DB4    VAR PORTE.1 
    LCD_DB5    VAR PORTA.3 
    LCD_DB6    VAR PORTA.4 
    LCD_DB7    VAR PORTE.2
    LCD_RS     VAR PORTD.3 
    LCD_E      VAR PORTA.5 
    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 ****
    ; 
    ;----[ Your Main program starts here ]---------------------------------------- 
    'LoopCount VAR WORD PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this, ; but some displays are picky) 
    ;
    Main: LCDOUT $FE,1 ; clear screen 
    LCDOUT $FE,$87,"Hello,",$FE,$C8,"From DT!" 
    ;
    FOR LoopCount = 0 TO 65535 
        LCDOUT $FE,$80, IDEC LoopCount 
        LCDOUT $FE,$C0, IHEX4 LoopCount 
    NEXT LoopCount 
    GOTO Main
    Pin connections are as follows:


    1 VSS
    2 VDD
    3 10K POT
    4 PORTD.3
    5 VSS
    6 PORTA.5
    7 N/C
    8 N/C
    9 N/C
    10 N/C
    11 PORTE.1
    12 PORTA.3
    13 PORTA.4
    14 PORTE.2
    15 N/C
    16 N/C

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


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    Did you turn the ADC off someplace ?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    That's the entire code. I rechecked everything and everything looks okay. I bought two LCD's so when I get home I'll try the other one. I don't know what else I can check. I have an old Mikroelectronica board that has pins for parallel LCD's so maybe I'll use that with the standard code (all pins on the same port) to see if it's my hardware or software that's causing the issue.
    Last edited by Christopher4187; - 5th September 2012 at 16:16.

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


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    With those configs ... the PIC is running at 48mhz, not 20.
    So change the DEFINE OSC 20 to DEFINE OSC 48.

    And like Dave mentioned ... add ADCON1 = $0F before the LCD pins/include.
    DT

  8. #8
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    232


    Did you find this post helpful? Yes | No

    Default Re: Newhaven 4x40 LCD, issues!

    Christopher, I had all my wiring correct and the code looked good but I still had no display. The problem was Vo. The contrast was a critical adjustment. Once I found the sweet spot, just above 0 VDC, all was well.

    I've attatched a txt file with the code to test the LCD using E1 & E2, no other hardware needed. R/W can be tied to GND or to an output. Make the necessary VAR pin assinment changes. This code will write to all four lines without using LCDOUT command.

    Wayne

    Newhaven_4x40_Test Code (1).txt
    Last edited by mackrackit; - 7th September 2012 at 21:31. Reason: Updated attachment by request.

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