LCD Problem


Results 1 to 7 of 7

Thread: LCD Problem

Threaded View

  1. #2
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: LCD Problem

    You might want to go ahead and add DEFINE's at the beggining of your program, and the first PAUSE 500, change to Pause 1000
    Make sure the correct LCD pins are going to the correct PIC pins, some LCDs pinouts are different even if they have 14 or 16 pins.
    What did you use to set your occilator value, if your not using a internal OSC you might need to DEFINE OSC. You will probobly want to use a TRIS command to define the I/O of your pins too, this causes alot of problems when left out.

    What I find is that if the LCD is a 2 line display, and the top is full and bottom empty, the LCD is not initialized, on a 4 line its the top 2.
    it will usually do this for about a second when first turned on then will clear and then show data when its working right.

    Look in the manual and read up on DEFINE, LCDOUT you can also access a free ebook on GoogleBooks, search for "30 pic projects" on the google books site, its great for learning PBP.

    Here is a program I wrote for 18F 40Pin devices and only using PORT D for "Display", You can also tie a LED (Long Leg) directly to PORTD Pin 6 and the Short Leg to GND the led will be very bright, you can add a resistor if you want.

    Code:
    DEFINE LCD_DREG PORTD   ' LCD Data bits on PORTD
    DEFINE LCD_DBIT 0       ' PORTD starting address
    DEFINE LCD_RSREG PORTD  ' LCD RS bit on PORTD
    DEFINE LCD_RSBIT 5      ' LCD RS bit address
    DEFINE LCD_EREG PORTD   ' LCD E bit on PORTD
    DEFINE LCD_EBIT 4       ' LCD E bit address
    DEFINE LCD_BITS 4       ' LCD in 4-bit mode
    DEFINE LCD_LINES 4      ' LCD has 4 rows
    
    TRISD = 0			' PORTD is output
    
    PAUSE 1000			' Wait 1 sec for LCD to initialize
    LCDOUT $FE, 1			' Clear LCD
    
    AGAIN:
    LCDOUT $FE, 2
    LCDOUT $FE, $80
    LCDOUT "I Am ---"
    Pause 500
    LCDOUT $FE, $80
    LCDOUT "WORKING!"
    PAUSE 500			' Wait .5 seconds
    TOGGLE PORTD.6			' Blink LED to show Program Running
    GOTO AGAIN 			' Repeat
    END
    Last edited by wdmagic; - 20th June 2013 at 22:01.
    Chris


    Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."

Similar Threads

  1. LCD Problem!
    By uaf5000 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th May 2010, 23:06
  2. LCD problem
    By Andre_Pretorius in forum General
    Replies: 8
    Last Post: - 27th January 2009, 15:47
  3. problem with 2*16 lcd
    By ibra in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th April 2007, 15:21
  4. problem with LCD
    By Rhatidbwoy in forum General
    Replies: 9
    Last Post: - 13th October 2005, 23:01
  5. LCD problem
    By leonel in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 1st August 2005, 18:52

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