Writing custom characters to LCD display


Closed Thread
Results 1 to 40 of 60

Hybrid View

  1. #1
    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

  2. #2
    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...

  3. #3
    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?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amindzo View Post
    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?
    The 8 locations are memory locations in the LCD.

    Take a look at post #32
    Copy that code.
    Dave
    Always wear safety glasses while programming.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amindzo View Post
    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?
    If you had studied post #2 (and the rest of the posts), you'd notice that you can only program the first 8 locations in the LCD's ram.
    You may be setting up the first few custom characters in the LCD ram, but you surely aren't trying to display them...

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


    Did you find this post helpful? Yes | No

    Default

    These answers are so easy.

    Why do they always turn into personal attacks.

    If they don't get it. Explain it again.
    Maybe your version will make more sense.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    These answers are so easy.

    Why do they always turn into personal attacks.

    If they don't get it. Explain it again.
    Maybe your version will make more sense.
    <br>
    No personal attack intended. I thought post #32 explained it...

    There are 8 memory locations on most LCDs, starting at $40 and ending at $78. Each custom character will be at one of these locations.
    character 0 = $40
    character 1= $48
    character 2 = $50
    character 3= $58
    character 4 = $60
    character 5= $68
    character 6 = $70
    character 7= $78

    In your code
    Code:
    lcdout $fe,$40,$08,$04,$02,$01,$01,$02,$04,$08
    writes your character to "0" position. or character 0

    To display that character on the first line, first space
    Code:
    LCDOUT $FE,1,0
    second space
    Code:
    LCDOUT $FE,$81,0
    If you have a character in the second memory location
    lcdout $fe,$48,$08,$04,$02,$01,$01,$02,$04,$08


    To display that character on the first line, first space
    Code:
    LCDOUT $FE,1,1
    second space
    Code:
    LCDOUT $FE,$81,1
    Last edited by mackrackit; - 5th October 2008 at 13:00.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Sorry Dave, wasn't refering to you.

    But your new explanation might help someone.
    <br>
    DT

  9. #9
    Join Date
    Oct 2009
    Location
    MEXICO
    Posts
    2


    Did you find this post helpful? Yes | No

    Unhappy Trying to make an example !!!

    HI DEAR ELECTRONIC HOBBYST:

    I'M FROM MEXICO AND I REALLY WANT TO LEARN ABOUT THIS TOPIC HOW TO CREATE MY OWN CHARACTER, BUT I DON'T REALLY KNOW HWAT HAPPENED I HAVE TROUBLES ON THE SIMULATION WITH PROTEUS ALL OF YOUR EXAMPLES AND ONLY ONE WORKS THE EXAMPLE THAT IS POSTED ON THE NUMBER 8, BATT LEVEL BUT ALL OF THE OTHER ONES DOESN'T WORKS I HAVE TRIED IN MANY WAYS, I USE PIC BASIC PRO TRYING TO CHARGE MY OWN PROGRAM ON A PIC16F877A CHEK IT OUT !

    COULD SOMEBODY TELL ME WHAT'S GOING WRONG ??

    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTD
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTD
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 140

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 4
    DEFINE ADC_SAMPLEUS 50

    ADCON1=%00001110
    TRISA=%111111
    TRISB=%00000000
    TRISC=%00000000
    TRISD=%00000000
    TRISE=%000
    PORTA=0
    PORTB=0
    PORTC=0
    PORTD=0
    PORTE=0
    LoopCount VAR BYTE
    Clear

    LCDOut $FE,$60,$00,$0a,$0a,$00,$00,$11,$0e,$00 ; #4 Smiley Face


    Pause 1000

    MAIN

    For LoopCount = 1 TO 80
    LCDOut 4
    Next LoopCount

    GoTo MAIN


    THANKS FOR YOUR ATTENTION AND IF SOMEBODY COULD TELL ME HOW TO PUT IN ON WORKING, THAT COULD BE GREATE !! SEE YOU SOON HAVE A NICE DAY

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


    Did you find this post helpful? Yes | No

    Default

    Maybe try
    Code:
    LCDOUT $FE,1,4
    Dave
    Always wear safety glasses while programming.

  11. #11
    Join Date
    Oct 2009
    Location
    MEXICO
    Posts
    2


    Did you find this post helpful? Yes | No

    Talking Thanks man !!

    HEY DAVE, THANKS A LOT MAN I REALLY APRECIATE THAT HELP BY YOURSELF.
    YEAH, I KNOW I SHOULD WEAR SAFETY GLASSES WHEN I'M PROGRAMMING jajaja WILL NOT BE DE DEVIL IF I KILL MYSELF PROGRAMMING WITHOUT IT !! jaja WELL LET ME TRY ANOTHER EXAMPLES MAN

    THANKS A LOT AGAIN

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