lcdout 8bit problem!!!!


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    44

    Default lcdout 8bit problem!!!!

    Hi all,

    I am using pic 16f628 with pic basic pro compiler ver 2.46.I am tying to display to an lcd screen equivalent to hd44780 the word hello but i can't make it.When i use the same program with 4bit interface everything working fine(DEFINE LCD_BITS 4).but when i choose 8 bit nothing appear to lcd.I don't know also if the connection is correct because i never used before 8bit interface.the 4bit connection is according to manual.
    the code is here
    LCD IS connected as follows:
    ' LCD PIC
    ' DB0 PORTB.0
    ' DB1 PORTB.1
    ' DB2 PORTB.2
    ' DB3 PORTB.3
    ' DB4 PORTB.4
    ' DB5 PORTB.5
    ' DB6 PORTB.6
    ' DB7 PORTB.7
    ' RS PORTA.4 (add 4.7K pullup resistor to 5 volts)
    ' E PORTA.1
    ' RW Ground
    ' Vdd 5 volts
    ' Vss Ground
    ' Vo 20K potentiometer (or ground)
    '
    @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
    DEFINE LCD_DREG PORTB
    DEFINE LCD_RSREG PORTA
    define LCD_DBIT 0
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 8
    CMCON=7
    TRISA=0
    INTCON=0
    TRISB=0
    Pause 1000 ' Wait for LCD to startup
    loop:
    Lcdout $FE,1 ' Clear LCD screen
    pause 500
    lcdout "HELLO" ' Display Hello
    Pause 500 ' Wait .5 second
    end

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by santamaria View Post
    I am using pic 16f628 with pic basic pro compiler ver 2.46.I am tying to display to an lcd screen equivalent to hd44780 the word hello but i can't make it.When i use the same program with 4bit interface everything working fine(DEFINE LCD_BITS 4).but when i choose 8 bit nothing appear to lcd.I don't know also if the connection is correct because i never used before 8bit interface.the 4bit connection is according to manual.
    Which LCD module are you using? There are a few modules out there that only operate in the 4 bit mode, but still have what looks like an 8 bit connector.

    Don't need 'DEFINE LCD_DBIT 0' when using 8 bit mode, don't know if it makes a difference or not.

    Try increasing 'commandus' (word value) and 'dataus' (byte value) and see what happens. Generally, 'commandus' has always worked for me at a max value of 2500, and 'dataus' had to be set to a max value of 100 for one setup.

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


    Did you find this post helpful? Yes | No

    Default

    Assuming the default config fuses in the 16f628.inc could be commented, I would bet on...
    Code:
    @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT, LVP_OFF, PWRT_ON
    Now there's still the pull-up on MCLR and on RA.4 which have to be there, but you said it worked in 4-bit mode, so...
    Last edited by mister_e; - 30th May 2007 at 00:28.
    Steve

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

  4. #4
    Join Date
    Feb 2005
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Thanks all for your replies,
    I did't know that few modules operate in 4bit only. i have 2 different modules
    first is GMD1602E and second is PC2002B. I ckeck in datasheet that you configure the module if you wan't to work in 8bit.This is made by compiler? or i have to do it manual?

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


    Did you find this post helpful? Yes | No

    Default

    GDM1602E use KS00066U (or equiv) controller, and has the same standard i/o assignment, i have some 2X40 LCD here that use this controller, and there's no issue in 4 bit using LCDOUT. I don't know in 8 bit... but to me 8 bit mode is just an i/o wasting solution.

    PowerTip PC 2002-b use a S6A0069X controller, i would guess it's a standard HD44780, the i/o assignment seems to be the same as well.

    So playing with the Start-up delay, COMMANDUS and DATAUS delay could do the trick.
    Steve

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

  6. #6
    Join Date
    Feb 2005
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    thanks mister_e for your reply.i will try it......

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 07:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

Members who have read this thread : 1

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