Please help, any ideas to improve Scrolling Text MAX7219
+ Reply to Thread
Results 1 to 5 of 5
  1. #1

    Question Please help, any ideas to improve Scrolling Text MAX7219

    Hi, I just a few weeks ago try to figure out who to work with MAX7219 and the following example is a little program that I need to improve for scrolling messages, this example scroll JESUS in led Matrix 7x5, if you have any suggestions will be welcome at all

    @ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_OFF & _PWRTE_ON
    include "modedefs.bas"
    ANSEL=0: ANSELH=0: TRISB=0
    '-----VARIABLES-----
    ADDRESS var word 'variable address for display
    DATAREG var word 'variable data register for display
    Y VAR BYTE 'contador para cargar address y datareg
    X var BYTE
    DES VAR BYTE


    '----- symbolos ------
    SYMBOL CLK = PORTB.4
    SYMBOL DAT = PORTB.5
    SYMBOL LOAD = PORTB.6

    '-----PIN SETUPS-----
    low dat 'data pin for MAX7219 (1)
    low clk 'clock pin for MAX7219 (13)
    low load 'load pin for MAX7219 (12)




    '-----MAX7219 SETUP-----
    ADDRESS = $0C : DATAREG = $01 : gosub MaxWrite ' NO SHUT, NORMAL OPERATION
    ADDRESS = $09 : DATAREG = $00 : gosub MaxWrite ' COMBINACION BINARIA, NO DECODE
    ADDRESS = $0A : DATAREG = $09 : gosub MaxWrite ' INTENSIDAD DE LEDS 1(MIN) A F(MAX)
    ADDRESS = $0B : DATAREG = $06 : gosub MaxWrite ' SCAN LIMIT NUMERO DE DIGITOS
    ADDRESS = $0F : DATAREG = $00 : gosub MaxWrite
    GOSUB LIMPIAR


    INICIO:
    DES = 0
    FOR X = 1 TO 4
    FOR Y = 0 TO 6
    LOOKUP Y,[56,016,016,016,016,144,096],DATAREG ' LETTER "J"
    ADDRESS = Y+1 : DATAREG = DATAREG << DES
    GOSUB MAXWRITE
    PAUSE 10
    NEXT Y
    PAUSE 300
    DES = DES + 1
    NEXT X ' FINISH TO SCROLL


    des = 0
    for x = 1 to 4
    for y = 0 to 6
    lookup y,[248,128,128,240,128,128,248],datareg ' LETTER "E"
    address = y+1 : datareg = datareg << des
    gosub maxwrite
    pause 10
    next y
    pause 300
    des = des + 1
    next x ' FINISH TO SCROLL SECOND


    des = 0
    for x = 1 to 4
    for y = 0 to 6
    lookup y,[120,128,128,112,008,008,240],datareg ' LETTER "S"
    address = y+1 : datareg = datareg << des
    gosub maxwrite
    pause 10
    next y
    pause 300
    des = des + 1
    next x




    des = 0
    for x = 1 to 4
    for y = 0 to 6
    lookup y,[136,136,136,136,136,136,112],datareg ' LETTER "U"
    address = y+1 : datareg = datareg << des
    gosub maxwrite
    pause 10
    next y
    pause 300
    des = des + 1
    next x


    des = 0
    for x = 1 to 4
    for y = 0 to 6
    lookup y,[120,128,128,112,008,008,240],datareg ' LETTER "S"
    address = y+1 : datareg = datareg << des
    gosub maxwrite
    pause 10
    next y
    pause 300
    des = des + 1
    next x


    GOSUB LIMPIAR
    GOTO INICIO

    MaxWrite:
    shiftout DAT,CLK,MSBFIRST,[ADDRESS,DATAREG] 'Shift out the data to the 'MAX7219 'first the address, then data.
    pulsout LOAD,1 'load the data into the MAX7219
    return


    LIMPIAR:
    for Y = 1 to 7 'write $0F (blank) to all digits
    ADDRESS = Y : DATAREG = $00 : gosub MaxWrite
    next Y
    return

  2. #2
    Join Date
    Oct 2013
    Posts
    41

    Default Re: Please help, any ideas to improve Scrolling Text MAX7219

    Hi,
    I buy three 8x8 modules from E-bay with MAX7219 chip.
    I try this example code on one 8x8 module and it works perfect.
    Is it possible to use this code for scroll whole word "JESUS" on all three 8x8 modules and what modification are needed to make this possible
    Best regards

  3. #3

    Default Re: Please help, any ideas to improve Scrolling Text MAX7219

    Hi, actually i was my idea on how programming to get the result, but i tested some changes with no success

  4. #4
    Join Date
    Apr 2011
    Posts
    5

    Default Re: Please help, any ideas to improve Scrolling Text MAX7219

    Hi ! Try this one. This is not my code,but made some modifications on my own.


    Code:
    Device 16F876A
    Declare Bootloader = On 
    xtal 20
    ;Config  WDT_OFF, PWRTE_ON,lvp_off,hs_osc,cp_off,boden_off,
    config HS_OSC , WDT_OFF , PWRTE_ON , BODEN_OFF , LVP_OFF , CP_OFF , CPD_OFF , DEBUG_OFF
    PortB_Pullups=0
     Declare Adin_Res 10       ' 10-bit result required 
     Declare Adin_Tad 3      '  
     Declare Adin_Stime 100     ' Allow 50us sample time
    TRISB = %00000000 ' Set bit 2-7 to outputs, bit 0 input	
    TRISA = %00000001   ;
    TRISC = %00000000     
    ;7 6 5 4 3 2 1 0
    ;D D D D D D D A
    ADCON1 = %10001110   ' Set PORTA.0/1/3 analog...
    ADCON0 = %11000001    ;right justified
    Symbol CLK  = PORTC.1
    Symbol LOAD = PORTC.2 
    Symbol DAT  = PORTC.3
    '-----VARIABLES-----  
    dim Display[32]  as byte     ;is row databyte 
    Display[0]=%10101010 
    Display[1]=%01010101 
    Display[2]=%10101010 
    Display[3]=%01010101 
    Display[4]=%10101010 
    Display[5]=%01010101 
    Display[6]=%10101010 
    Display[7]=%01010101 
    '-----VARIABLES----- 
    DIM ADDRESS  AS byte 'variable address for display 
    DIM DATAREG  AS word
    DIM DATAREG3 AS word 'variable data register for display 
    DIM DATAREG1 AS word
    DIM DATAREG2 AS word
    DIM DATAREG4 AS word
    dim Y as BYTE  
    dim X as BYTE 
    DIM i AS byte
    dim Z as byte
    dim FC[6]   as byte
    dim CharLine as byte
    dim Char     as byte
    dim SpeedScrolling  as byte
    dim scrbyte as byte
    '----- symbolos ------ 
    
    '-----PIN SETUPS----- 
    low DAT 'data pin for MAX7219 (1) 
    low CLK 'clock pin for MAX7219 (13) 
    low LOAD 'load pin for MAX7219 (12) 
    
    '-----MAX7219 SETUP----- 
    
    
    for i = 0 to 4 
    select case i
    case 0
    ADDRESS = $09                        ;Decode Mode Register:
    DATAREG = $0                         ;Code 0 for digits  no decode 
    case 1
    ADDRESS = $0A                        ;Intensity Register
    DATAREG = $04                        ;Intensity 0-4
    case 2
    ADDRESS = $0B                        ;Scan-Limit Register:
    DATAREG = $07                        ;Digit 0,1,2,3,4,5,6,7 ($00-$07)
    case 3
    ADDRESS = $0C                        ;Shutdown Register:
    DATAREG = $01                        ;Normal Operation
    case 4
    ADDRESS = $0F                        ;Display-Test Register:
    DATAREG = $00                        ;Normal Operation
    endselect
    LOAD = 0
    SHOut DAT, CLK, msbfirst, [ADDRESS, DATAREG,ADDRESS, DATAREG,ADDRESS, DATAREG,ADDRESS, DATAREG]
    LOAD = 1
    next
    
    
    Main: 
    for scrbyte = 0 to 10
    Char = lookupl scrbyte,["125485893  "]
    SpeedScrolling=150 
    GOSUB SendChar 
    next
    
    DELAYMS 300
    for scrbyte = 0 to 12
    Char = lookupl scrbyte,["MAX 3. 8X8 ! "]
    SpeedScrolling=150 
    GOSUB SendChar
    next
    goto Main 
    
    SendChar: 
    SELECT CASE Char 
    Case 32 
    FC[0]=$00:FC[1]=$00:FC[2]=$00:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // sp 
    Case 33 
    FC[0]=$00:FC[1]=$00:FC[2]=$2f:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // ! 
    Case 34  
    FC[0]=$00:FC[1]=$07:FC[2]=$00:FC[3]=$07:FC[4]=$00:FC[5]=$00 ' // " (shown as \ in Lookdown table) 
    Case 35 
    FC[0]=$14:FC[1]=$7f:FC[2]=$14:FC[3]=$7f:FC[4]=$14:FC[5]=$00 ' // # 
    Case 36 
    FC[0]=$24:FC[1]=$2a:FC[2]=$7f:FC[3]=$2a:FC[4]=$12:FC[5]=$00 ' // $ 
    Case 37 
    FC[0]=$c4:FC[1]=$c8:FC[2]=$10:FC[3]=$26:FC[4]=$46:FC[5]=$00 ' // % 
    Case 38 
    FC[0]=$36:FC[1]=$49:FC[2]=$55:FC[3]=$22:FC[4]=$50:FC[5]=$00 ' // & 
    Case 39 
    FC[0]=$00:FC[1]=$05:FC[2]=$03:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // ' 
    Case 40 
    FC[0]=$00:FC[1]=$1c:FC[2]=$22:FC[3]=$41:FC[4]=$00:FC[5]=$00 ' // ( 
    Case 41 
    FC[0]=$00:FC[1]=$41:FC[2]=$22:FC[3]=$1c:FC[4]=$00:FC[5]=$00 ' // ) 
    Case 42 
    FC[0]=$14:FC[1]=$08:FC[2]=$3E:FC[3]=$08:FC[4]=$14:FC[5]=$00 ' // * 
    Case 43 
    FC[0]=$08:FC[1]=$08:FC[2]=$3E:FC[3]=$08:FC[4]=$08:FC[5]=$00 ' // + 
    Case 44 
    FC[0]=$00:FC[1]=$00:FC[2]=$50:FC[3]=$30:FC[4]=$00:FC[5]=$00 ' // , 
    Case 45 
    FC[0]=$10:FC[1]=$10:FC[2]=$10:FC[3]=$10:FC[4]=$10:FC[5]=$00 ' // - 
    Case 46 
    FC[0]=$00:FC[1]=$60:FC[2]=$60:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // . 
    Case 47 
    FC[0]=$20:FC[1]=$10:FC[2]=$08:FC[3]=$04:FC[4]=$02:FC[5]=$00 ' // / 
    Case 48 
    FC[0]=$3E:FC[1]=$51:FC[2]=$49:FC[3]=$45:FC[4]=$3E:FC[5]=$00 ' // 0 
    Case 49 
    FC[0]=$00:FC[1]=$42:FC[2]=$7F:FC[3]=$40:FC[4]=$00:FC[5]=$00 ' // 1 
    Case 50 
    FC[0]=$42:FC[1]=$61:FC[2]=$51:FC[3]=$49:FC[4]=$46:FC[5]=$00 ' // 2 
    Case 51 
    FC[0]=$21:FC[1]=$41:FC[2]=$45:FC[3]=$4B:FC[4]=$31:FC[5]=$00 ' // 3 
    Case 52 
    FC[0]=$18:FC[1]=$14:FC[2]=$12:FC[3]=$7F:FC[4]=$10:FC[5]=$00 ' // 4 
    Case 53 
    FC[0]=$27:FC[1]=$45:FC[2]=$45:FC[3]=$45:FC[4]=$39:FC[5]=$00 ' // 5 
    Case 54 
    FC[0]=$3C:FC[1]=$4A:FC[2]=$49:FC[3]=$49:FC[4]=$30:FC[5]=$00 ' // 6 
    Case 55 
    FC[0]=$01:FC[1]=$71:FC[2]=$09:FC[3]=$05:FC[4]=$03:FC[5]=$00 ' // 7 
    Case 56 
    FC[0]=$36:FC[1]=$49:FC[2]=$49:FC[3]=$49:FC[4]=$36:FC[5]=$00 ' // 8 
    Case 57 
    FC[0]=$06:FC[1]=$49:FC[2]=$49:FC[3]=$29:FC[4]=$1E:FC[5]=$00 ' // 9 
    Case 58 
    FC[0]=$00:FC[1]=$36:FC[2]=$36:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // : 
    Case 59 
    FC[0]=$00:FC[1]=$56:FC[2]=$36:FC[3]=$00:FC[4]=$00:FC[5]=$00 ' // ";" 
    Case 60 
    FC[0]=$08:FC[1]=$14:FC[2]=$22:FC[3]=$41:FC[4]=$00:FC[5]=$0 ' // < 
    Case 61 
    FC[0]=$14:FC[1]=$14:FC[2]=$14:FC[3]=$14:FC[4]=$14:FC[5]=$0 ' // = 
    Case 62 
    FC[0]=$00:FC[1]=$41:FC[2]=$22:FC[3]=$14:FC[4]=$08:FC[5]=$0 ' // > 
    Case 63 
    FC[0]=$02:FC[1]=$01:FC[2]=$51:FC[3]=$09:FC[4]=$06:FC[5]=$0 ' // ? 
    Case 64 
    FC[0]=$32:FC[1]=$49:FC[2]=$59:FC[3]=$51:FC[4]=$3E:FC[5]=$0 ' // @ 
    Case 65 
    FC[0]=$7E:FC[1]=$11:FC[2]=$11:FC[3]=$11:FC[4]=$7E:FC[5]=$0 ' // A 
    Case 66 
    FC[0]=$7F:FC[1]=$49:FC[2]=$49:FC[3]=$49:FC[4]=$36:FC[5]=$0 ' // B 
    Case 67 
    FC[0]=$3E:FC[1]=$41:FC[2]=$41:FC[3]=$41:FC[4]=$22:FC[5]=$0 ' // C 
    Case 68 
    FC[0]=$7F:FC[1]=$41:FC[2]=$41:FC[3]=$22:FC[4]=$1C:FC[5]=$0 ' // D 
    Case 69 
    FC[0]=$7F:FC[1]=$49:FC[2]=$49:FC[3]=$49:FC[4]=$41:FC[5]=$0 ' // E 
    Case 70 
    FC[0]=$7F:FC[1]=$09:FC[2]=$09:FC[3]=$09:FC[4]=$01:FC[5]=$0 ' // F 
    Case 71 
    FC[0]=$3E:FC[1]=$41:FC[2]=$49:FC[3]=$49:FC[4]=$7A:FC[5]=$0 ' // G 
    Case 72 
    FC[0]=$7F:FC[1]=$08:FC[2]=$08:FC[3]=$08:FC[4]=$7F:FC[5]=$0 ' // H 
    Case 73 
    FC[0]=$00:FC[1]=$41:FC[2]=$7F:FC[3]=$41:FC[4]=$00:FC[5]=$0 ' // I 
    Case 74 
    FC[0]=$20:FC[1]=$40:FC[2]=$41:FC[3]=$3F:FC[4]=$01:FC[5]=$0 ' // J 
    Case 75 
    FC[0]=$7F:FC[1]=$08:FC[2]=$14:FC[3]=$22:FC[4]=$41:FC[5]=$0 ' // K 
    Case 76 
    FC[0]=$7F:FC[1]=$40:FC[2]=$40:FC[3]=$40:FC[4]=$40:FC[5]=$0 ' // L 
    Case 77 
    FC[0]=$7F:FC[1]=$02:FC[2]=$0C:FC[3]=$02:FC[4]=$7F:FC[5]=$0 ' // M 
    Case 78 
    FC[0]=$7F:FC[1]=$04:FC[2]=$08:FC[3]=$10:FC[4]=$7F:FC[5]=$0 ' // N 
    Case 79 
    FC[0]=$3E:FC[1]=$41:FC[2]=$41:FC[3]=$41:FC[4]=$3E:FC[5]=$0 ' // O 
    Case 80 
    FC[0]=$7F:FC[1]=$09:FC[2]=$09:FC[3]=$09:FC[4]=$06:FC[5]=$0 ' // P 
    Case 81 
    FC[0]=$3E:FC[1]=$41:FC[2]=$51:FC[3]=$21:FC[4]=$5E:FC[5]=$0 ' // Q 
    Case 82 
    FC[0]=$7F:FC[1]=$09:FC[2]=$19:FC[3]=$29:FC[4]=$46:FC[5]=$0 ' // R 
    Case 83 
    FC[0]=$46:FC[1]=$49:FC[2]=$49:FC[3]=$49:FC[4]=$31:FC[5]=$0 ' // S 
    Case 84 
    FC[0]=$01:FC[1]=$01:FC[2]=$7F:FC[3]=$01:FC[4]=$01:FC[5]=$0 ' // T 
    Case 85 
    FC[0]=$3F:FC[1]=$40:FC[2]=$40:FC[3]=$40:FC[4]=$3F:FC[5]=$0 ' // U 
    Case 86 
    FC[0]=$1F:FC[1]=$20:FC[2]=$40:FC[3]=$20:FC[4]=$1F:FC[5]=$0 ' // V 
    Case 87 
    FC[0]=$3F:FC[1]=$40:FC[2]=$38:FC[3]=$40:FC[4]=$3F:FC[5]=$0 ' // W 
    Case 88 
    FC[0]=$63:FC[1]=$14:FC[2]=$08:FC[3]=$14:FC[4]=$63:FC[5]=$0 ' // X 
    Case 89 
    FC[0]=$07:FC[1]=$08:FC[2]=$70:FC[3]=$08:FC[4]=$07:FC[5]=$0 ' // Y 
    Case 90 
    FC[0]=$61:FC[1]=$51:FC[2]=$49:FC[3]=$45:FC[4]=$43:FC[5]=$0 ' // Z 
    Case 91 
    FC[0]=$00:FC[1]=$7F:FC[2]=$41:FC[3]=$41:FC[4]=$00:FC[5]=$0 ' // [ 
    Case 92 
    FC[0]=$02:FC[1]=$04:FC[2]=$08:FC[3]=$10:FC[4]=$20:FC[5]=$0 ' // \ (we are using this for Case 34 " above) 
    Case 93 
    FC[0]=$00:FC[1]=$41:FC[2]=$41:FC[3]=$7F:FC[4]=$00:FC[5]=$0 ' // ] 
    Case 94 
    FC[0]=$04:FC[1]=$02:FC[2]=$01:FC[3]=$02:FC[4]=$04:FC[5]=$0 ' // ^ 
    Case 95 
    FC[0]=$40:FC[1]=$40:FC[2]=$40:FC[3]=$40:FC[4]=$40:FC[5]=$0 ' // _ 
    Case 96 
    ' FC(0)=$00:[C(1)=$01:FC]2)=$02:FC(3)=$04:FC(4)=$00 ' // ` 
    FC[0]=$02:FC[1]=$04:FC[2]=$08:FC[3]=$10:FC[4]=$20:FC[5]=$0 ' // \ (shown as ` in Lookdown table) 
    Case 97 
    FC[0]=$20:FC[1]=$54:FC[2]=$54:FC[3]=$54:FC[4]=$78:FC[5]=$0 ' // a 
    Case 98 
    FC[0]=$7F:FC[1]=$48:FC[2]=$44:FC[3]=$44:FC[4]=$38:FC[5]=$0 ' // b 
    Case 99 
    FC[0]=$38:FC[1]=$44:FC[2]=$44:FC[3]=$44:FC[4]=$20:FC[5]=$0 ' // c 
    Case 100 
    FC[0]=$38:FC[1]=$44:FC[2]=$44:FC[3]=$48:FC[4]=$7F:FC[5]=$0 ' // d 
    Case 101 
    FC[0]=$38:FC[1]=$54:FC[2]=$54:FC[3]=$54:FC[4]=$18:FC[5]=$0 ' // e 
    Case 102 
    FC[0]=$08:FC[1]=$7E:FC[2]=$09:FC[3]=$01:FC[4]=$02:FC[5]=$0 ' // f 
    Case 103 
    FC[0]=$0C:FC[1]=$52:FC[2]=$52:FC[3]=$52:FC[4]=$3E:FC[5]=$0 ' // g 
    Case 104 
    FC[0]=$7F:FC[1]=$08:FC[2]=$04:FC[3]=$04:FC[4]=$78:FC[5]=$0 ' // h 
    Case 105 
    FC[0]=$00:FC[1]=$44:FC[2]=$7D:FC[3]=$40:FC[4]=$00:FC[5]=$0 ' // i 
    Case 106 
    FC[0]=$20:FC[1]=$40:FC[2]=$44:FC[3]=$3D:FC[4]=$00:FC[5]=$0 ' // j 
    Case 107 
    FC[0]=$7F:FC[1]=$10:FC[2]=$28:FC[3]=$44:FC[4]=$00:FC[5]=$0 ' // k 
    Case 108 
    FC[0]=$00:FC[1]=$41:FC[2]=$7F:FC[3]=$40:FC[4]=$00:FC[5]=$0 ' // l 
    Case 109 
    FC[0]=$7C:FC[1]=$04:FC[2]=$18:FC[3]=$04:FC[4]=$78:FC[5]=$0 ' // m 
    Case 110 
    FC[0]=$7C:FC[1]=$08:FC[2]=$04:FC[3]=$04:FC[4]=$78:FC[5]=$0 ' // n 
    Case 111 
    FC[0]=$38:FC[1]=$44:FC[2]=$44:FC[3]=$44:FC[4]=$38:FC[5]=$0 ' // o 
    Case 112 
    FC[0]=$7C:FC[1]=$14:FC[2]=$14:FC[3]=$14:FC[4]=$08:FC[5]=$0 ' // p 
    Case 113 
    FC[0]=$08:FC[1]=$14:FC[2]=$14:FC[3]=$18:FC[4]=$7C:FC[5]=$0 ' // q 
    Case 114 
    FC[0]=$7C:FC[1]=$08:FC[2]=$04:FC[3]=$04:FC[4]=$08:FC[5]=$0 ' // r 
    Case 115 
    FC[0]=$48:FC[1]=$54:FC[2]=$54:FC[3]=$54:FC[4]=$20:FC[5]=$0 ' // s 
    Case 116 
    FC[0]=$04:FC[1]=$3F:FC[2]=$44:FC[3]=$40:FC[4]=$20:FC[5]=$0 ' // t 
    Case 117 
    FC[0]=$3C:FC[1]=$40:FC[2]=$40:FC[3]=$20:FC[4]=$7C:FC[5]=$0 ' // u 
    Case 118 
    FC[0]=$1C:FC[1]=$20:FC[2]=$40:FC[3]=$20:FC[4]=$1C:FC[5]=$0 ' // v 
    Case 119 
    FC[0]=$3C:FC[1]=$40:FC[2]=$30:FC[3]=$40:FC[4]=$3C:FC[5]=$0 ' // w 
    Case 120 
    FC[0]=$44:FC[1]=$28:FC[2]=$10:FC[3]=$28:FC[4]=$44:FC[5]=$0 ' // x 
    Case 121 
    FC[0]=$0C:FC[1]=$50:FC[2]=$50:FC[3]=$50:FC[4]=$3C:FC[5]=$0 ' // y 
    Case 122 
    FC[0]=$44:FC[1]=$64:FC[2]=$54:FC[3]=$4C:FC[4]=$44:FC[5]=$0 ' // z 
    case 123
    ' FC(0)=$00:FC(1)=$08:FC(2)=$36:FC(3)=$41:FC(4)=$00' // { 
    FC[0]=$10:FC[1]=$24:FC[2]=$20:FC[3]=$24:FC[4]=$10:FC[5]=$00 ' // Smily face (shown as { in Lookdown table) 
    case 124 
    ' FC(0)=$00:fc[1)=$00:FC(2)=$7F:FC(3)=$00:FC(4)=$00 ' // | 
    FC[0]=$20:FC[1]=$40:FC[2]=$20:FC[3]=$10:FC[4]=$08:FC[5]=$00 ' // Tick (shown as | in Lookdown table) 
    case 125 
    ' FC(0)=$00:FC(1)=$41:FC(2)=$36:FC(3)=$08:FC(4)=$00' // } 
    FC[0]=$20:FC[1]=$14:FC[2]=$10:FC[3]=$14:FC[4]=$20:FC[5]=$00 ' // Frown face (shown as } in Lookdown table) 
    case 126 
    FC[0]=$10:FC[1]=$08:FC[2]=$08:FC[3]=$10:FC[4]=$08:FC[5]=$00' // ~ 
    end SELECT 
    
    
    SEND_DATA:
    
    For CharLine=0 To 5 
    GoSub Display_inc 
    Display[i-1]=FC[CharLine] 
    GoSub Update_data 
    DelayMS SpeedScrolling  
    Next ;CharLine 
    Return 
    
    Display_inc: 
    For i=0 To 31 
    Display[i]=Display[i+1] 
    Next  
    Return 
    
    Update_data: 
    For Y =0 To 7 
    ADDRESS = Y+1 
    DATAREG1 = Display[Y] 
    DATAREG2 = Display[y+8] 
    DATAREG3 = Display[y+16]
    DATAREG4 = Display[y+24] 
    GoSub MaxWrite 
    Next Y 
    Return
    
    MaxWrite: 
    low LOAD
    SHOut DAT,CLK,msbfirst,[ADDRESS,DATAREG4,ADDRESS,DATAREG3,ADDRESS,DATAREG2,ADDRESS,DATAREG1] 'Shift out the data to the 'MAX7219 'first the address, then data. 
    PulsOut LOAD,2 'load the data into the MAX7219 
    Return

  5. #5
    Join Date
    Aug 2003
    Location
    Australia
    Posts
    1,043

    Default Re: Please help, any ideas to improve Scrolling Text MAX7219

    All of that checking for each character and definitions should all be one single lookup table.
    That code would vary in speed depending on the character being printed.

Members who have read this thread : 24

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts