Displaying Custom Characters on LCD.


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262

    Default Displaying Custom Characters on LCD.

    Darrel and anyone else out there thats messed with custom characters, Ive seen the generator that DT has, and its fine I generated up a couple, but cant seem to get them to display.
    from what I understood your supposed to store them in a CG area in the display ram and then call them when needed. this is what I would like to do but I cant even get them on the screen. here is some sample code, what am I getting wrong.

    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
    LCDOUT $FE, 1 ' Clear LCD
    PAUSE 500 ' Wait 0.5sec for LCD to initialize
    AGAIN:
    LCDOUT $FE, 2
    LCDOUT $FE,$40,$0E,$1F,$11,$11,$11,$1F,$1F,$1F 
    pause 1000
    GOTO AGAIN ' Repeat
    END
    My display is supposed to hold 4 CG's I think. I wrote my own generator up into a exe file so I could run it offline. DT's is good too.
    but I'm unsure cause right now nothing shows up on screen.
    I need a battery symbol so this is the one I designed.
    If I cant store the character in lcd ram, can I store it in a variable or string or something (NOT EEPROM)
    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..."

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Displaying Custom Characters on LCD.

    I am not sure that you doing it correctly. See this.
    http://www.picbasic.co.uk/forum/show...6027#post46027

    Write the character to the LCD after the LCD has been initialized, do this once.
    Then in the body of you code when you want to display the character, call it by address.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Displaying Custom Characters on LCD.

    You are writing the character over and over to ram, but never calling it!

    Try this:

    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
    LCDOUT $FE, 1 ' Clear LCD
    PAUSE 500 ' Wait 0.5sec for LCD to initialize
    LCDOUT $FE,$40,$0E,$1F,$11,$11,$11,$1F,$1F,$1F 
    pause 500
    
    LCDOUT $FE,$80,0 'Write character on screen
    pause 1000
    
    END
    EDIT: Too slow
    Shawn

  4. #4
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: Displaying Custom Characters on LCD.

    Ok thanks both of you, I got it now, I checked that link out and saw darrels code and figured it out.

    Yea haha writing to ram over and over, dont you just love making mistakes. I get such a laugh outta myself sometimes.

    Thank you both.
    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. Graphic LCD
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th February 2013, 02:11
  2. Serout2 on LCD Shows Junk Characters
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 14th January 2013, 15:51
  3. LCD Low Power
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2012, 00:05
  4. Writing custom characters to LCD display
    By badrad in forum mel PIC BASIC Pro
    Replies: 59
    Last Post: - 21st April 2012, 22:05
  5. Replies: 8
    Last Post: - 21st April 2011, 05:03

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