Problem with Newhaven LCD on 18LF66K80


Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    May 2014
    Location
    Stone, Staffordshire, UK
    Posts
    3

    Default Problem with Newhaven LCD on 18LF66K80

    Hello,

    I am having great difficulty getting a newhaven 20x4 LCD working on my 18LF66K80 in 4 bit mode. When using PORTA.0-3, once one bit of data is set, it gets unset before the next is set. I have temporary solved that by embedding assembler which achieves the same thing, however I am getting a persistent problem where the display just shows 2 rows of vertical lines.



    I also get similar results from using LCDOUT, where basically when I set all the bits suitably it "just doesn't work" with similar effects to above.

    I am confident with the wiring as we have another PIC with the same code written in C (albeit 8bit) working perfectly.

    Code:
    D4-7 are on RA0-3 respectively
    RW is on RF3
    RS is on RF2
    E0 is on RA5
    The following are the defines I tried for LCDOUT.

    Code:
    DEFINE LCD_DREG PORTADEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTF
    DEFINE LCD_RSBIT 2
    DEFINE LCD_REREG PORTF
    DEFINE LCD_RWBIT 3
    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 5
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2100
    DEFINE LCD_DATAUS 500
    An example of the code I am using to display some text is below:

    Code:
    Main:
        LCDOut $fe,1:FLAGS=0:Pause 250
        LCDOUT "Hello World"
        pause 2000
    goto Main
    Any help getting to the bottom of this would be hugely appreciated!
    Last edited by KrisDouglas; - 30th May 2014 at 11:13.

Similar Threads

  1. Problem with GOSUB/GOTO and Newhaven OLED question
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th April 2013, 11:24
  2. Newhaven Serial COG 2X16 LCD
    By Neosec in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th March 2013, 07:09
  3. Newhaven 4x40 LCD, issues!
    By MOUNTAIN747 in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 18th October 2012, 23:23
  4. Replies: 36
    Last Post: - 14th March 2011, 19:38
  5. LCD Problem!
    By uaf5000 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th May 2010, 00:06

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts