Big characters on HD44780 4x20


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    13

    Question Big characters on HD44780 4x20

    Hi! I'm an Italian user, I need to show BIG CHARACTERS on a 4x20 lcd hd44780 compatible. This project is intended to show temperatures in my car. I like lcd style much more than led 7-segment style. I've written some code:

    Code:
    DEFINE OSC 12
    define LCD_LINES 4
    
    Clr     CON 1
    Comm    Con $FE
    LINE1   con 2
    LINE2   con $c0
    LINE3   con $94
    LINE4   con $d4
    Dx      con $14
    
    Begin:
            Pause 500       
            LCDOUT  $FE,$40,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F  ' Cust Char #0  
            LCDOUT  $FE,$48,$1F,$1F,$1F,$1F,$00,$00,$00,$00  ' Cust Char #1  
            LCDOUT  $FE,$50,$00,$00,$00,$00,$1F,$1F,$1F,$1F  ' Cust Char #2  
            LCDOUT  $FE,$58,$00,$00,$00,$00,$00,$0E,$0E,$0E  ' Cust Char #3  
            LCDOUT  $FE,$60,$00,$00,$00,$00,$00,$1F,$1F,$1F  ' Cust Char #4  
            LCDOUT  $FE,$68,$1F,$1F,$1F,$00,$00,$00,$00,$00  ' Cust Char #5  
            LCDOUT  $FE,$70,$00,$01,$03,$07,$0F,$1F,$1F,$1F  ' Cust Char #6  
            LCDOUT  $FE,$78,$00,$00,$00,$00,$00,$00,$01,$03  ' Cust Char #7  
    Main:
            LCDOUT comm, clr
            lcdout comm, line1, "T", COMM, LINE2, "E", COMM, LINE3, "S", COMM, LINE4, "T"
            PAUSE 1000
            GOSUB NUMERO11
            PAUSE 1000
            GOSUB NUMERO22
            PAUSE 1000
            GOSUB NUMERO33
            PAUSE 2000
            GOTO MAIN
    
    Numero11:
            lcdout comm, line1, comm, dx, comm, dx, $07, $06, $00
            lcdout comm, line2, comm, dx, comm, dx, comm, dx, comm, dx, $00
            lcdout comm, line3, comm, dx, comm, dx, comm, dx, comm, dx, $00
            lcdout comm, line4, comm, dx, comm, dx, comm, dx, comm, dx, $00        
            RETURN
            
    Numero22:
            LCDOUT comm, LINE1, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $01, $01, $01, $00
            LCDOUT COMM, LINE2, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $02, $02, $02, $00
            LCDOUT COMM, LINE3, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $00, $01, $01, $01
            LCDOUT COMM, LINE4, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $00, $02, $02, $02
            RETURN
    Numero33:
            LCDOUT COMM, LINE1, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $01, $01, $01, $00
            LCDOUT COMM, LINE2, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $04, $04, $00
            LCDOUT COMM, LINE3, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $05, $05, $00
            LCDOUT COMM, LINE4, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, comm, dx, $02, $02, $02, $00
            RETURN      
    end
    It's only a test right now. This code is really too long and too unefficient, so I need your help! How can I write this code to be simpler?

    Sorry for my English!

    Thanks, Francesco

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


    Did you find this post helpful? Yes | No

    Default

    Yup there's few different way to improve it, tell us the PIC you're using.
    Steve

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

  3. #3
    Join Date
    Jan 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Yup there's few different way to improve it, tell us the PIC you're using.
    Actually i'm using a 16f84a only for testing. The final pic will be a 16f877a.

    Really thank you!

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


    Did you find this post helpful? Yes | No

    Default

    Will people stopping using 16F84A one day? LOL!

    Anyways, do you mind if i try to do the code for the 16F877A right now as you'll end up using this one anyway?
    Steve

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

  5. #5
    Join Date
    Jan 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Will people stopping using 16F84A one day? LOL!

    Anyways, do you mind if i try to do the code for the 16F877A right now as you'll end up using this one anyway?

    I'm only using it because it's the test pic! I've flashed it at least 500 times!

    This is a little bit smaller code:

    Code:
    DEFINE OSC 12
    define LCD_LINES 4
    
    Clr     CON 1
    Comm    Con $FE
    LINE1   con 2
    LINE2   con $c0
    LINE3   con $94
    LINE4   con $d4
    Dx      con $14
    
    Begin:
            Pause 500       
      LCDOUT  $FE,$40,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F  ' Cust Char #0  
      LCDOUT  $FE,$48,$1F,$1F,$1F,$1F,$00,$00,$00,$00  ' Cust Char #1  
      LCDOUT  $FE,$50,$00,$00,$00,$00,$1F,$1F,$1F,$1F  ' Cust Char #2  
      LCDOUT  $FE,$58,$00,$00,$00,$0E,$1F,$1F,$1F,$0E  ' Cust Char #3  
      LCDOUT  $FE,$60,$00,$00,$00,$00,$00,$1F,$1F,$1F  ' Cust Char #4  
      LCDOUT  $FE,$68,$1F,$1F,$1F,$00,$00,$00,$00,$00  ' Cust Char #5  
      LCDOUT  $FE,$70,$00,$01,$03,$07,$0F,$1F,$1F,$1F  ' Cust Char #6  
      LCDOUT  $FE,$78,$00,$00,$00,$00,$00,$00,$01,$03  ' Cust Char #7    
    Main:
            LCDOUT comm, clr
            lcdout comm, line1, "T", COMM, LINE2, "E", COMM, LINE3, "S", COMM, LINE4, "T"
            PAUSE 1000
            GOSUB NUMERO11
            PAUSE 1000
            GOSUB NUMERO22
            PAUSE 1000
            GOSUB NUMERO33
            pause 1000
            gosub punto3
            pause 1000
            gosub numero44
            PAUSE 3000
            GOTO MAIN
    
    Numero11:
            lcdout comm, $82, $07, $06, $00
            lcdout comm, $C4, $00
            lcdout comm, $98, $00
            lcdout comm, $D8, $00        
            RETURN
            
    Numero22:
            LCDOUT comm, $86, $01, $01, $01, $00
            LCDOUT comm, $C6, $02, $02, $02, $00
            LCDOUT comm, $9A, $00, $01, $01, $01
            LCDOUT comm, $DA, $00, $02, $02, $02
            RETURN
    Numero33:
            LCDOUT comm, $8B, $01, $01, $01, $00
            LCDOUT comm, $CC, $04, $04, $00
            LCDOUT comm, $A0, $05, $05, $00
            LCDOUT comm, $DF, $02, $02, $02, $00
            RETURN 
    Punto3:
            LCDOUT Comm, $E3, $03
            return
    Numero44:
            lcdout comm, $90, $00
            lcdout COMM, $D0, $00, COMM, $D3, $00
            lcdout COmm, $A4, $01, $01, $01, $00
            lcdout comm, $E7, $00
            return      
    end
    But of course it's not what I want!

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


    Did you find this post helpful? Yes | No

    Default

    OK then i'll try with my favourite 16F84A

    OK everybody, the code shrinking competition start RIGHT NOW!
    Steve

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

Similar Threads

  1. Only the first 8 characters.
    By timseven in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd September 2009, 01:43
  2. Big big big memory or tiny SDs!
    By Ron Marcus in forum Off Topic
    Replies: 9
    Last Post: - 25th May 2007, 18:02
  3. Led scrolling display: How to mirror characters?
    By mahia2005 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th May 2007, 03:25
  4. LCD 16 characters inline: only first 8 work
    By Mugel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th October 2006, 22:07
  5. LCD 4x20 HD44780
    By inteco in forum mel PIC BASIC
    Replies: 13
    Last Post: - 27th June 2006, 16:52

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