Haberler:

Foruma Resim Yükleme ve Boyut Sınırlaması ( ! )  https://bit.ly/2GMFb8H

Ana Menü

Dış alarm göstergesi

Başlatan ipek, 11 Ekim 2013, 03:33:43

ipek

nette bulduğum bir dosyayı derledim sanki watchdog atıyor sebebini bulamadım.
yazar UAA2022 diye dinazor bir çip kullanmış bende kaskat 595 bağladım haberleşme standardı uymuyor desem
sonuçta aksakta olsa çalışıyor.

http://www.dosya.tc/server17/tor3G0/ledshift5cylon16bit.zip.html
' Ledshift5.BAS   UAA2022 shift register   16 leds driver  Cylon eye - 5 leds

Device=16F628A
Config CPD_OFF,CP_OFF,BODEN_OFF,MCLRE_OFF,PWRTE_ON,WDT_OFF,INTRC_OSC_NOCLKOUT,LVP_OFF     
Xtal = 4 

                             

SYMBOL Data_In = PORTB.0      ;DI pin UAA2022
SYMBOL ChipSelect = PORTB.1   ;/CS pin UAA2022
                              ;0 before the falling edge of / CLK is
                              ; 1 matches> 1us to the rising edge of / CLK
SYMBOL Clock = PORTB.2        ;/CLK Pin UAA2022, shift op positive  edge

DIM Plates AS BYTE
DIM Plates2 AS BYTE
DIM Plates3 AS BYTE
DIM BitFlag AS BYTE
DIM LedData[16] AS BYTE 
DIM CylonData[16] AS BYTE     


 
TRISA=%00000000 :  PORTA = 0
TRISB=%00000000 :  PORTB = 0
 CLEAR                         ;all knowledge RAM memory

        GOSUB ClearArray
  WHILE 1=1
                            ;5 led's residual 
 FOR Plates3 = 1 TO 12
 FOR Plates2 = 1 TO 16
        LedData[Plates2]=LREAD Cylon_Data +(16*(Plates3-1))+(Plates2-1)
 NEXT
        GOSUB FillArray
        DELAYMS 50      '10
 NEXT
        DELAYMS 150     '125
 FOR Plates3 = 11 TO 1 STEP -1
 FOR Plates2 = 1 TO 16
        LedData[Plates2]=LREAD Cylon_Data +(16*(Plates3-1))+(Plates2 - 1)
 NEXT
        GOSUB FillArray
        DELAYMS 50      '10
 NEXT
        DELAYMS 150     '750
  WEND

END
'---------------------------------------------------------------------------------------
ClearArray:
                                        ;Delete the shift register
                                        ;all 16 bits in the shift register to 0
 FOR Plates = 1 TO 16
        LedData[Plates]=0
 NEXT
'---------------------------------------------------------------------------------------
FillArray:
                                        ;send the array to the shift register
    
 FOR Plates = 1 TO 16        
        ChipSelect=0
        Clock=0
        Data_In=LedData[Plates]
        Clock=1                         ;DI is clocked
        ChipSelect=1
 NEXT      
    RETURN
END

Cylon_Data:
    LDATA 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0
    LDATA 0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0
    LDATA 0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0
    LDATA 0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0
    LDATA 0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0
    LDATA 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0
    LDATA 0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0
    LDATA 0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0
    LDATA 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0
    LDATA 0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0
    LDATA 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0
    LDATA 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1