Displaying and scrolling large amount of text on 8x14 led dot matrix display?


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

    Default Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Hello!

    I'm building a custom stereo spectrum analyzer for home system. It will have 8x14 led dot matrix display. Having such nice display inspired me to use it for showing additional data, such as name of input selected, show volume level while adjusting and so on. The problem is that EPROM space of chip I want to use PIC16F887 is quite limited, so having whole font in memory is not possible.

    My approach is as follows:

    1. Attach an external eeprom chip, where letter graphics and other symbols will be stored
    2. create a lookup table, so we know that say data for "B" starts at address F940 and data for "X" starts say at FFCD.
    3. Alocate a virtual "frame buffer" in chip eeprom, which will be read by separate routine in interrupt, which will update the display.
    4. As needed, transfer data from external eeprom to internal.

    The question is, to have smooth display, I will need to update it at least 30 times per second. Reading internal eeprom so much times will cause it to fail quite fast, I guess? The possible workaround is to use SRAM chip, but maybe I'm making things too complicated and there are simpler ways to solve it? I don't want to use external IC like MAX7219 or similar, I want to do everything purely my MCU powers.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    For 8x14 bits it’s far from unreasonable to store the frame buffer in the pic’s RAM as 14 bytes.
    It may take time to write from EEPROM to the frame buffer in RAM, but at least when it comes time
    to update the display frame, that can be fast so you don’t see the display being drawn.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    a 14x8 font would be nicely accommodated in a pic16's flash pgm memory (its 14 bits wide) if you have the space

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


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    14x8 is the display dimensions. Actual "font" and graphics will be smaller, say 5x8.

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    CouriousOne, the question:" I will need to update it at least 30 times per second. Reading internal eeprom so much times will cause it to fail quite fast, I guess? " NO reading the eeprom from the particular processor will not wear it out BUT, Writing to the same locations of PROGRAM MEMORY more than 1000 or so times will. Also writing to internal EEPROM MEMORY more than 100,000 times will.
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    A 5x8 font with uppercase characters, digits and basic punctuation is 472 bytes,
    but if you only need to use several words and omit characters you don’t need,
    it may fit on the 256 bytes on chip EEPROM, or a combination of on-chip EEPROM and program memory.

    Here is the 5x8 font used by the hitachi LCD controllers (if the forum fits it in the post)
    It’s in a C array, but the data is the same.

    You’ll notice the bottom value is always zero because the character display is actually only 5x7,
    so that’s a decent head start

    Code:
    unsigned char charmap[472]={
    	0b00000, // Space _ 0x20
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000, //
    	0b00100, // Exclamation ! 0x21
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00000,
    	0b00000,
    	0b00100,
    	0b00000, //
    	0b01010, // Inverted Commas " 0x22
    	0b01010,
    	0b01010,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000, //
    	0b01010, // Hash # 0x23
    	0b01010,
    	0b11111,
    	0b01010,
    	0b11111,
    	0b01010,
    	0b01010,
    	0b00000, //
    	0b00100, // Dollar Sign $ 0x24
    	0b01111,
    	0b10100,
    	0b01110,
    	0b00101,
    	0b11110,
    	0b00100,
    	0b00000, //
    	0b11000, // Percent Sign % 0x25
    	0b11001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b10011,
    	0b00011,
    	0b00000, //
    	0b01100, // And Sign & 0x26
    	0b10010,
    	0b10100,
    	0b01000,
    	0b10101,
    	0b10010,
    	0b01101,
    	0b00000, //
    	0b01100, // Inverted Comma ' 0x27
    	0b00100,
    	0b01000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000, //
    	0b00010, // Open Bracket ( 0x28
    	0b00100,
    	0b01000,
    	0b01000,
    	0b01000,
    	0b00100,
    	0b00010,
    	0b00000, //
    	0b01000, // Close Bracket ) 0x29
    	0b00100,
    	0b00010,
    	0b00010,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b00000, //
    	0b00000, // Asterisk * 0x2A
    	0b00100,
    	0b10101,
    	0b01110,
    	0b10101,
    	0b00100,
    	0b00000,
    	0b00000, //
    	0b00000, // Plus Sign + 0x2B
    	0b00100,
    	0b00100,
    	0b11111,
    	0b00100,
    	0b00100,
    	0b00000,
    	0b00000, // Comma , 0x2C
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b01100,
    	0b00100,
    	0b01000,
    	0b00000, //
    	0b00000, // Dash/Minus Sign - 0x2D
    	0b00000,
    	0b00000,
    	0b11111,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000, //
    	0b00000, // Period/Decimal Point . 0x2E
    	0b00000,
    	0b00000,
    	0b00000,
    	0b00000,
    	0b01100,
    	0b01100,
    	0b00000, //
    	0b00000, // Forward Slash / 0x2F
    	0b00001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b10000,
    	0b00000,
    	0b00000, //
    	0b01110, // 0 0x30
    	0b10001,
    	0b10011,
    	0b10101,
    	0b11001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b00100, // 1 0x31
    	0b01100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b01110,
    	0b00000, //
    	0b01110, // 2 0x32
    	0b10001,
    	0b00001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b11111,
    	0b00000, //
    	0b11111, // 3 0x33
    	0b00010,
    	0b00100,
    	0b00010,
    	0b00001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b00010, // 4 0x34
    	0b00110,
    	0b01010,
    	0b10010,
    	0b11111,
    	0b00010,
    	0b00010,
    	0b00000, //
    	0b11111, // 5 0x35
    	0b10000,
    	0b11110,
    	0b00001,
    	0b00001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b00110, // 6 0x36
    	0b01000,
    	0b10000,
    	0b11110,
    	0b10001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b11111, // 7 0x37
    	0b00001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b01000,
    	0b01000,
    	0b00000, //
    	0b01110, // 8 0x38
    	0b10001,
    	0b10001,
    	0b01110,
    	0b10001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b01110, // 9 0x39
    	0b10001,
    	0b10001,
    	0b01111,
    	0b00001,
    	0b00010,
    	0b01100,
    	0b00000, //
    	0b00000, // Colon : 0x3A
    	0b01100,
    	0b01100,
    	0b00000,
    	0b01100,
    	0b01100,
    	0b00000,
    	0b00000, //
    	0b00000, // Semi Colon ; 0x3B
    	0b01100,
    	0b01100,
    	0b00000,
    	0b01100,
    	0b00100,
    	0b01000,
    	0b00000, //
    	0b00010, // Less Than Sign < 0x3C
    	0b00100,
    	0b01000,
    	0b10000,
    	0b01000,
    	0b00100,
    	0b00010,
    	0b00000, //
    	0b00000, // Equals Sign = 0x3D
    	0b00000,
    	0b11111,
    	0b00000,
    	0b11111,
    	0b00000,
    	0b00000,
    	0b00000, //
    	0b01000, // Greater Than Sign > 0x3E
    	0b00100,
    	0b00010,
    	0b00001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b00000, //
    	0b01110, // Question Mark ? 0x3F
    	0b10001,
    	0b00001,
    	0b00010,
    	0b00100,
    	0b00000,
    	0b00100,
    	0b00000, //
    	0b01110, // Ampersand @ 0x40
    	0b10001,
    	0b00001,
    	0b01101,
    	0b10101,
    	0b10101,
    	0b01110,
    	0b00000, //
    	0b01110, // A 0x41
    	0b10001,
    	0b10001,
    	0b10001,
    	0b11111,
    	0b10001,
    	0b10001,
    	0b00000, //
    	0b11110, // B 0x42
    	0b10001,
    	0b10001,
    	0b11111,
    	0b10001,
    	0b10001,
    	0b11110,
    	0b00000, //
    	0b01110, // C 0x43
    	0b10001,
    	0b10000,
    	0b10000,
    	0b10000,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b11100, // D 0x44
    	0b10010,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10010,
    	0b11100,
    	0b00000, //
    	0b11111, // E 0x45
    	0b10000,
    	0b10000,
    	0b11110,
    	0b10000,
    	0b10000,
    	0b11111,
    	0b00000, //
    	0b11111, // F 0x46
    	0b10000,
    	0b10000,
    	0b11110,
    	0b10000,
    	0b10000,
    	0b10000,
    	0b00000, //
    	0b01110, // G 0x47
    	0b10001,
    	0b10000,
    	0b10111,
    	0b10001,
    	0b10001,
    	0b01111,
    	0b00000, //
    	0b10001, // H 0x48
    	0b10001,
    	0b10001,
    	0b11111,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b00000, //
    	0b01110, // I 0x49
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b01110,
    	0b00000, //
    	0b00111, // J 0x4A
    	0b00010,
    	0b00010,
    	0b00010,
    	0b00010,
    	0b10010,
    	0b01100,
    	0b00000, //
    	0b10001, // K 0x4B
    	0b10010,
    	0b10100,
    	0b11000,
    	0b10100,
    	0b10010,
    	0b10001,
    	0b00000, //
    	0b10000, // L 0x4C
    	0b10000,
    	0b10000,
    	0b10000,
    	0b10000,
    	0b10000,
    	0b11111,
    	0b00000, //
    	0b10001, // M 0x4D
    	0b11011,
    	0b10101,
    	0b10101,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b00000, //
    	0b10001, // N 0x4E
    	0b10001,
    	0b11001,
    	0b10101,
    	0b10011,
    	0b10001,
    	0b10001,
    	0b00000, //
    	0b01110, // O 0x4F
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b11110, // P 0x50
    	0b10001,
    	0b10001,
    	0b11110,
    	0b10000,
    	0b10000,
    	0b10000,
    	0b00000, //
    	0b01110, // Q 0x51
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10101,
    	0b10010,
    	0b01101,
    	0b00000, //
    	0b11110, // R 0x52
    	0b10001,
    	0b10001,
    	0b11110,
    	0b10100,
    	0b10010,
    	0b10001,
    	0b00000, //
    	0b01111, // S 0x53
    	0b10000,
    	0b10000,
    	0b01110,
    	0b00001,
    	0b00001,
    	0b11110,
    	0b00000, //
    	0b11111, // T 0x54
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00000, //
    	0b10001, // U 0x55
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b01110,
    	0b00000, //
    	0b10001, // V 0x56
    	0b10001,
    	0b10001,
    	0b10001,
    	0b10001,
    	0b01110,
    	0b00100,
    	0b00000, //
    	0b10001, // W 0x57
    	0b10001,
    	0b10001,
    	0b10101,
    	0b10101,
    	0b10101,
    	0b01010,
    	0b00000, //
    	0b10001, // X 0x58
    	0b10001,
    	0b01010,
    	0b00100,
    	0b01010,
    	0b10001,
    	0b10001,
    	0b00000, //
    	0b10001, // Y 0x59
    	0b10001,
    	0b10001,
    	0b01010,
    	0b00100,
    	0b00100,
    	0b00100,
    	0b00000, //
    	0b11111, // Z 0x5A
    	0b00001,
    	0b00010,
    	0b00100,
    	0b01000,
    	0b10000,
    	0b11111,
    	0b00000,};
    //
    Last edited by Art; - 2nd December 2015 at 05:46.

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    This is a routine I came up with about 8 years or so ago.

    ' ************************************************** ******************
    CHARTABLR: '5 x 7 CHARACTER LOOK-UP TABLE FOR ROWS (LSB=RIGHT) (ROW1 = TOP)
    ' ************************************************** ******************
    IF CHARACTER < 31 OR CHARACTER > 127 THEN CHARACTER = 63 '?
    ' " ","!",""","#","$","%","&","'","(",")","*","+", ",",
    '"-",".","/","0","1","2","3","4","5","6","7","8","9",":",";", "<","=",">","?",
    '"@","A","B","C","D","E","F","G","H","I","J","K"," L","M","N","O","P","Q","R",
    '"S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e",
    '"f","g","h","i","j","k","l","m","n","o","p","q"," r","s","t","u","v","w","x",
    '"y","z","{","|","}","~"]

    ROW1:
    LOOKUP CHARACTER - 32,[$00,$04,$0A,$0A,$04,$18,$0C,$0C,$04,$04,$00,$00,$0 0,_
    $00,$00,$00,$0E,$04,$0E,$1F,$02,$1F,$06,$1F,$0E,$0 E,$00,$00,$02,$00,$08,$0E,_
    $0E,$0E,$1E,$0E,$1C,$1F,$1F,$0E,$11,$0E,$07,$11,$1 0,$11,$11,$0E,$1E,$0E,$1E,_
    $0F,$1F,$11,$11,$11,$11,$11,$1F,$1C,$00,$07,$04,$0 0,$08,$00,$10,$00,$01,$00,_
    $06,$00,$10,$04,$01,$10,$0C,$00,$00,$00,$00,$00,$0 0,$00,$08,$00,$00,$00,$00,_
    $00,$00,$04,$04,$04,$00],ROW_DAT(0)

    ROW2:
    LOOKUP CHARACTER - 32,[$00,$04,$0A,$0A,$0F,$19,$12,$04,$08,$02,$04,$04,$0 0,_
    $00,$00,$01,$11,$0C,$11,$02,$06,$10,$08,$01,$11,$1 1,$0C,$0C,$04,$00,$04,$11,_
    $11,$11,$11,$11,$12,$10,$10,$11,$11,$04,$02,$12,$1 0,$1B,$11,$11,$11,$11,$11,_
    $10,$04,$11,$11,$11,$11,$11,$01,$10,$10,$01,$0A,$0 0,$04,$00,$10,$00,$01,$00,_
    $09,$0F,$10,$00,$00,$10,$04,$00,$00,$00,$00,$00,$0 0,$00,$08,$00,$00,$00,$00,_
    $00,$00,$08,$04,$02,$00],ROW_DAT(1)

    ROW3:
    LOOKUP CHARACTER - 32,[$00,$04,$0A,$1F,$14,$02,$14,$08,$10,$01,$15,$04,$0 0,_
    $00,$00,$02,$13,$04,$01,$04,$0A,$1E,$10,$02,$11,$1 1,$0C,$0C,$08,$1F,$02,$01,_
    $01,$11,$11,$10,$11,$10,$10,$10,$11,$04,$02,$14,$1 0,$15,$19,$11,$11,$11,$11,_
    $10,$04,$11,$11,$11,$0A,$11,$02,$10,$08,$01,$11,$0 0,$02,$0E,$16,$0E,$0D,$0E,_
    $08,$11,$16,$0C,$03,$12,$04,$1A,$16,$0E,$1E,$0D,$1 6,$0E,$1C,$11,$11,$11,$11,_
    $11,$1F,$08,$04,$02,$05],ROW_DAT(2)

    ROW4:
    LOOKUP CHARACTER - 32,[$00,$04,$00,$0A,$0E,$04,$08,$00,$10,$01,$0E,$1F,$0 0,_
    $1F,$00,$04,$15,$04,$02,$02,$12,$01,$1E,$04,$0E,$0 F,$00,$00,$10,$00,$01,$02,_
    $0D,$11,$1E,$10,$11,$1E,$1E,$17,$1F,$04,$02,$18,$1 0,$15,$15,$11,$1E,$11,$1E,_
    $0E,$04,$11,$11,$15,$04,$0A,$04,$10,$04,$01,$00,$0 0,$00,$01,$19,$10,$13,$11,_
    $1C,$11,$19,$04,$01,$14,$04,$15,$19,$11,$11,$13,$1 9,$10,$08,$11,$11,$11,$0A,_
    $11,$02,$10,$04,$01,$0A],ROW_DAT(3)

    ROW5
    LOOKUP CHARACTER - 32,[$00,$00,$00,$1F,$05,$08,$15,$00,$10,$01,$15,$04,$0 C,_
    $00,$00,$08,$19,$04,$04,$01,$1F,$01,$11,$08,$11,$0 1,$0C,$0C,$08,$1F,$02,$04,_
    $15,$1F,$11,$10,$11,$10,$10,$11,$11,$04,$02,$14,$1 0,$11,$13,$11,$10,$15,$14,_
    $01,$04,$11,$11,$15,$0A,$04,$08,$10,$02,$01,$00,$0 0,$00,$0F,$11,$10,$11,$1F,_
    $08,$0F,$11,$04,$01,$18,$04,$15,$11,$11,$1E,$0F,$1 0,$0E,$08,$11,$11,$15,$04,_
    $0F,$04,$08,$04,$02,$00],ROW_DAT(4)

    ROW6
    LOOKUP CHARACTER - 32,[$00,$00,$00,$0A,$1E,$13,$12,$00,$08,$02,$04,$04,$0 4,_
    $00,$0C,$10,$11,$04,$08,$11,$02,$11,$11,$08,$11,$0 1,$0C,$04,$04,$00,$04,$00,_
    $15,$11,$11,$11,$12,$10,$10,$11,$11,$04,$12,$12,$1 0,$11,$11,$11,$10,$12,$12,_
    $01,$04,$11,$0A,$15,$11,$04,$10,$10,$01,$01,$00,$0 0,$00,$11,$11,$11,$11,$10,_
    $08,$01,$11,$04,$09,$14,$04,$11,$11,$11,$10,$01,$1 0,$01,$09,$13,$0A,$15,$0A,_
    $01,$08,$08,$04,$02,$00],ROW_DAT(5)

    ROW7:
    LOOKUP CHARACTER - 32,[$00,$04,$00,$0A,$04,$03,$0D,$00,$04,$04,$00,$00,$0 8,_
    $00,$0C,$00,$0E,$0E,$1F,$0E,$02,$0E,$0E,$08,$0E,$0 E,$00,$08,$02,$00,$08,$04,_
    $0E,$11,$1E,$0E,$1C,$1F,$10,$0F,$11,$0E,$0C,$11,$1 F,$11,$11,$0E,$10,$0D,$11,_
    $1E,$04,$0E,$04,$0A,$11,$04,$1F,$1C,$00,$07,$00,$1 F,$00,$0F,$1E,$0E,$0F,$0E,_
    $08,$0E,$11,$0E,$06,$12,$0E,$11,$11,$0E,$10,$01,$1 0,$1E,$06,$0D,$04,$0A,$11,_
    $0E,$1F,$04,$04,$04,$00],ROW_DAT(6)
    RETURN

    Enjoy....
    Dave Purola,
    N8NTA
    EN82fn

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


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Yes I see it contains some kind of "font", but how to "convert" it to a text string?

  9. #9
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Here is how I have done it with an 8x8 led matrix.
    using a 16f690 or 16f1829

    the three pertinant code snippets below are from that program.
    you may want to copy / paste them into microcode studio or, even better, use FineLine IDE which also shows lines on for/next loops and makes it easier to follow the code.

    I can send you the whole program and schematic if it would be helpful.

    works very well.
    There has been over 400 kits built using this code.

    Name:  Size.jpg
Views: 593
Size:  106.2 KB
    Name:  schematic_c.jpeg
Views: 624
Size:  283.7 KB



    Code:
        arraywrite msg,["High Uintah 2015"]
        len=16:GOSUB Message
        
        arraywrite msg,["A Scout is..."]
        len=13:GOSUB Message
        arraywrite msg,["Trustworthy"]
        len=11:GOSUB Message
        arraywrite msg,["Loyal"]
        len=5:GOSUB Message
        arraywrite msg,["Helpful"]
        len=7:GOSUB Message
        arraywrite msg,["Friendly"]
        len=8:GOSUB Message
        arraywrite msg,["Courteous"]
        len=9:GOSUB Message
        arraywrite msg,["Kind"]
        len=4:GOSUB Message
        arraywrite msg,["Obedient"]
        len=8:GOSUB Message
        arraywrite msg,["Cheerful"]
        len=8:GOSUB Message
        arraywrite msg,["Thrifty"]
        len=7:GOSUB Message
        arraywrite msg,["Brave"]
        len=5:GOSUB Message
        arraywrite msg,["Clean"]
        len=5:GOSUB Message
        arraywrite msg,["Reverent"]
        len=8:GOSUB Message
    Code:
    '==========================================================================
    '                         MESSAGE subroutine         
    '==========================================================================
    Message:
    now=0
    
    FOR ltr=0 TO len-1
        char=msg[ltr]
        pos = 0             'reset pos counter for new letter
        GOSUB GetChar       'get first value representing number of columns
        pix=col             'set pix to be number of columns in current character
    
        FOR pos = 1 TO pix  'pos starts at 1 to skip first character data
            GOSUB GetChar   'get actual character data
            x88[now]=col    'store character data in current position of matrix
            GOSUB Display   'display each new character column data
        NEXT pos
        x88[now]=$FF        'follow each character with 2 blank spaces
        GOSUB Display
        x88[now]=$FF
        GOSUB Display
    NEXT ltr
    
    Finish:                 'follow each word with 2 complete blank screens
    FOR ltr = 1 TO 16
        x88[now]=$ff
        GOSUB Display
    NEXT ltr
    
    RETURN
    Code:
    '==========================================================
    '                DISPLAY subroutine
    '==========================================================
    Display:                    'display the current 8x8 matrix "view" times
    IF col=0 THEN               'check to see if should scroll or static
       now=0
       GOTO DntScrl             'skip incrementing now (which causes scrolling)
    ENDIF
    now=now+1                   'increment position counter for scrolling
    IF now=8 THEN now=0         'done with frame so reset postion
    
    DntScrl:
    FOR view = 0 TO speed               'scroll speed, number of time to scan each screen
        IF BtnTmr = 0 THEN GOSUB Btn    'time to check for button press
        BtnTmr=BtnTmr -1                'else decriment BtnTmr for button debounce
    
        FOR r = 0 TO 7         'count for row scanning
    
                    'The following lookup is used to creat a "walking" 1
                    'for Row Scanning.  Row port pins are not contiguous.
                    'The list of numbers is dependant on which PIC pins
                    'are connected to which LED matrix rows.  In this case
                    'pins A.0:A.1:A.2:A.5:B.4:B.5:B.6:B.7
                    '(A.5 and B.5 cause 32 to be used twice.)
    
            LOOKUP r, [1,2,4,32,16,32,64,128], row  'walking "1" for row scanning
            IF r<4 THEN
               PortA=row        'PortA 0,1,2,5 is connected to row 1-4
               ELSE
               PortB=row        'PortB 4,5,6,7 is connected to row 5-8
            ENDIF
    
            i=r + now           'combine row count with position counter(now)
            IF i>7 THEN i=i-8   'to create scrolling effect
            col=x88[i]
    
            IF r=0 THEN         'this is the Car row so combine track with car
               crash=col |/ car ' check for collision using NOR function
               col=col & car    ' show car postion
            ENDIF
    
            IF crash >0 THEN    'crashed
               wface=11         'so set up for crash indicator
               GOTO Crashed     'then goto display crash symbol
            ENDIF
    
            PortC=col           'set the column LED's with current col
            PAUSEUS LOn         'on time for each col (250,500,1000,1500)
            PortA=0 :PortB=0    'all rows off
            PortC=%11111111     'all cols off
        NEXT r
    NEXT view
    RETURN
    Code:
    GetChar:
    
    SELECT CASE char
    
        case" " :LOOKUP pos, [2,$FF,$FF], col
        Case"!" :LOOKUP pos, [1,$05], col
        Case"*" :LOOKUP pos, [9,$FF,$BF,$5F,$BF,$FF,$01,$6F,$6F,$7F], col  'deg F
        Case"+" :LOOKUP pos, [7,$FF,$FF,$EF,$EF,$83,$EF,$EF], col
        Case"-" :LOOKUP pos, [6,$FF,$FF,$EF,$EF,$EF,$EF], col
        Case"." :LOOKUP pos, [2,$F9,$F9], col
    
        Case"0" :LOOKUP pos, [5,$83,$75,$6D,$5D,$83], col
        Case"1" :LOOKUP pos, [3,$BD,$01,$FD], col
        Case"2" :LOOKUP pos, [5,$BD,$79,$75,$6D,$9D], col
        Case"3" :LOOKUP pos, [5,$7B,$7D,$6D,$4D,$33], col
        Case"4" :LOOKUP pos, [5,$E7,$D7,$B7,$01,$F7], col
        Case"5" :LOOKUP pos, [5,$1B,$5D,$5D,$5D,$63], col
        Case"6" :LOOKUP pos, [5,$C3,$AD,$6D,$6D,$F3], col
        Case"7" :LOOKUP pos, [5,$7F,$71,$6F,$5F,$3F], col
        Case"8" :LOOKUP pos, [5,$93,$6D,$6D,$6D,$93], col
        Case"9" :LOOKUP pos, [5,$9F,$6D,$6D,$6B,$87], col
    
        Case"A" :LOOKUP pos, [5,$C1,$B7,$77,$B7,$C1], col
        Case"B" :LOOKUP pos, [5,$7D,$01,$6D,$6D,$93], col
        Case"C" :LOOKUP pos, [5,$83,$7D,$7D,$7D,$BB], col
        Case"D" :LOOKUP pos, [5,$7D,$01,$7D,$7D,$83], col
        Case"E" :LOOKUP pos, [5,$01,$6D,$6D,$6D,$7D], col
        Case"F" :LOOKUP pos, [5,$01,$6F,$6F,$6F,$7F], col
        Case"G" :LOOKUP pos, [5,$83,$7D,$7D,$6D,$61], col
        Case"H" :LOOKUP pos, [5,$01,$EF,$EF,$EF,$01], col
        Case"I" :LOOKUP pos, [3,$7D,$01,$7D], col
        Case"J" :LOOKUP pos, [5,$FB,$FD,$FD,$FD,$03], col
        Case"K" :LOOKUP pos, [5,$01,$EF,$D7,$BB,$7D], col
        Case"L" :LOOKUP pos, [5,$01,$FD,$FD,$FD,$FD], col
        Case"M" :LOOKUP pos, [5,$01,$BF,$CF,$BF,$01], col
        Case"N" :LOOKUP pos, [5,$01,$DF,$EF,$F7,$01], col
        Case"O" :LOOKUP pos, [5,$83,$7D,$7D,$7D,$83], col
        Case"P" :LOOKUP pos, [5,$01,$6F,$6F,$6F,$9F], col
        Case"Q" :LOOKUP pos, [5,$83,$7D,$75,$7B,$85], col
        Case"R" :LOOKUP pos, [5,$01,$6F,$67,$6B,$9D], col
        Case"S" :LOOKUP pos, [5,$9B,$6D,$6D,$6D,$B3], col
        Case"T" :LOOKUP pos, [5,$7F,$7F,$01,$7F,$7F], col
        Case"U" :LOOKUP pos, [5,$03,$FD,$FD,$FD,$03], col
        Case"V" :LOOKUP pos, [5,$1F,$E7,$F9,$E7,$1F], col
        Case"W" :LOOKUP pos, [5,$03,$FD,$E3,$FD,$03], col
        Case"X" :LOOKUP pos, [5,$39,$D7,$EF,$D7,$39], col
        Case"Y" :LOOKUP pos, [5,$3F,$DF,$E1,$DF,$3F], col
        Case"Z" :LOOKUP pos, [5,$79,$75,$6D,$5D,$3D], col
    
        Case"a" :LOOKUP pos, [5,$E3,$DD,$DD,$EB,$C1], col
        Case"b" :LOOKUP pos, [5,$01,$ED,$ED,$ED,$F3], col
        Case"c" :LOOKUP pos, [5,$E3,$DD,$DD,$DD,$ff], col  'last col was $EB
        Case"d" :LOOKUP pos, [5,$E3,$DD,$DD,$DD,$01], col
        Case"e" :LOOKUP pos, [5,$E3,$D5,$D5,$D5,$E5], col
        Case"f" :LOOKUP pos, [5,$EF,$81,$6F,$6F,$BF], col
        Case"g" :LOOKUP pos, [5,$E7,$DA,$DA,$EA,$C0], col
        Case"h" :LOOKUP pos, [5,$01,$DF,$DF,$DF,$E1], col
        Case"i" :LOOKUP pos, [1,$41], col
        Case"j" :LOOKUP pos, [3,$F9,$FE,$41], col
        Case"k" :LOOKUP pos, [4,$01,$F7,$EB,$DD], col
        Case"l" :LOOKUP pos, [3,$03,$FD,$FD], col
        Case"m" :LOOKUP pos, [5,$C1,$DF,$E1,$DF,$E1], col
        Case"n" :LOOKUP pos, [5,$C1,$EF,$DF,$DF,$E1], col
        Case"o" :LOOKUP pos, [5,$E3,$DD,$DD,$DD,$E3], col
        Case"p" :LOOKUP pos, [5,$C0,$EB,$DB,$DB,$E7], col
        Case"q" :LOOKUP pos, [5,$E7,$DB,$DB,$C0,$FE], col
        Case"r" :LOOKUP pos, [5,$C1,$EF,$DF,$DF,$EF], col
        Case"s" :LOOKUP pos, [5,$EF,$D5,$D5,$D5,$FB], col
        Case"t" :LOOKUP pos, [4,$DF,$03,$DD,$FB], col
        Case"u" :LOOKUP pos, [5,$C3,$FD,$FD,$FB,$C1], col
        Case"v" :LOOKUP pos, [5,$C7,$FB,$FD,$FB,$C7], col
        Case"w" :LOOKUP pos, [5,$C3,$FD,$C3,$FD,$C3], col
        Case"x" :LOOKUP pos, [5,$DD,$EB,$F7,$EB,$DD], col
        Case"y" :LOOKUP pos, [4,$C7,$FA,$FA,$C1], col
        Case"z" :LOOKUP pos, [5,$DD,$D9,$D5,$CD,$DD], col
    
        Case":" :LOOKUP pos, [2,$99,$99], col
    
        END SELECT
    RETURN
    Attached Images Attached Images  
    Last edited by Heckler; - 5th December 2015 at 04:25.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Thanks a lot, will take a look later

  11. #11
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Dwight, That looks like a nice little project for our soldering class at our workshop in Northville Michigan. Would you mind if I used it?
    Dave Purola,
    N8NTA
    EN82fn

  12. #12
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Displaying and scrolling large amount of text on 8x14 led dot matrix display?

    Dave... sent you a PM
    dwight
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

Similar Threads

  1. Sure Electronics 0832 Dot Matrix Display
    By wellyboot in forum Code Examples
    Replies: 10
    Last Post: - 2nd January 2013, 19:50
  2. Sure Electronics Dot Matrix Display
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2010, 13:30
  3. SureElectronics LED Dot Matrix Display
    By DanPBP in forum Off Topic
    Replies: 4
    Last Post: - 4th October 2009, 20:10
  4. 5x7 LED Matrix Scrolling Display
    By roycarlson in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 4th August 2008, 23:50
  5. Scrolling text on display
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th August 2005, 15:13

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