Code for double width characters on any HD44780 compatible display, need EEPROM ideas


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default Code for double width characters on any HD44780 compatible display, need EEPROM ideas

    Hello.
    Below is my code which generates very nice looking, double width letters from 0 to 9, on any HD44780 compatible LCD module. Works well on LCD, OLED, VFD. Below I'm attaching the sample pictures.

    Code:
    DECODER 'DECODE DIGITS INTO PROPER SCREEN AREAS
    LEFT=$40:RIGHT=$48 'SELECT ADDRESSES AS CUSTOM DIGITS ARE PLACED FROM LEFT TO RIGHT 0 TO 7 
    '1ST DIGIT
    IF T1=0 THEN
    GOSUB D0
    ENDIF
    IF T1=1 THEN
    GOSUB D1
    ENDIF
    IF T1=2 THEN
    GOSUB D2
    ENDIF
    IF T1=3 THEN
    GOSUB D3
    ENDIF
    IF T1=4 THEN
    GOSUB D4
    ENDIF
    IF T1=5 THEN
    GOSUB D5
    ENDIF
    IF T1=6 THEN
    GOSUB D6
    ENDIF
    IF T1=7 THEN
    GOSUB D7
    ENDIF
    IF T1=8 THEN
    GOSUB D8
    ENDIF
    IF T1=9 THEN
    GOSUB D9
    ENDIF
    
    
    '2nd digit
    LEFT=$50:RIGHT=$58 
    IF T2=0 THEN
    GOSUB D0
    ENDIF
    IF T2=1 THEN
    GOSUB D1
    ENDIF
    IF T2=2 THEN
    GOSUB D2
    ENDIF
    IF T2=3 THEN
    GOSUB D3
    ENDIF
    IF T2=4 THEN
    GOSUB D4
    ENDIF
    IF T2=5 THEN
    GOSUB D5
    ENDIF
    IF T2=6 THEN
    GOSUB D6
    ENDIF
    IF T2=7 THEN
    GOSUB D7
    ENDIF
    IF T2=8 THEN
    GOSUB D8
    ENDIF
    IF T2=9 THEN
    GOSUB D9
    ENDIF
    
    
    LEFT=$60:RIGHT=$68 
    '3rd digit
    IF T3=0 THEN
    GOSUB D0
    ENDIF
    IF T3=1 THEN
    GOSUB D1
    ENDIF
    IF T3=2 THEN
    GOSUB D2
    ENDIF
    IF T3=3 THEN
    GOSUB D3
    ENDIF
    IF T3=4 THEN
    GOSUB D4
    ENDIF
    IF T3=5 THEN
    GOSUB D5
    ENDIF
    IF T3=6 THEN
    GOSUB D6
    ENDIF
    IF T3=7 THEN
    GOSUB D7
    ENDIF
    IF T3=8 THEN
    GOSUB D8
    ENDIF
    IF T3=9 THEN
    GOSUB D9
    ENDIF
    
    
    LEFT=$70:RIGHT=$78 
    '4th digit
    IF T4=0 THEN
    
    
    GOSUB D0
    ENDIF
    IF T4=1 THEN
    GOSUB D1
    ENDIF
    IF T4=2 THEN
    GOSUB D2
    ENDIF
    IF T4=3 THEN
    GOSUB D3
    ENDIF
    IF T4=4 THEN
    GOSUB D4
    ENDIF
    IF T4=5 THEN
    GOSUB D5
    ENDIF
    IF T4=6 THEN
    GOSUB D6
    ENDIF
    IF T4=7 THEN
    GOSUB D7
    ENDIF
    IF T4=8 THEN
    GOSUB D8
    ENDIF
    IF T4=9 THEN
    GOSUB D9
    ENDIF
    
    
    RETURN
    D0: 'decode into proper digit at proper location
    LCDOUT $FE,LEFT,%01111,%11000,%11000,%11000,%11000,%11000,%01111,%0 '0L
    LCDOUT $FE,RIGHT,%11110,%00011,%00011,%00011,%00011,%00011,%11110,%0 '0R
    return 
    D1: 
    LCDOUT $FE,LEFT,%00001,%00011,%00110,%0,%0,%0,%00111'1L
    LCDOUT $FE,RIGHT,%11000,%11000,%11000,%11000,%11000,%11000,%11111,%0	'1R
    return
    D2: 
    LCDOUT $FE,LEFT,%01111,%11000,%00000,%01111,%11000,%11000,%11111,%0	'2L
    LCDOUT $FE,RIGHT,%11110,%00011,%00011,%11110,%00000,%00000,%11111,%0	'2R
    return 
    D3: 
    LCDOUT $FE,LEFT,%01111,%11000,%00000,%00000,%00000,%11000,%01111,%0	'3L
    LCDOUT $FE,RIGHT,%11110,%00011,%00011,%11110,%00011,%00011,%11110,%0	'3R
    return 
    D4:
    LCDOUT $FE,LEFT,%11000,%11000,%11000,%01111,%00000,%00000,%00000,%0	'4L
    LCDOUT $FE,RIGHT,%00011,%00011,%00011,%11111,%00011,%00011,%00011,%0	'4R
    return 
    D5:
    LCDOUT $FE,LEFT,%11111,%11000,%11000,%11111,%00000,%11000,%01111,%0	'5L
    LCDOUT $FE,RIGHT,%11111,%00000,%00000,%11110,%00011,%00011,%11110,%0	'5R
    return
    D6:
    lcdout $FE,LEFT, %01111,%11000,%11000,%11111,%11000,%11000,%01111,%0	'6L
    lcdout $FE,RIGHT, %11110,%00011,%00000,%11110,%00011,%00011,%11110,%0	'6R
    return
    D7:
    lcdout $FE,LEFT, %11111,%11000,%00000,%00000,%00000,%00000,%00000,%0	'7L
    lcdout $FE,RIGHT, %11111,%00011,%00011,%00011,%01110,%11000,%11000,%0'7R
    return
    D8:
    lcdout $FE,LEFT, %01111,%11000,%11000,%01111,%11000,%11000,%01111,%0	'8L
    lcdout $FE,RIGHT, %11110,%00011,%00011,%11110,%00011,%00011,%11110,%0	'8R
    return
    D9:
    lcdout $FE,LEFT, %01111,%11000,%11000,%01111,%00000,%11000,%01111,%0	'9L
    lcdout $FE,RIGHT, %11110,%00011,%00011,%11111,%00011,%00011,%11110,%0	'9R
    return
    To use this code, you need to place this string in your code (change starting position as needed):
    Code:
     lcdout $FE, $1, 0,1,2,3,4,5,6,7
    Then assign to T1-T4 variables appropriate values and call the DECODER subroutine.

    As you can see, this code uses 64 bytes of memory, to hold the visual data for bitmaps of digits 0-9.
    However, I want to add whole ASCII charset + some extras, so that will require 256 bytes of memory (I want to have 128 characters, each needs 2x8 bytes of memory). I can use on-chip eeprom, but they're usually 256 bytes and I need them for some extras, so I plan to use external eeprom chip.

    I want to have fast display update rate (at least 25 fps), so speed is critical. As far as I know, PBP does not support hardware I2C or SPI capabilities of PIC chips directly, you have to use assembly language, which is far above of my capabilities. So in software mode, can average PIC provide 64*25 bytes per second (that's 1.6kb/sec) reading data rate from external EEPROM ?

    Name:  lcds.jpg
Views: 308
Size:  149.9 KB
    Name:  vfds.jpg
Views: 309
Size:  205.3 KB

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Code for double width characters on any HD44780 compatible display, need EEPROM i

    A cold LCD can't update smoothly at 25fps in fact 5fps would be a challenge.

    Can you store the static LCD data in the PIC program flash memory using EXT instead of the eeprom.

    http://dt.picbasic.co.uk/CODEX/TheEXTExternalModifier

  3. #3
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Code for double width characters on any HD44780 compatible display, need EEPROM i

    Average 1602 LCD can do 20 FPS. Black on green (or white) are generally faster than white on blue. About 2-3 times faster. VATN LCD are even faster, but having same price as OLED, I see no point of using them.
    OLED and VFD can do 60-100 FPS.
    All tested with PBP. This is not an issue.




Similar Threads

  1. Writing custom characters to LCD display
    By badrad in forum mel PIC BASIC Pro
    Replies: 59
    Last Post: - 21st April 2012, 23:05
  2. Double eeprom 24LC64
    By chip_select in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th March 2008, 08:51
  3. Led scrolling display: How to mirror characters?
    By mahia2005 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th May 2007, 04:25
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  5. double precision to decimal display
    By RSSHARPE in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd June 2004, 22:31

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