8x8 Scrolling LED display (Simple example)


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    wel as for the reading of IR code i used a build in command from protonIde picbasic compiler, the code is only for testing puposes and not looking good as i yet didn't finished the implementing my idea, and here it is

    Code:
    		 '****************************************************************
    
    ' SIMPLE 15X8 LED MATRIX SCROLLING EXAMPLE
    ' 16F877A External 8MHz Xtal Osc
    ' LED Matrix columns are conected to PORTC pin rc0 via ULN2004AN and CD4017.
    ' RC1 reset for 4017
    ' LED Matrix rows conected to PORTB via 100 ohm resistors 
    ' RB0 - top row
    ' Author: Muamer Halilovic
    ' www.mtskola.com
    ' today
    '***************************************************************************************
    Device 16F877A
    Xtal 8
    TRISB = %00000000
    TRISC = %10000000
    TRISD = %00000000
    PORTB=0
    PORTC=0
    PORTD=0
    All_Digital = True
      
    	EWrite 0,[%00000100,%00000110,%01111111,%00000110,%00000100]	'Up Arrow
    	EWrite 5,[%00010000,%00110000,%01111111,%00110000,%00010000]	'Dn Arrow
    	EWrite 10,[%01111110,%00010001,%00010001,%00010001,%01111110]	'A
    	EWrite 15,[%01111111,%01001001,%01001001,%01001001,%00110110]	'B
    	EWrite 20,[%00111110,%01000001,%01000001,%01000001,%00100010]	'C
    	EWrite 25,[%01111111,%01000001,%01000001,%00100010,%00011100]	'D
    	EWrite 30,[%01111111,%01001001,%01001001,%01001001,%01000001]	'E
    	EWrite 35,[%01111111,%00001001,%00001001,%00001001,%00000001]	'F
    	EWrite 40,[%00111110,%01000001,%01001001,%01001001,%01111010]	'G
    	EWrite 45,[%01111111,%00001000,%00001000,%00001000,%01111111]	'H
    	EWrite 50,[%00000000,%01000001,%01111111,%01000001,%00000000]	'I
    	EWrite 55,[%00100000,%01000000,%01000001,%00111111,%00000001]	'J
    	EWrite 60,[%01111111,%00001000,%00010100,%00100010,%01000001]	'K
    	EWrite 65,[%01111111,%01000000,%01000000,%01000000,%01000000]	'L
    	EWrite 70,[%01111111,%00000010,%00000110,%00000010,%01111111]	'M
    	EWrite 75,[%01111111,%00000100,%00001000,%00010000,%01111111]	'N
    	EWrite 80,[%00111110,%01000001,%01000001,%01000001,%00111110]	'O
    	EWrite 85,[%01111111,%00001001,%00001001,%00001001,%00000110]	'P
    	EWrite 90,[%01111111,%00001001,%00011001,%00101001,%01000110]	'R
    	EWrite 95,[%01000110,%01001001,%01001001,%01001001,%00110001]	'S
    	EWrite 100,[%00000001,%00000001,%01111111,%00000001,%00000001]	'T
    	EWrite 105,[%00111111,%01000000,%01000000,%01000000,%00111111]	'U
    	EWrite 110,[%00011111,%00100000,%01000000,%00100000,%00011111]	'V
    
    
        '________________________________________________________________
        'Deklaracija promjenjivih
        '________________________________________________________________
       	Dim kolona As Byte
    	Dim brojac As Byte
    	Dim k As Byte
    	Dim scan  As Byte
    	Dim scroll As Byte
    	leddata var Byte[100]
        Dim ir_ulaz As Word ' WORD variabla za zaprimanje podataka
        Dim EEpromAdress As Byte 'eprom adresa za upis 
        Dim test As Word 'uporedjivach 
        Dim upisi As ir_ulaz.LowByte
        Dim i As Byte
        Dim sledeceslovo As Word
        Dim prethodnoslovo As Word
        Dim potvrdi As Word
        Dim kraj As Word
        Dim x As Byte
        Dim j As Byte
        Dim cnt As Byte
    
        '________________________________________________________________
        'poetene vrijednosti
        '________________________________________________________________
    
        EEpromAdress = 255
        cnt=0
        k=109
        j=0
        '________________________________________________________________
        'Inicijalizacija
        '________________________________________________________________
        High PORTD.0
        DelayMS 1300
        Low PORTD.0
        DelayMS 1300
        '________________________________________________________________
        'pregledaj eeprom ako ima sta idi na main ako ne idi na pripremu
        '________________________________________________________________
    
    provjera:
       
            test.LowByte = ERead EEpromAdress 'iscitaj zapis iz eeproma sa adrese 255
                    If test.LowByte = $FF Then 'ako je FF pici dalje
                        GoSub eepromprogON
                        DelayMS 1000
                    EndIf
            test.LowByte = ERead 255
                    If test.LowByte <> $FF Then 
                        GoSub odaberporuku
                        DelayMS 1000
                    EndIf
        '*******************************************************************
        Declare RC5In_Pin PORTC.7                    'infrared sensor pin
        '********************************************************************
    main:	
    Clear
    Low PORTD.0
    j=0 
    leddata[0-13] = $00 
        For i = 0 To 4
        k=115
    	 leddata [i+14]=ERead k+i	'B 
    	 leddata [19]=$00
         leddata [i+20]=ERead k+i+6	'B
          leddata [25]=$00
         leddata [i+26]=ERead k+i+12	'B 
          leddata [31]=$00
         leddata [i+32]=ERead k+i+18	'B   
    	Next
    
    
           For scroll = 0 To 37 ' 
              
    
             For scan = 0 To 50
    	                                 PORTC.1 = 1  'reseting 4017
                      PORTC.1 =0 
    			For kolona = 0 To 14
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 150
                    PORTB=0     	
    		    Next
             Next
             For brojac = 0 To 36
            leddata[brojac]=leddata[brojac+1]
            Next
            Next 
    GoTo main
    
    eepromprogON:            
        High PORTD.0  
        
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       
          EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          sledeceslovo.LowByte = ERead EEpromAdress
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       EEpromAdress=EEpromAdress - 1
                       EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          prethodnoslovo.LowByte = ERead EEpromAdress
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       EEpromAdress=EEpromAdress - 1
                       EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          kraj.LowByte = ERead EEpromAdress
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    
     Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       EEpromAdress=EEpromAdress -1
                       EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          potvrdi.LowByte = ERead EEpromAdress
            
                
          For x=0 To 5
            Toggle PORTD.0
            DelayMS 100
          x=x+1
          Next 
          x=0
          EEpromAdress=0
    Return
    
    odaberporuku:	
    High PORTD.0
    While ir_ulaz.LowByte<>kraj.LowByte
        Repeat
           ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
        Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala 
    
    If ir_ulaz.LowByte=sledeceslovo.LowByte Then
    
        For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'  
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
          If cnt=115 Then
          cnt=0
          EndIf
          cnt=cnt+5
    '      j=j+1
    ElseIf ir_ulaz.LowByte=prethodnoslovo.LowByte Then
    
    cnt=cnt-5
        For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'  
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
          If cnt=0 Then
          cnt=115
          EndIf
    '      j=j+1 
    
    'zapamti slovo u eeprom   na lokaciji 115 pa nadalje!
    
    ElseIf ir_ulaz.LowByte=potvrdi.LowByte Then
     k=k+6
     For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'  
    	Next
     For i = 0 To 4 
     
    	 EWrite (i+k),[leddata [i]]	' 
         DelayMS 20 
     Next
     Low PORTD.0
     DelayMS 200
     High PORTD.0
    
    
    ' j=j+1
    'elseIf ir_ulaz.LowByte=kraj.lowbyte and j<>0 Then GoTo main
    EndIf
    
    Wend
    'goto main
    Return
    End
    as for the schematic i just used cd4017 datasheet section for cascading columns, the clock is portc.0 pin and the reset is portc.1 pin, as you can see i am working on a protoboard so i dont have a full schematic. This fun project is in development and probably wont be finished for long so i cant ofer a PCB design!!! thx again for help from everyone spacially wellyboot
    Last edited by xxxxxx; - 11th February 2011 at 07:12.

  2. #2
    Join Date
    Apr 2010
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    to xxxxxx

    thanks for the fast reply,it doesn't need full clear schematic just give what u modified/add to original one by 4017,i mean just how to connect,even hand draw on paint software is ok..
    thanks n waiting for ur reply;;
    krish

  3. #3
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    it doesn't need full clear schematic just give what u modified/add to original one by 4017
    krish
    http://www.electro-tech-online.com/a...-expansion.jpg

    well i use this schematic, clock is coming from portc.0, and reset is conected to portc.1, hope this would help
    Attached Images Attached Images  
    Last edited by Archangel; - 15th March 2015 at 16:20. Reason: remove script & spell

  4. #4
    Join Date
    Apr 2010
    Posts
    11


    Did you find this post helpful? Yes | No

    Thumbs up Re: 8x8 Scrolling LED display (Simple example)

    Quote Originally Posted by xxxxxx View Post
    http://www.electro-tech-online.com/a...-expansion.jpg
    Attachment 5159
    well i use this schematic, clock is comming from portc.0, and reset is conected to portc.1, hope this would help
    thank u so much...highly appreciate ur help n fast response..yes this clears lot questions..
    tnx again
    krish

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    If you choose to use a SIPO register (serial in-parallel output) then you will drop the AND gate in the cost of more I/O pins from the controller.

    Like the 4094 chip.

    Ioannis

  6. #6
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    yes that is a great idea, going to google for samples of 4049!thx

  7. #7
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    here is the final result, the message is Baby on Board on my native language (bosnian)



    the code is made in ProtonIde compiler and is similar to PBP hope someone will use it

    Code:
    		 '****************************************************************
    
    ' SIMPLE 15X8 LED MATRIX SCROLLING EXAMPLE
    ' 16F877A External 8MHz Xtal Osc
    ' LED Matrix columns are conected to PORTC pin rc0 via ULN2004AN and CD4017.
    ' RC1 reset for 4017
    ' LED Matrix rows conected to PORTB via 100 ohm resistors 
    ' RB0 - top row
    ' Author: Muamer Halilovic
    ' www.mtskola.com
    ' today
    '***************************************************************************************
    Device 16F877A
    Xtal 12
    TRISB = %00000000
    TRISC = %10000000
    TRISD = %00000000
    PORTB=0
    PORTC=0
    PORTD=0
    All_Digital = True
      
    	EWrite 0,[%00000100,%00000110,%01111111,%00000110,%00000100]	'Up Arrow
    	EWrite 5,[%00010000,%00110000,%01111111,%00110000,%00010000]	'Dn Arrow
    	EWrite 10,[%01111110,%00010001,%00010001,%00010001,%01111110]	'A
    	EWrite 15,[%01111111,%01001001,%01001001,%01001001,%00110110]	'B
    	EWrite 20,[%00111110,%01000001,%01000001,%01000001,%00100010]	'C
    	EWrite 25,[%01111111,%01000001,%01000001,%00100010,%00011100]	'D
    	EWrite 30,[%01111111,%01001001,%01001001,%01001001,%01000001]	'E
    	EWrite 35,[%01111111,%00001001,%00001001,%00001001,%00000001]	'F
    	EWrite 40,[%00111110,%01000001,%01001001,%01001001,%01111010]	'G
    	EWrite 45,[%01111111,%00001000,%00001000,%00001000,%01111111]	'H
    	EWrite 50,[%00000000,%01000001,%01111111,%01000001,%00000000]	'I
    	EWrite 55,[%00100000,%01000000,%01000001,%00111111,%00000001]	'J
    	EWrite 60,[%01111111,%00001000,%00010100,%00100010,%01000001]	'K
    	EWrite 65,[%01111111,%01000000,%01000000,%01000000,%01000000]	'L
    	EWrite 70,[%01111111,%00000010,%00000110,%00000010,%01111111]	'M
    	EWrite 75,[%01111111,%00000100,%00001000,%00010000,%01111111]	'N
    	EWrite 80,[%00111110,%01000001,%01000001,%01000001,%00111110]	'O
    	EWrite 85,[%01111111,%00001001,%00001001,%00001001,%00000110]	'P
    	EWrite 90,[%01111111,%00001001,%00011001,%00101001,%01000110]	'R
    	EWrite 95,[%01000110,%01001001,%01001001,%01001001,%00110001]	'S
    	EWrite 100,[%00000001,%00000001,%01111111,%00000001,%00000001]	'T
    	EWrite 105,[%00111111,%01000000,%01000000,%01000000,%00111111]	'U
    	EWrite 110,[%00011111,%00100000,%01000000,%00100000,%00011111]	'V
    	EWrite 115,[$00,$00,$00,$00,$00]	'blank space
    	EWrite 185,[$00,$00,$00,$00,$00]
    	EWrite 190,[$00,$00,$00,$00,$00]
    	EWrite 195,[$00,$00,$00,$00,$00]
    	EWrite 200,[$00,$00,$00,$00,$00]
    	EWrite 205,[$00,$00,$00,$00,$00]
    	EWrite 210,[$00,$00,$00,$00,$00]
    	EWrite 215,[$00,$00,$00,$00,$00]
    	EWrite 220,[$00,$00,$00,$00,$00]
    	EWrite 225,[$00,$00,$00,$00,$00]
    	EWrite 230,[$00,$00,$00,$00,$00]
    	EWrite 235,[$00,$00,$00,$00,$00]
    	EWrite 240,[$00,$00,$00,$00,$00]
    	EWrite 245,[$00,$00,$00,$00,$00]
    	
    
    
        '________________________________________________________________
        'Deklaracija promjenjivih
        '________________________________________________________________
       	Dim kolona As Byte
    	Dim brojac As Byte
    	Dim k As Byte
    	Dim scan  As Byte
    	Dim scroll As Byte
    	leddata var Byte[100]
        Dim ir_ulaz As Word ' WORD variabla za zaprimanje podataka
        Dim EEpromAdress As Byte 'eprom adresa za upis 
        Dim test As Word 'uporedjivach 
        Dim upisi As ir_ulaz.LowByte
        Dim i As Byte
        Dim sledeceslovo As Word
        Dim prethodnoslovo As Word
        Dim potvrdi As Word
        Dim play As Word
        Dim x As Byte
        Dim j As Byte
        Dim cnt As Byte
        Dim a As Byte
        Dim b As Byte
        Dim c As Byte
        Dim d As Byte
    
        '________________________________________________________________
        'poetene vrijednosti
        '________________________________________________________________
    
        EEpromAdress = 255
        cnt=0
        k=114
    
        '________________________________________________________________
        'Inicijalizacija
        '________________________________________________________________
        High PORTD.0
        DelayMS 1300
        Low PORTD.0
        DelayMS 1300
        '________________________________________________________________
        'pregledaj eeprom ako ima sta idi na main ako ne idi na pripremu
        '________________________________________________________________
          '*******************************************************************
        Declare RC5In_Pin PORTC.7                    'infrared sensor pin
        '********************************************************************
    
    provjera:
       
            test.LowByte = ERead 255 'iscitaj zapis iz eeproma sa adrese 255
                    If test.LowByte = $FF Then 'ako je FF 
                        GoSub eepromprogON 'idi u programiraj komande
                        DelayMS 500
                    EndIf    
            test.LowByte = ERead 120 ' iscitaj zapis iz eeproma sa adrese 120 (pocetak poruke)
                    If test.LowByte = $FF Then ' ako je 00 
                        GoSub odaberporuku     ' idi na odaberi poruku
                        DelayMS 500
                    EndIf 
                   
    main:
        
    Clear ' ocisti sve varijable
    Low PORTD.0  ' usli smo u mod za prikaz poruke
    a=14
    k=120
    j=0
    leddata[0-13] = $00             ' varijabla ledadta od 0 do 13 je 00
    For b = 0 To 11                 ' moguci broj slova u poruci
        For i = 0 To 4      
            c=i+a                   'povecaj a=14-19; a=20-24; a=26-30 itd...
            d=i+j+k                   'povecaj j=120-124; a=126-130; a=131-135 itd...
                leddata [c]= ERead d	'filuj ledadtu od 14 do max broja slova za prikaz iz eeproma pocevsi od 120 pa nadalje
                DelayUS 20  
        Next
        leddata [a+5]=ERead 119   'upisi prazanu kolonu izmedju slova	
          a=a+6   
          j=j+6   
     Next
           For scroll = 0 To c      ' skrolaj poruku c zadnji leddata
              
             For scan = 0 To 35
                      PORTC.1 = 1   'reseting 4017
                      PORTC.1 =0 
    			For kolona = 0 To 14  'broj kolona
    				PORTC.0 = 1       'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 250
                    PORTB=0    	
    		    Next
    
             Next
             For brojac = 0 To (c-1)
            leddata[brojac]=leddata[brojac+1]' pomjeri za jedan
            Next
    
            Next
                    If PORTD.1=1 Then 
                    GoSub odaberporuku 
        	 	End If
    GoTo main
    End
    
    eepromprogON: 'podprogram za odabir komadi za upravljanje             
        High PORTD.0  
        
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       
          EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          sledeceslovo.LowByte = ERead EEpromAdress ' pridruzi varijabli sledece slovo komandu i upisi u eprom na zadnju lokaciju
          For i = 0 To 4 
    	 leddata [i]=ERead i	'  prikazi strelicu
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                EEpromAdress=EEpromAdress - 1      
          EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          prethodnoslovo.LowByte = ERead EEpromAdress ' pridruzi varijabli sledece slovo komandu i upisi u eprom na zadnju lokaciju
          For i = 0 To 4 
    	 leddata [i]=ERead i+5	'  prikazi strelicu
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
                Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       EEpromAdress=EEpromAdress - 1
                       EWrite EEpromAdress , [ ir_ulaz.LowByte ]
          play.LowByte = ERead EEpromAdress  ' pridruzi varijabli play komandu i upisi u eprom na predzadnju lokaciju
          leddata[0]=$FE  'play simbol
    	leddata[1]=$7C
    	leddata[2]=$38
    	leddata[3]=$10
    	leddata[4]=$00
     
         For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next     
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    DelayMS 100
    Low PORTD.0
    DelayMS 100
    High PORTD.0
    
     Repeat
                    ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
                Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala
                       EEpromAdress=EEpromAdress -1
                       EWrite EEpromAdress , [ ir_ulaz.LowByte ] ' pridruzi varijabli potvrfi komandu i upisi u eprom na predpredzadnju  :D lokaciju
          potvrdi.LowByte = ERead EEpromAdress
            
          leddata[0]=$00  
    	leddata[1]=$00
    	leddata[2]=$08
    	leddata[3]=$10
    	leddata[4]=$20
    	leddata[5]=$10
    	leddata[6]=$08
    	leddata[7]=$04
    	leddata[8]=$02
    	leddata[9]=$01 
         For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 9
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next     
          For x=0 To 5
            Toggle PORTD.0
            DelayMS 100
          x=x+1
          Next 
          x=0
          EEpromAdress=0
    Return 'vrati se u if petlju na pocetku
    
    
    
    odaberporuku:	' podrpogram za odabir poruke za prikaz
    High PORTD.0
    sledeceslovo.LowByte = ERead 255
    prethodnoslovo.LowByte = ERead 254
    play.LowByte = ERead 253
    potvrdi.LowByte = ERead 252
    cnt=0
    k=114
    Low PORTD.1
    Repeat
           ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
        Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala 
    While ir_ulaz.LowByte<>play.LowByte
        Repeat
           ir_ulaz.LowByte= RC5In '  Primanje signala sa TSOP1738
        Until upisi<> 255' Trazi-cekaj dok ne naleti valjano zaglavlje signala 
    If ir_ulaz.LowByte=prethodnoslovo.LowByte Then
              If cnt = 0 Then
                cnt=5
             EndIf
       cnt=cnt-5
        For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'  
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
            
    ElseIf ir_ulaz.LowByte=sledeceslovo.LowByte Then
    
       cnt=cnt+5
    
        For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'  
    	Next
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 4
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
                       If cnt = 119 Then
                cnt=0
             EndIf
    ElseIf ir_ulaz.LowByte=potvrdi.LowByte Then 'upisi odabran0o slovo u narednu slobodnu eeprom lokaciju
     k=k+6'krecemo od 120
     For i = 0 To 4 
    	 leddata [i]=ERead i+cnt
         DelayUS 10	'  
    	Next
     
     For i = 0 To 4 
     
    	 EWrite (i+k),[leddata [i]]	' 
         DelayMS 20 
     Next
    
    For scroll =0 To 1
     For i = 0 To 4 
    	 leddata [i]=ERead i+cnt	'prikazi odabrano slovo  
    	Next
    	leddata[5]=$00
    	leddata[6]=$00
    	leddata[7]=$08
    	leddata[8]=$10
    	leddata[9]=$20
    	leddata[10]=$10
    	leddata[11]=$08
    	leddata[12]=$04
    	leddata[13]=$02
    	leddata[14]=$01
             For scan = 0 To 185
             PORTC.1 = 1  'reseting 4017
             PORTC.1 =0	
    			For kolona = 0 To 14
    				PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
    				DelayUS 500
                    PORTB=0     	
    		    Next
             Next
    Next
    EndIf
     
    Wend
    Low PORTD.0
    Return ' vrati se odakle si i dosao

  8. #8
    Join Date
    May 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    Hi to all,

    A newbie here. I try to compile the file from first post but I receive a constant error
    ERROR Line 51: LOOP without a matching DO.
    How can I avoid that?

    Many thanks in advance
    Gabi

    P.S.
    I know it is a old thread but maybe someone or OP will chime in and help me with that error

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    I suppose you are using PBP 2.60, right?

    LOOP is a reserved word for 2.60. So use Loop1 or something.

    Ioannis

  10. #10
    Join Date
    May 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    Still, Ioannis can you have a look on that code and give me your expert opinion

    Rgds
    Gabi

  11. #11
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    The code is simple and should run with no problems.

    If you insist on simulation, I do not know much. I hear that Proteus is the Best, but still have a few flaws.

    Did you try the code on real circuit?

    Ioannis

  12. #12
    normey's Avatar
    normey Guest


    Did you find this post helpful? Yes | No

    Smile Re: 8x8 Scrolling LED display (Simple example)

    hello all..

    i need your help. i want to build program even one word to display on dot matrix (7x5) with pic16f877a. i use c language. but when i compile it don't have any error. but it can't work on dot matrix after i load that program. anyone can help me.. i'm on stuck. hope you all can help me. here my program. i want use port a n port b.

    #include <16f877a.h>


    #use delay(clock=20000000)
    #fuses hs,nowdt,nocpd,nolvp,noprotect

    #byte porta=0x06
    #byte portb=0x08
    #bit clock=portd.6
    #bit data=portd.7

    unsigned int8 i,j,index1,n,
    addr[11]={0xEA,0xEA,0x2A,0x2A,0x2A,0x2A,0xAA,0x82,0xFF,0xF F,0xFF},
    cont[11];

    void main()
    {
    set_tris_a(0x00);
    set_tris_b(0x00);
    while(1)
    {
    for(n=0;n<=99;n++)
    {
    data=1;
    for(i=0;i<=5;i++)
    {
    clock=1;
    portb=addr[i];
    delay_ms(1);
    clock=0;
    data=0;
    }
    }

    for(j=0;j<=7;j++)
    {
    cont[j]=addr[j];
    }

    for(j=0;j<=7;j++)
    {
    addr[j]=cont[j+1];
    }
    addr[10]=cont[0];

    }
    }


    besides that i'm a new in programming. hope n hope anyone can help me.. thank you.

  13. #13


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    Hi please any one would you able to help me to build the LED Matrix project? i have already designed it for 10x7 matrix. it's working nicely. but if i extend this to 20x7 then it s running and blinking fastly. i think the delay wil b a problem. now i want some guidelines from u. please it's urgent. help me.[email protected]. mail me the code in c

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    Sure, which compiler do you want me to make it?

    Please, check the forum and what we do here. No C and sure no serving to the plate.

    Ioannis
    Last edited by Ioannis; - 9th July 2012 at 06:54.

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. MY FIRST scrolling 8X8 LED
    By earltyso in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th August 2008, 16:23
  3. 5x7 LED Matrix Scrolling Display
    By roycarlson in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 4th August 2008, 23:50
  4. Replies: 2
    Last Post: - 14th July 2008, 22:11
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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