Writing custom characters to LCD display


Closed Thread
Results 1 to 40 of 60

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by earltyso View Post
    ... I would like to now place my custom characters on the line of my choice for my 4x20. As far as I know my Truly 4x20 lcd has 4 rows and 8 colums for custom characters.
    The LCD only has 8 locations for custom characters, and those locations don't relate to any specific rows or columns.

    Once you've sent a custom character to the LCD, it can be used any number of times, anywhere on the screen.

    For instance, this line creates the Smiley Face in the LCD's CGRAM at location 4 ($60).

    Code:
    LCDOUT $FE,$60,$00,$0a,$0a,$00,$00,$11,$0e,$00  ; #4 Smiley Face
    and this will fill your display with smiley faces.
    Code:
    LoopCount  VAR BYTE
    
    FOR LoopCount = 1 to 80
        LCDOUT 4
    NEXT LoopCount
    Or this will do the same thing as the FOR/NEXT loop

    LCDOUT REP 4\80

    <hr>

    ... 128, 192,148, or 212 to choose the start position?????
    If you always wanted to start in the first column of each row, those would work.
    You can also add an "offset" to those numbers to specify the column.

    Code:
    Row1  CON 128
    Row2  CON 192
    Row3  CON 148
    Row4  CON 212
    
    LCDOUT $FE,$60,$00,$0a,$0a,$00,$00,$11,$0e,$00  ; #4 Smiley Face
    
    LCDOUT  $FE,Row3+10, 4  ; Put a smiley in the middle of Row 3
    HTH,
    DT

  2. #2
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96


    Did you find this post helpful? Yes | No

    Smile thanks!!!

    Darren,
    Thanks, I got it now. Keep up the good work!
    Padawan-78

  3. #3
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96


    Did you find this post helpful? Yes | No

    Talking my small contribution

    Hey everyone,
    I thought I would try contribute instead of just take from this great forum.
    Here are 2 symbols I came up with for the Holidays using Darren's Character generator.
    Both require 4x20 LCD of space.
    I also figured out that you can redefine 8 custom characters as many times as you want...in loops only. You just have to be careful about how you go back and forth between the loops.
    enjoy

    halloween:
    LCDOUT 254,64,8,17,3,7,15,15,29,29 ' Cust Char #0 PUMPKIN
    LCDOUT 254,72,12,31,31,14,31,31,27,27 ' Cust Char #1
    LCDOUT 254,80,2,17,24,28,30,30,23,23 ' Cust Char #2
    LCDOUT 254,88,29,30,14,7,7,19,8,0 ' Cust Char #3
    LCDOUT 254,96,31,21,21,0,10,31,31,0 ' Cust Char #4
    LCDOUT 254,104,23,15,14,28,28,25,2,0 ' Cust Char #5
    LCDOUT 254,112,8,16,10,6,1,1,6,8 ' Cust Char #6 PUMPKIN VINE

    lcdout 254, 1
    lcdout $FE,Row1+3, 6
    LCDOUT $FE,Row2+2, 0
    LCDOUT $FE,Row2+3, 1
    LCDOUT $FE,Row2+4, 2," Happy "
    LCDOUT $FE,Row3+2, 3
    LCDOUT $FE,Row3+3, 4
    LCDOUT $FE,Row3+4, 5," Halloween "
    pause 5000
    goto halloween

    christmas:
    LCDOUT 254,64,4,8,7,31,3,8,4,0 ' Cust Char #0 Christmas Star
    LCDOUT 254,72,14,27,17,0,17,27,14,14 ' Cust Char #1
    LCDOUT 254,80,4,2,28,31,24,2,4,0 ' Cust Char #2
    LCDOUT 254,88,4,4,4,21,21,4,14,14 ' Cust Char #3
    LCDOUT 254,96,14,14,14,4,4,4,21,21 ' Cust Char #4
    LCDOUT 254,104,21,4,4,4,4,4,0,0 ' Cust Char #5
    lcdout 254, 1
    lcdout $FE,Row1+3, 3
    LCDOUT $FE,Row2+2, 0
    LCDOUT $FE,Row2+3, 1
    LCDOUT $FE,Row2+4, 2," MERRY "
    LCDOUT $FE,Row3+3, 4," CHRISTMAS"
    LCDOUT $FE,Row4+3, 5
    pause 5000
    goto christmas
    Padawan-78

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


    Did you find this post helpful? Yes | No

    Default

    nice job earltyso!
    Steve

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

  5. #5
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Hi, i have written this program to make custom character on 2*16 LCD but LCD shows nothing.i use picbasic pro and PIC16F877A. what's the problem?

    define OSC 4
    ' Set LCD Data port
    DEFINE LCD_DREG PORTC
    ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_DBIT 4
    ' Set LCD Register Select port
    DEFINE LCD_RSREG PORTC
    ' Set LCD Register Select bit
    DEFINE LCD_RSBIT 1
    ' Set LCD Enable port
    DEFINE LCD_EREG PORTC
    ' Set LCD Enable bit
    DEFINE LCD_EBIT 0
    ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_BITS 4
    ' Set number of lines on LCD
    DEFINE LCD_LINES 2
    'Making lcd ready
    pause 100
    lcdout $fe,1

    m var byte
    n var byte
    m=25
    n=98


    lcdout $fe,$40,$08,$04,$02,$01,$01,$02,$04,$08
    lcdout $fe,$14
    lcdout $fe,$00,$00,$07,$07,$1F,$00,$00,$00
    lcdout $fe,$14
    lcdout $fe,$04,$04,$04,$04,$07,$00,$00,$00
    lcdout $fe,$14
    lcdout ":",#m,".",#n
    end

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amindzo View Post
    Hi, i have written this program to make custom character on 2*16 LCD but LCD shows nothing.i use picbasic pro and PIC16F877A. what's the problem?
    If you study post #2 of this thread, you'll find your problem...

  7. #7
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    i have studied that post but i still have problem. post 2 just specify the 8 location but LCD is 2*16.what about other locations?

Similar Threads

  1. LCD Display
    By lambert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th January 2010, 22:18
  2. assembly in Pic
    By lerameur in forum Off Topic
    Replies: 11
    Last Post: - 1st May 2008, 20:06
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 07:35

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