garbled text on LCD


Closed Thread
Results 1 to 5 of 5
  1. #1
    mslaney's Avatar
    mslaney Guest

    Default garbled text on LCD

    Hi there,
    I'm getting garbled text on my Hitachi based LCD attached to a 16F876. Most of the letters are legible but sometimes it skips a letter or misprints multiple letters. I've tried three seperate displays with the same results.

    Here's my code.

    'Chip config

    trisa = %00000000
    trisb = %00000000

    'General Defines
    define LOADER_USED 1
    define OSC 20

    'LCD Defines Pins / port for LCD data I/O
    define LCD_DREG PORTB
    define LCD_DBIT 4
    define LCD_RSREG PORTB
    define LCD_RSBIT 3
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 0
    define LCD_BITS 4
    DEFINE LCD_LINES 4
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50

    START:
    pause 600
    lcdout $fe,1
    lcdout $fe,2
    pause 1000
    porta = %00000001
    lcdout "hello world"
    pause 1000
    porta = %00000000

    goto start
    end

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


    Did you find this post helpful? Yes | No

    Default

    Try remove those

    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50

    else, try to play with LCD_COMMANDUS and LCD_DATAUS value

    Also try to print to LCD in a one task

    LCDOUT $FE,1,"Hello world !"


    Be sure you program your PIC with HS oscillator setting.
    Steve

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

  3. #3
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    RIGHT!
    It looked like a 'baud' problem so then I guess speed and process time would be similar!!
    Thanks again...and again...and again...

  4. #4
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    That worked great.
    It seems like an awful lot of typing the defines though. Could I somehow make an include file that has all of that in it?

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


    Did you find this post helpful? Yes | No

    Default

    Yes you can. But i'll prefer to do some program header and use them after. In my case, i'd do program header for each PIC i use with the configuration fuses and blah blah blah. You can do some with LCD define too and reuse them after. I feel safer to see all the code in front of me. BUT if you still want to do some INCLUDE files, create a new file.bas and then place INCLUDE "lcdstuff.bas" at the top of your code.
    Steve

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

Similar Threads

  1. Replies: 2
    Last Post: - 5th November 2009, 17:07
  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. LCD issue with EasyPIC5
    By manwolf in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th June 2008, 09:17
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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