LCD defines?


Closed Thread
Results 1 to 19 of 19

Thread: LCD defines?

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try this;
    Code:
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
    @ __CONFIG _CONFIG4L, _LVP_OFF_4L
    
    Define OSC 20 ' change to osc freq you use if different
    Define LCD_BITS 4   ' 4-bit interface
    Define LCD_LINES 2 ' 2 line LCD
    
    ' LCD should be connected as follows:
    ' LCD PIC
    ' DB4 PortA.0
    ' DB5 PortA.1
    ' DB6 PortA.2
    ' DB7 PortA.3
    Define  LCD_DREG  PORTA
    Define  LCD_DBIT  0
    
    ' RS PortA.4 (add 4.7K pullup resistor to 5 volts)
    Define  LCD_RSREG  PORTA
    Define  LCD_RSBIT  4
    
    ' E PortB.3
    Define  LCD_EREG  PORTB
    Define  LCD_EBIT  3
    
    ' RW Ground
    ' Vdd 5 volts
    ' Vss Ground
    ' Vo 20K potentiometer (wire wiper to Vo, adjust for contrast)
    ' DB0-3 No connect
    
    Define LCD_COMMANDUS  2000 ' Adjust for slower LCD modules
    Define LCD_DATAUS 50
    
    ADCON1 = 7 ' portA digital
    
    Pause 500 ' Wait for LCD to startup
    loop: 
        Lcdout $fe, 1 ' Clear LCD screen
        Lcdout "Hello" ' Display Hello
        Pause 500 ' Wait .5 second
    
        Lcdout $fe, 1 ' Clear LCD screen
        Lcdout "World"
        Pause 500 ' Wait .5 second
    
        Goto loop ' Do it forever
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    I tried that code and I still only see the black boxes on the second row. Im going to check all of the connections and try a potentiometor on Vo

    Edit:

    The connections are all good and my contrast is fine without a potentiometor. I think my LCD might be dead, but Im not sure because the backlight works and I can see the boxes it displays.
    Last edited by RUBiksCUbe; - 14th July 2005 at 01:55.

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


    Did you find this post helpful? Yes | No

    Default

    out of curiosity...
    what kind of programmer do you use?
    Are you sure your programmer software program the fuses to the PIC?

    And... of course, is a simple LED blink work on all the pin you use???
    Steve

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

  4. #4
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    Im using a JDM programmer (the one called "Serial Port Programmer - Socketed" at http://www.sparkfun.com/shop/index.p...=323317&cat=3&) and IC-Prog as my downloading program. I just tested the IO lines and they all work.

    I have also tried the program on another PIC18F252 and I get the same results.

    EDIT:

    The LCDOut command is for 44780 controllers right??
    Last edited by RUBiksCUbe; - 14th July 2005 at 04:50.

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    RUBiksCUbe, If I may ask, What type of LCD display is it? Who makes it? Part number?

    Dave Purola,
    N8NTA

  6. #6
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    I Noticed that your comment was the black squares were on the second line... I also noticed the examples presented looked like they were all for the first line of your LCD.

    1. Since you only have 1 line of squares on your LCD, then I would suspect your line 1 is bad... test another LCD.

    2. If you want, try writing to your second line on your LCD...

    I believe the command is a $C0?

    Somthing like :
    LCDOUT $FE,$C0,“Hello”

    If this works on your second line... then you may have found your problem.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  7. #7
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    The LCD is a 16 character by 2 line display. Although it says "UNIQ/eVision" on the back, it has the part number GC-1602I1 Ver: C, which is a part number for Solomon Goldentek display company. They don't have the exact datasheet on their website, but the closest one they have is here: http://www.goldentek.com/english/pdf...B0SBL1B%20.pdf

    I was told when I bought it (on ebay) that the display driver is 44780 compatible.

  8. #8
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    I put the LCDOUT $FE,$C0,“Hello” into the program but it did not work either. This LCD must be busted.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Configuring Defines For 8-bit LCD
    By lerameur in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 1st November 2006, 09:59

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