Satır Taramalı Kayan Yazı

Başlatan meyer, 18 Aralık 2011, 15:01:38

meyer

#30
  İyi günler Ete Hocam,
   if portc.0=1 or portc.1=1 or portc.2=1 then t=0: gosub TUSAL
Öncelikle bu kodu ayar münüsüne gitmek için kullanıyorum.Program hangi aşamada olursa olsun bu tuşlara basıldığında ayar menüsüne gitmesi için kullandım..
  Goto ile gidip return'le geri dönmesi gerçekten büyük bir hata hocam..Program üzerinde oynamalar yaptığım zaman,bazı yerlerini değiştirmemişim sanıyorum..Ondan böyle kalmıştır diye düşünüyorum...
Hocam devredeki sorununda şu kodlardan kaynaklandığını düşünüyorum..
GOto SAAT_GOSTER1..Bu kodu programa eklemeden önce böyle bir sorun yoktu..Kod içinde her matrix için hem datasını alması,hemde ekranda göstermesi için 2 kez gosub etiketi ile dallanma yapılıyor..12 matrix için 24 defa oluyor bu da..sanıyorum sorunum burdan kaynaklanıyor hocam..Bu sorunu halledebilirsem sorununda ortadan kalkacağını düşünüyorum..Umarım en kısa sürede sonuç alabilirim..
İyi günler dilerim...

TUSAL:TUS=50S1:IF PORTC.0=1 THEN TUS=TUS+1      :GOTO S1S2:IF PORTC.1=1 THEN gosub ILERI_SA :GOTO S2S3:IF PORTC.2=1 THEN GOsub GERI_SA  :GOTO S3    IF TUS<>50  THEN T=T+1    IF T=2      THEN T=0    IF TUS=2    THEN TUS=0GOto SAAT_GOSTER1    IF PORTC.3=1 THEN GOTO saat_goster  return'****************************************************************'**************************************************************** saat_goster1:    FOR W=0 TO  11'''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0'returngoto tusal'****************************************************************

               

ete

#31
Bahsi geçen alt programda çok fazla iç içe geçmiş Gosub komutu göremedim.
Stack mantığını biraz anlamanda fayda var.
Program bir Gosub komutu görünce o anda bulunduğu yerin adresini Stack'a yazar ve gitmesi gereken gosub adresine gider.
O adresde bir başka Gosub görür ise o adreside stack'e yazar ve orayada gider. Bu şekilde iç içe gçmiş en fazla 5-6 adresi stack kayıt altına alabilir. Ancak bunu aşarsan stack dolacağı için adresleri kayıt edecek yer kalmaz ve böylece program nereye gitmesi gerektiğini şaşırarak kilitlenir.
Ancak bir gosub gördü  ..............stack'e 1 adres yazıldı
Gittiği adreste bir gosub gördü ........stacke 1 adres daha yazıldı ve o adrese gitti ordan geri döndü. dönerken son yazılan adresi alır ve o adrese döner böylece stack den 1 adres silinmiş olur.
Burada önemli olan iç içe geçmiş gosub adedidir. Yoksa gosubla gidilen yerde 10 tane gosub olsun ama sırası ile her birine gidilip geri dönülsün hiç bir şekilde stack'ı etkilemez.

Sen benim dediğim konuta dikkat et ve onu halledebilmek için bir işaretçi kullan.
İŞaretçi demek TUSAL kısmında bir bit değişkenini set et ve return ile geri dön. Sonra döndüğün yerde bit değişkeni set edilmiş ise o gosubdan  da geri dön ve en son döndüğün yerde bit değişkeni set edilmiş ise tuş değerini değerlendir.

Ete

meyer

#32
 Stack mantığını anlattığınız için teşekkür ederim hocam..Böylece stack ile ilgili kafamdaki soru işaretleri de ortadan kalkmış oldu..
Sorunumu dediğiniz gibi bir işaretçi ile halletmeye çalışayım..
Yardımınız için tekrardan teşekkür ederim..İyi günler dilerim...

est32

Hocam yığını(stack) silecek bir komut veya yöntem yok mu?
Geçenlerrde lazım oldu böyle bişey olsaydı iş kestirmeden yapılacaktı,olmadığı için de çok komutlu oldu program.
Olay şu idi;
portb pin değişiklik kesmesi ile program ledleri animasyon ile yakıyor ve tuşa basılınca kesmeye gidilip işlemleri yapılıyordu,tabii bu tuşlardan biri de animasyonu değiştirme tuşu idi.
kesmeye gidildiği için kesmede goto komutu kullanamadım.Başka yöntemle yaptım ama çok fazla kod kullandım.

ete

Stack ulaşılabilir bir alan değildir maalesef. En azından ben öyle biliyorum.
18F serisinde farklı şeyler duymuştum ama tam emin değilim.

Ete

est32


meyer

#36
  İyi akşamlar arkadaşlar,
Saatin ayar kısmını sonunda halledebildim..Devre şemasını,pbp kodunu ve hex dosyasını da  ekte yolluyorum...
Saat ve dakika ayarının yapılışı :
Devre çalışırken herhangi bir anda Giriş / Çıkış butonuna bastığımız anda devre ayar menüsüne gidecektir..İleri ve geri butonlarıyla saat ve dakika ayarlanmaktadır..Menüde ilk anda saat ayarlanmaktadır.Dakika'yı ayarlamak için Mod tuşuna basılmalıdır.Daha sonra ileri ve geri butonlarıyla da dakika ayarlanmaktadır.Ayar menüsünden çıkmak içinde tekrardan Giriş / Çıkış butonuna basılmalıdır.
Ayar menüsünü şimdilik böyle yapabildim arkadaşlar..Bundan sonra da devreye eeprom  ve pc/2 klavye eklemeye çalışacağım..
İyi akşamlar...

'****************************************************************'Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *'*  Author  : [HAKAN_ÖZKAN]                                     *'Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *'*          : All Rights Reserved                               *'Date    : 27.12.2011                                        *'*  Version : 1.0                                               *'Notes   :                                                   *'*          :                                                   *'****************************************************************define OSC 20'****************************************************************TRISB=0 : TRISD=0  : TRISC=31  : TRISE=0 : TRISA=0PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0INTCON2.7=0'74HC595*********************************************************Symbol CLK1     =PORTB.0Symbol DTA1     =PORTB.1Symbol STROBE1  =PORTB.2'DS18B20*********************************************************SYMBOL COMM_PIN =PORTB.3'DS1302**********************************************************symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlarsymbol  RTC_SCLK=PORTB.6symbol  RTC_DTA =PORTB.7'****************************************************************NEGAT_ISI CON 1                  ' Negatif_Cold = 1'****************************************************************TUS         VAR BYTET           VAR ByteHAM         VAR WORDISI         var WORDrtcsec      VAR BYTE rtcmin      VAR BYTE rtchour     VAR BYTErtcyear     VAR BYTE rtcmonth    VAR BYTE rtcday      VAR BYTE rtcdate     VAR BYTE TEMP        VAR BYTE VERI        VAR BYTE SAYI        VAR BYTE  SIGN        VAR BYTEFLOAT       var BYTEmem         var byteBIRLER      VAR BYTEONLAR       VAR BYTESIGN_BITI VAR HAM.Bit11  '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık'****************************************************************SUTUN     var Byte[8]    ' 1497 adet byte tipinde değişken tanımlanabilir.RAKAM     VAR BYTEARA       VAR BYTEI         var ByteX         var ByteW         var ByteM         var WORD'''''''''''''''''''yazi_reg  var byteharf_reg  var bytez         var bytey         var byte  A         VAR BYTEB         VAR BYTEC         VAR BYTEu         var bit'****************************************************************gosub SENSORYAZGOSUB SENSOROKU'gosub ZAMAN_OKULow RTC_RST              ' RTC yi resetleLow RTC_SCLK '****************************************************************clearpause 250'****************************************************************BASLA:yazi_reg=0      For W=0 To 11gosub yazi : yazi_Reg=yazi_reg+1gosub data_alaa:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1        if portc.4=1 then goto saat_goster1M=M+1If M<96                Then gosub sola_kay   : goto aa  If M>96   and m<192    Then gosub saga_kay   : goto aa If M>192  and m<201    Then gosub asagi_kay  : goto aa if m>201  and m<210    then gosub yukari_kay : goto aa If m>210  then m=0 goto saat_gostergoto basla '**************************************************************** GECIKME:FOR VERI=0 TO 1500PAUSEUS 1000NEXT RETURN'****************************************************************  kontrol:if rtchour=24  then rtchour=0    : rtcdate=rtcdate+1 : rtcday=rtcday+1 if rtcmin=60   then rtcmin=0  if rtchour=255 then rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1 if rtcmin=255  then rtcmin=59gosub zaman_yazgosub gecikmegosub zaman_oku'if u=2 then u=0return'**************************************************************** saat_goster1:GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11 '''''''''''''''''''''    if portc.0=1         then u=u+1             : gosub kontrol  if u=0 and portc.1=1 then rtchour=rtchour+1 :gosub kontrol   if u=0 and portc.2=1 then rtchour=rtchour-1 :gosub kontrol if u=1 and portc.1=1 then rtcmin=rtcmin+1   :gosub kontrol if u=1 and portc.2=1 then rtcmin=rtcmin-1   :gosub kontrol '''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiDiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0         if portc.4=1 then goto BASLAgoto SAAT_GOSTER1 '**************************************************************** saat_goster:C=C+1    iF C=20 THEN C=0GOTO ISI_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''    'if portc.0=1 then u=u+1   : gosub kontrol  'if u=0 and portc.1=1 then rtchour=rtchour+1 :gosub kontrol   'if u=0 and portc.2=1 then rtchour=rtchour-1 :gosub kontrol 'if u=1 and portc.1=1 then rtcmin=rtcmin+1   :gosub kontrol 'if u=1 and portc.2=1 then rtcmin=rtcmin-1   :gosub kontrol '''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0 goto SAAT_GOSTER '****************************************************************ISI_GOSTER:C=C+1    iF C=20 THEN C=0:  GOTO TARIH_GOSTER'''''''''''''''''''''GOSUB SENSOROKUFOR A=0 TO 11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''if a=0 thenRAKAM=ISI DIG 1GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=1 then RAKAM=ISI DIG 0GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=2 then rakam=223gosub data_al2gosub gosterendif'''''''''''''''if a=3 then rakam="C"gosub data_al2gosub gosterendif'''''''''''''''if sign="-" thenif A=10 then RAKAM="-"  GOSUB DATA_AL2 gosub GOSTERendifendif'''''''''''''''if sign="+" then if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTER endifendif'''''''''''''''''''''NEXTA=0 GOTO ISI_GOSTER'****************************************************************TARIH_GOSTER:C=C+1    iF C=15 THEN C=0GOTO GUN_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR B=0 TO  11           if portc.4=1 then goto saat_goster1'''''''''''''''''''''if B=0 then RAKAM=rtcDAte DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if B=1 then RAKAM=RTCdate DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=2 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=3 then RAKAM=RTCmonth  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=4 then RAKAM=RTCMonth  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=5 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=6 then RAKAM=RTCyear  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=7 then RAKAM=RTCyear  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=8  OR B=9 OR B=10 OR B=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXTB=0goto TARIH_GOSTER '****************************************************************GUN_GOSTER:         if portc.4=1 then goto saat_goster1C=C+1    iF C=5 THEN C=0:  GOTO BASLA'''''''''''''''''''''GOSUB ZAMAN_OKUgosub yazi1GOSUB GOSTER2goto GUN_GOSTER'****************************************************************GOSTER:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      NextRETURN'****************************************************************GOSTER2:yazi_reg=0      For W=0 To 11 gosub yazi1 : yazi_reg=yazi_reg+1gosub data_al      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1RETURN'****************************************************************yazi:LookUp yazi_reg,[" ELEKTRONiK "],harf_regReturn'****************************************************************yazi1:if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_regif rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_regif rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_regif rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_regif rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_regif rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_regif rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_regReturn'****************************************************************sola_kay:         if portc.4=1 then goto saat_goster1 For I=0 To 94    sutun[i]= sutun[i+1]    If i=95 Then sutun[95]=sutun[0] Next ipauseus 10000return'****************************************************************saga_kay:           if portc.4=1 then goto saat_goster1 For I=94 to 0 step -1    sutun[i]= sutun[i-1]    If i=0 Then sutun[0]=sutun[95] Next i pauseus 10000return'****************************************************************asagi_kay:         if portc.4=1 then goto saat_goster1for I=0 to 95   ARA=SUTUN[I]    z=ARA.7FOR X=7 to 1 STEP -1   ARA.0[x]=ARA.0[X-1] NEXT   ara.0=Z   sutun[I]=ARAnext pauseus 10000Return'****************************************************************yukari_kay:           if portc.4=1 then goto saat_goster1FOR I=0 to 95   ARA=SUTUN[I]   z=ARA.0FOR X=0 to 6   ARA.0[X]=ARA.0[X+1]NEXT   ARA.7=Z   SUTUN[I]=ARANEXTpauseus 10000 Return'**************************************************************** '****************************************************************  '***Sensör_Oku***************************************************SENSOROKU:            OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini okuBekle:'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.           GOSUB   Hesapla           RETURN'****************************************************************           SENSORYAZ:          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]          return           '****************************************************************             Hesapla:                 ' Ham değerden Santigrat derece hesabı    Sign  = "+"    IF SIGN_BITI = NEGAT_ISI THEN       Sign   = "-"         ham=($ffff-ham)+1     endif    ISI = Ham*10/16GEC:    FLOAT = (ISI //10)    ISI=ISI/10    RETURN                      '****************************************************************'****************************************************************'***********Zaman Oku***********ZAMAN_OKU:         High RTC_RST         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]          Low RTC_RST         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI           MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI         MEM=rtchour : GoSub CEVIR:rtchour=SAYI         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI                 Return'***********Zaman Yaz***********ZAMAN_YAZ:    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI           High  RTC_RST     SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]    Low RTC_RST:pause 1     High RTC_RST              SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ    Low RTC_RST     pause 10Return '***********Çevir***********               CEVIR:    ONLAR=MEM & %01110000    ONLAR=ONLAR>>4    BIRLER=MEM & %00001111    SAYI=ONLAR*10+BIRLERRETURN  '***********Ters Çevir***********TERSCEVIR:                    ONLAR=MEM DIG 1    ONLAR=ONLAR<<4    BIRLER=MEM DIG 0    SAYI=ONLAR+BIRLERRETURN    '****************************************************************   data_al:Select Case harf_regi=0if w=1  then  I=I+8  if w=2  then  I=i+16if w=3  then  I=i+24if w=4  then  I=i+32if w=5  then  I=i+40if w=6  then  I=i+48if w=7  then  I=i+56if w=8  then  I=i+64if w=9  then  I=i+72if w=10 then  I=i+80if w=11 then  I=i+88if w=12 then  I=i+96if w=13 then  I=i+104if w=14 then  I=i+112if w=15 then  I=i+120'''''''''''''''''''Case "A"for t=0 to 7 lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "B"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "D"for t=0 to 7 lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "E"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "F"for t=0 to 7 lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "G"for t=0 to 7 lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "H"for t=0 to 7 lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "I"for t=0 to 7 lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "i"for t=0 to 7 lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case "J"for t=0 to 7 lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "K"for t=0 to 7 lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "L"for t=0 to 7 lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''                       Case "M"for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "N"  for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "O"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "P"for t=0 to 7 lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "R"for t=0 to 7 lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "S"for t=0 to 7 lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "T"for t=0 to 7 lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "U"                               for t=0 to 7 lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "V"  for t=0 to 7 lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Y"for t=0 to 7 lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Z"for t=0 to 7 lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''End SelectReturn'**************************************************************** data_al2:Select Case RAKAMi=0'SICAKLIK'''''''''''if A=0  then  i=i+48if A=1  THEN  I=I+56if A=2  THEN  I=I+64if A=3  THEN  I=I+72if A=4  THEN  I=i+80if A=5  THEN  I=i+88if A=6  THEN  I=I+96if A=7  THEN  I=I+104if A=8  THEN  I=I+112if A=9  THEN  I=I+120if A=10 THEN  I=I+40if A=11 THEN  I=I+32'SAAT'''''''''''''''if w=0  then  I=I+(-16)if w=1  then  I=i+(-8)if w=2  then  I=i+16if w=3  then  I=i+8if w=4  then  I=i+16if w=5  then  I=i+40if w=6  then  I=i+32if w=7  then  I=i+40if w=8  then  I=i+(-24)if w=9  then  I=i+(-32)if w=10 then  I=i+48if w=11 then  I=i+56'TARIH''''''''''''if B=0  then  I=I+(-16)if B=1  then  I=i+(-8)if B=2  then  I=i+(-32)if B=3  then  I=i+8if B=4  then  I=i+16if B=5  then  I=i+(-8)if B=6  then  I=i+32if B=7  then  I=I+40if B=8  then  I=i+48if B=9  then  I=i+56if B=10 then  I=i+(-24)if B=11 then  I=I+(-32)'''''''''''''''''''Case 0for t=0 to 7 lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 1for t=0 to 7 lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 2for t=0 to 7 lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 3for t=0 to 7 lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 4for t=0 to 7 lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 5for t=0 to 7 lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 6for t=0 to 7 lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 7for t=0 to 7 lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 8for t=0 to 7 lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 9for t=0 to 7 lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case ":"I=i+ -16     for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "/"I=i+32for t=0 to 7 lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case 223   ' Derece işaretifor t=0 to 7 lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return''''''''''''''''''' case "-"   for t=0 to 7 lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''    Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return    End SelectReturnEnd

askin

Meyer  Arkadaşım ;
Her ne kadar bu projeye katkıda bulunamıyorsam da çalışmalarını günbegün yakından
takip ediyorum. Hazıra konmak hoş birşey değil fakat yurtdışında olmam sebebiyle size
ancak manevi destek olabilirim, yoksa bu proje hep üzerinde çalışmak istediğim ama
ama fırsat bulamadığım bir projedir.

İyi çalışmalar.

meyer

  İyi akşamlar askin hocam,
İlgin ve desteğin için teşekkür ederim..Umarım bu projeyi daha da geliştirebiliriz..

ete

#39
Meyer,

programa artık sigorta ayarlarınıda eklesen fena olmayacak.

'    device, 18F452asm     __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H    __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H    __CONFIG _CONFIG3H, _CCP2MX_ON_3H    __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L    __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L    __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H    __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L    __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H    __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L    __CONFIG _CONFIG7H, _EBTRB_OFF_7H endasm


Ayrıca dizi değişkeni tanımlama kısmında 96 sütunluk bir matrix oluşturduğuna göre ;
SUTUN VAR BYTE[8] şeklindeki tanımlama yanlış olacaktır. 8 yerine 96 yazman gerekiyor.
İlk satırlarda kullandığın komutlara bir bak istersen;
'SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_........
Köşeli parantez içindeki değerleri 8 rakamını hayli aşıyor!!!!. Bu nedenle tanımlaman doğru olmalıdır.

Program derlenme sonucunda bir "Argument out of range : least significant bits used" şeklinde bir ikaz veriyor.
Bunun sebebi bir yerlerde rakamlardan yada değişkenlerden birisinin negatif değer almasıdır.
Biraz araştırdım ve buldum.
Aşağıdaki satırlara dikkat et;

Case ":"I=i+ -16     for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT

Burada yer alan I=I+  -16 ifadesi ne anlama geliyor sence?
I değeri sırası gelen sütun hesabı için tutmuşsun ama yazmış olduğun ifade yanlış. İki aritmetik işareti yan yana gelmez. Ama program bunu hata olarak görmüyor ve I ile -16 yı toplamaya çalışıyor. SOnuçş eksi çıkıyor.
Muhtemelen o ifade I=I+16 olacaktır. O kısmınıda düzelt. Bu kusur bir kaç satırda daha mevcut. Onlarıda düzeltmen gerekiyor.

Programın yükü bayağı arttı. Simulasyonda güzel izlenemiyor artk. Hızlı bir makinada ne olur tam bilemiyorum.
Ama benimde programa hakimiyetim kayboldu. Epeyce ilaveler yaptın çünki. Hızı artırırsak ne olur diye bir iki deneme yaptım. Biliyorsun 18F452 de birde PLL özelliği mevcut. 10 Mhz lik kristal ile 40 Mhz çalışabiliyor. Bunu simulasyonda denedim ama değişen bir şey olmadığı gibi görüntü dahada bozuldu sanki. Bilginin displayde kalma süresini epeyce artırmama rağmen net bir görünürlük yakalayamadım. Sonra yeniden 20 Mhz frekansa döndürdüm.
Denemek istersen sigorta ayarlarındaki ilk satırı;
    __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H
şeklinde değiştir. ve ayrıca
Define OSC 40 olarak düzenle.

KOlay Gelsin
Ete
 

meyer

#40
   İyi günler Ete Hocam,
-Öncelikle programın eksik yönlerini bana gösterdiğiniz için size çok teşekkür ederim..
-Programa sigorta ayarlarını eklediğim zaman şu hataları alıyorum hocam ;
[error 118] c:\ pbp............. \deneme1.asm 131 : Overwriting previous address contents (0000) [error 118] c:\ pbp............. \deneme1.asm 131 : Overwriting previous address contents (0001)  ..........  .......... [error 118] c:\ pbp............. \deneme1.asm 131 : Overwriting previous address contents (0007)


- Sutun var byte [96] şeklinde düzelttim hocam onuda..

- Hocam; I=I+(-16) şeklinde yazmamın nedeni yok..Tamamen displaylerde görmek istediğim değerleri,görmek istediğim yerlere ayarlamak istedim..Mantık olarak çok saçma geliyor ama bu şekilde I değişkeninin değerini  ayarladığımızda istediğim yerlerde istediğim işaretler beliriyor..Bende sizdeki gibi bir hata vermediği için üzerine düşmemiştim hocam,sanıyorum ayarlarla ile alakalı..Bu sorunu da düzeltmeye çalışırım..
Case ":"I=i+ -16     for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT


- Hocam program simülasyonda güzel izlenemiyor demişsiniz..Saat,tarih,sıcaklık ve gün bilgisini ekrana basarkende mi aynı sorun var yoksa sadece "ELEKTRONIK" yazısı kayarken mi o sıkıntıyı yaşıyorsunuz ?

-40MHz ayarını da yapamadım hocam.Sigorta ayarlarını programa dahil ettiğimde yukarıdaki gibi hatalar alıyorum...

'****************************************************************'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *'*  Author  : [HAKAN_ÖZKAN]                                     *'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *'*          : All Rights Reserved                               *'*  Date    : 23.12.2011                                        *'*  Version : 1.0                                               *'*  Notes   :                                                   *'*          :                                                   *'****************************************************************define OSC 20'****************************************************************asm     __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H    __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H    __CONFIG _CONFIG3H, _CCP2MX_ON_3H    __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L    __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L    __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H    __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L    __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H    __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L    __CONFIG _CONFIG7H, _EBTRB_OFF_7H endasm'****************************************************************TRISB=0 : TRISD=0  : TRISC=31  : TRISE=0 : TRISA=0PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0INTCON2.7=0'74HC595*********************************************************Symbol CLK1     =PORTB.0Symbol DTA1     =PORTB.1Symbol STROBE1  =PORTB.2'DS18B20*********************************************************SYMBOL COMM_PIN =PORTB.3'DS1302**********************************************************symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlarsymbol  RTC_SCLK=PORTB.6symbol  RTC_DTA =PORTB.7'****************************************************************NEGAT_ISI CON 1                  ' Negatif_Cold = 1'****************************************************************TUS         VAR BYTET           VAR ByteHAM         VAR WORDISI         var WORDrtcsec      VAR BYTE rtcmin      VAR BYTE rtchour     VAR BYTErtcyear     VAR BYTE rtcmonth    VAR BYTE rtcday      VAR BYTE rtcdate     VAR BYTE TEMP        VAR BYTE VERI        VAR BYTE SAYI        VAR BYTE  SIGN        VAR BYTEFLOAT       var BYTEmem         var byteBIRLER      VAR BYTEONLAR       VAR BYTESIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık'****************************************************************SUTUN     var Byte[96]    ' 1497 adet byte tipinde değişken tanımlanabilir.RAKAM     VAR BYTEARA       VAR BYTEI         var ByteX         var ByteW         var ByteM         var WORD'''''''''''''''''''yazi_reg  var byteharf_reg  var bytez         var bytey         var byte  A         VAR BYTEB         VAR BYTEC         VAR BYTEu         var bit'****************************************************************gosub SENSORYAZGOSUB SENSOROKU'gosub ZAMAN_OKULow RTC_RST              ' RTC yi resetleLow RTC_SCLK '****************************************************************clearpause 250'****************************************************************BASLA:yazi_reg=0      For W=0 To 11gosub yazi : yazi_Reg=yazi_reg+1gosub data_alaa:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1        if portc.4=1 then goto saat_goster1M=M+1If M<96                Then gosub sola_kay   : goto aa  If M>96   and m<192    Then gosub saga_kay   : goto aa If M>192  and m<201    Then gosub asagi_kay  : goto aa if m>201  and m<210    then gosub yukari_kay : goto aa If m>210  then m=0 goto saat_gostergoto basla '**************************************************************** GECIKME:FOR VERI=0 TO 1500PAUSEUS 1000NEXT RETURN'****************************************************************  kontrol:if rtchour=24  then rtchour=0    : rtcdate=rtcdate+1 : rtcday=rtcday+1 if rtcmin=60   then rtcmin=0  if rtchour=255 then rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1 if rtcmin=255  then rtcmin=59gosub zaman_yazgosub gecikmegosub zaman_oku'if u=2 then u=0return'**************************************************************** saat_goster1:GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11 '''''''''''''''''''''    if portc.0=1         then u=u+1             : gosub kontrol  if u=0 and portc.1=1 then rtchour=rtchour+1 :gosub kontrol   if u=0 and portc.2=1 then rtchour=rtchour-1 :gosub kontrol if u=1 and portc.1=1 then rtcmin=rtcmin+1   :gosub kontrol if u=1 and portc.2=1 then rtcmin=rtcmin-1   :gosub kontrol '''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0         if portc.4=1 then goto BASLAgoto SAAT_GOSTER1 '**************************************************************** saat_goster:C=C+1    iF C=20 THEN C=0:  GOTO ISI_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''    'if portc.0=1 then u=u+1   : gosub kontrol  'if u=0 and portc.1=1 then rtchour=rtchour+1 :gosub kontrol   'if u=0 and portc.2=1 then rtchour=rtchour-1 :gosub kontrol 'if u=1 and portc.1=1 then rtcmin=rtcmin+1   :gosub kontrol 'if u=1 and portc.2=1 then rtcmin=rtcmin-1   :gosub kontrol '''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0 goto SAAT_GOSTER '****************************************************************ISI_GOSTER:C=C+1    iF C=20 THEN C=0:  GOTO TARIH_GOSTER'''''''''''''''''''''GOSUB SENSOROKUFOR A=0 TO 11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''if a=0 thenRAKAM=ISI DIG 1GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=1 then RAKAM=ISI DIG 0GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=2 then rakam=223gosub data_al2gosub gosterendif'''''''''''''''if a=3 then rakam="C"gosub data_al2gosub gosterendif'''''''''''''''if sign="-" thenif A=10 then RAKAM="-"  GOSUB DATA_AL2 gosub GOSTERendifendif'''''''''''''''if sign="+" then if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTER endifendif'''''''''''''''''''''NEXTA=0 GOTO ISI_GOSTER'****************************************************************TARIH_GOSTER:C=C+1    iF C=15 THEN C=0:  GOTO GUN_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR B=0 TO  11           if portc.4=1 then goto saat_goster1'''''''''''''''''''''if B=0 then RAKAM=rtcDAte DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if B=1 then RAKAM=RTCdate DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=2 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=3 then RAKAM=RTCmonth  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=4 then RAKAM=RTCMonth  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=5 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=6 then RAKAM=RTCyear  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=7 then RAKAM=RTCyear  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=8  OR B=9 OR B=10 OR B=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXTB=0goto TARIH_GOSTER '****************************************************************GUN_GOSTER:         if portc.4=1 then goto saat_goster1C=C+1    iF C=5 THEN C=0:  GOTO BASLA'''''''''''''''''''''GOSUB ZAMAN_OKUgosub yazi1GOSUB GOSTER2goto GUN_GOSTER'****************************************************************GOSTER:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      NextRETURN'****************************************************************GOSTER2:yazi_reg=0      For W=0 To 11 gosub yazi1 : yazi_reg=yazi_reg+1gosub data_al      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1RETURN'****************************************************************yazi:LookUp yazi_reg,[" ELEKTRONiK "],harf_regReturn'****************************************************************yazi1:if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_regif rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_regif rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_regif rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_regif rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_regif rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_regif rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_regReturn'****************************************************************sola_kay:         if portc.4=1 then goto saat_goster1 For I=0 To 94    sutun[i]= sutun[i+1]    If i=95 Then sutun[95]=sutun[0] Next ipauseus 10000return'****************************************************************saga_kay:           if portc.4=1 then goto saat_goster1 For I=94 to 0 step -1    sutun[i]= sutun[i-1]    If i=0 Then sutun[0]=sutun[95] Next i pauseus 10000return'****************************************************************asagi_kay:         if portc.4=1 then goto saat_goster1for I=0 to 95   ARA=SUTUN[I]    z=ARA.7FOR X=7 to 1 STEP -1   ARA.0[x]=ARA.0[X-1] NEXT   ara.0=Z   sutun[I]=ARAnext pauseus 10000Return'****************************************************************yukari_kay:           if portc.4=1 then goto saat_goster1FOR I=0 to 95   ARA=SUTUN[I]   z=ARA.0FOR X=0 to 6   ARA.0[X]=ARA.0[X+1]NEXT   ARA.7=Z   SUTUN[I]=ARANEXTpauseus 10000 Return'**************************************************************** '****************************************************************  '***Sensör_Oku***************************************************SENSOROKU:            OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini okuBekle:'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.           GOSUB   Hesapla           RETURN'****************************************************************           SENSORYAZ:          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]          return           '****************************************************************             Hesapla:                 ' Ham değerden Santigrat derece hesabı    Sign  = "+"    IF SIGN_BITI = NEGAT_ISI THEN       Sign   = "-"         ham=($ffff-ham)+1     endif    ISI = Ham*10/16GEC:    FLOAT = (ISI //10)    ISI=ISI/10    RETURN                      '****************************************************************'****************************************************************'***********Zaman Oku***********ZAMAN_OKU:         High RTC_RST         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]          Low RTC_RST         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI           MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI         MEM=rtchour : GoSub CEVIR:rtchour=SAYI         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI                 Return'***********Zaman Yaz***********ZAMAN_YAZ:    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI           High  RTC_RST     SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]    Low RTC_RST:pause 1     High RTC_RST              SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ    Low RTC_RST     pause 10Return '***********Çevir***********               CEVIR:    ONLAR=MEM & %01110000    ONLAR=ONLAR>>4    BIRLER=MEM & %00001111    SAYI=ONLAR*10+BIRLERRETURN  '***********Ters Çevir***********TERSCEVIR:                    ONLAR=MEM DIG 1    ONLAR=ONLAR<<4    BIRLER=MEM DIG 0    SAYI=ONLAR+BIRLERRETURN    '****************************************************************   data_al:Select Case harf_regi=0if w=1  then  I=I+8  if w=2  then  I=i+16if w=3  then  I=i+24if w=4  then  I=i+32if w=5  then  I=i+40if w=6  then  I=i+48if w=7  then  I=i+56if w=8  then  I=i+64if w=9  then  I=i+72if w=10 then  I=i+80if w=11 then  I=i+88if w=12 then  I=i+96if w=13 then  I=i+104if w=14 then  I=i+112if w=15 then  I=i+120'''''''''''''''''''Case "A"for t=0 to 7 lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "B"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "D"for t=0 to 7 lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "E"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "F"for t=0 to 7 lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "G"for t=0 to 7 lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "H"for t=0 to 7 lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "I"for t=0 to 7 lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "i"for t=0 to 7 lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case "J"for t=0 to 7 lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "K"for t=0 to 7 lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "L"for t=0 to 7 lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''                       Case "M"for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "N"  for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "O"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "P"for t=0 to 7 lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "R"for t=0 to 7 lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "S"for t=0 to 7 lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "T"for t=0 to 7 lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "U"                               for t=0 to 7 lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "V"  for t=0 to 7 lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Y"for t=0 to 7 lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Z"for t=0 to 7 lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "."for t=0 to 7 lookup t,[$FF,$FF,$FF,$CF,$CF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Q"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$AE,$9E,$81,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "W"for t=0 to 7 lookup t,[$FF,$80,$DF,$EF,$EF,$DF,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case ":"    for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "/"for t=0 to 7 lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "$"for t=0 to 7 lookup t,[$FF,$D9,$B6,$80,$80,$B6,$CD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''End SelectReturn'**************************************************************** data_al2:Select Case RAKAMi=0'SICAKLIK'''''''''''if A=0  then  i=i+48if A=1  THEN  I=I+56if A=2  THEN  I=I+64if A=3  THEN  I=I+72if A=4  THEN  I=i+80if A=5  THEN  I=i+88if A=6  THEN  I=I+96if A=7  THEN  I=I+104if A=8  THEN  I=I+112if A=9  THEN  I=I+120if A=10 THEN  I=I+40if A=11 THEN  I=I+32'SAAT'''''''''''''''if w=0  then  I=I+(-16)if w=1  then  I=i+(-8)if w=2  then  I=i+16if w=3  then  I=i+8if w=4  then  I=i+16if w=5  then  I=i+40if w=6  then  I=i+32if w=7  then  I=i+40if w=8  then  I=i+(-24)if w=9  then  I=i+(-32)if w=10 then  I=i+48if w=11 then  I=i+56'TARIH''''''''''''if B=0  then  I=I+(-16)if B=1  then  I=i+(-8)if B=2  then  I=i+(-32)if B=3  then  I=i+8if B=4  then  I=i+16if B=5  then  I=i+(-8)if B=6  then  I=i+32if B=7  then  I=I+40if B=8  then  I=i+48if B=9  then  I=i+56if B=10 then  I=i+(-24)if B=11 then  I=I+(-32)'''''''''''''''''''Case 0for t=0 to 7 lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 1for t=0 to 7 lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 2for t=0 to 7 lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 3for t=0 to 7 lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 4for t=0 to 7 lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 5for t=0 to 7 lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 6for t=0 to 7 lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 7for t=0 to 7 lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 8for t=0 to 7 lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 9for t=0 to 7 lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case ":"I=i+(-16)     for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "/"I=i+32for t=0 to 7 lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case 223   ' Derece işaretifor t=0 to 7 lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return''''''''''''''''''' case "-"   for t=0 to 7 lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''    Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return    End SelectReturnEnd



ete

18F serisi biliyorsun MPASM ile derleniyor.
Bu derlemede hem PBP2xx klasöründe yer alan 18F452.INC dosyası hemde MPASM klasöründe yer alan P18F452.INC dosyası kullanılıyor.
Şayet her iki dosyada da sigorta ayar satırları olur ise iki defa aynı komut işlendiği için sistem hata veriyor.
Bunu gidermenin yolu şu, MCS içinde PBP2xx klasöründe yer alan 18F452.INC dosyasını aç (notepad ile de açabilirsin)
altta yer alan 3 adet __CONFIG şeklinde başlayan satır var. Bu satırların başına noktalı virgül koyarak satırları kapat ve dosyayı geriye kayıt et.
Sonra yeniden derleme yap o hatalar ortadan kalkacaktır.
I=I+ -16 satırına gelince asıl sorun I değerini en yukarıda I=0 olarak ayarlamış olman ve sonra I=I+-16 şeklinde verdiğin komut ile I değerinin eksi değere düşüyor olmasıdır. Bu nedenle onları bir şekilde doğru konuma getirmelisin. Benzer diğer satırlarıda düzeltmen gerekir.

Kayma olayının güzel görünmemesi olayı ELEKTRONIK yazısına bakarak söylüyorum. Saat ve sıcaklığı beklemedim hiç.
Onlarda aynı şekildedir diye düşünmüştüm.

Kolay Gelsin
Ete


meyer

-Sigorta ayarlarını  ekleyebildim hocam..Dediğiniz gibi yaptım ve sorun ortadan kalktı..

-I=I+(-16) sorununu da en kısa sürede çözmeye çalışacağım hocam..

İyi günler dilerim...

meyer

#43
 Sorunu düzelttim hocam..

'****************************************************************'*  Name    : MATRIX_PANO_SAAT_ISI_TARIH_GUN_KAYAN_YAZI.BAS     *'*  Author  : [HAKAN_ÖZKAN]                                     *'*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *'*          : All Rights Reserved                               *'*  Date    : 28.12.2011                                        *'*  Version : 1.0                                               *'*  Notes   :                                                   *'*          :                                                   *'****************************************************************define OSC 20'****************************************************************asm     __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H    __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H    __CONFIG _CONFIG3H, _CCP2MX_ON_3H    __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L    __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L    __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H    __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L    __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H    __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L    __CONFIG _CONFIG7H, _EBTRB_OFF_7H endasm'****************************************************************TRISB=0 : TRISD=0  : TRISC=31  : TRISE=0 : TRISA=0PORTB=0 : PORTD=0  : PORTC=0   : PORTE=0 : PORTA=0INTCON2.7=0'74HC595*********************************************************Symbol CLK1     =PORTB.0Symbol DTA1     =PORTB.1Symbol STROBE1  =PORTB.2'DS18B20*********************************************************SYMBOL COMM_PIN =PORTB.3'DS1302**********************************************************symbol  RTC_RST =PORTB.5         'RTC nin bağlandığı portlarsymbol  RTC_SCLK=PORTB.6symbol  RTC_DTA =PORTB.7'****************************************************************NEGAT_ISI CON 1                  ' Negatif_Cold = 1'****************************************************************TUS         VAR BYTET           VAR ByteHAM         VAR WORDISI         var WORDrtcsec      VAR BYTE rtcmin      VAR BYTE rtchour     VAR BYTErtcyear     VAR BYTE rtcmonth    VAR BYTE rtcday      VAR BYTE rtcdate     VAR BYTE TEMP        VAR BYTE VERI        VAR BYTE SAYI        VAR BYTE  SIGN        VAR BYTEFLOAT       var BYTEmem         var byteBIRLER      VAR BYTEONLAR       VAR BYTESIGN_BITI VAR HAM.Bit11   '   +/- sıcaklık İşaret biti,  1 = olursa eksi sıcaklık'****************************************************************SUTUN     var Byte[96]    ' 1497 adet byte tipinde değişken tanımlanabilir.RAKAM     VAR BYTEARA       VAR BYTEI         var ByteX         var ByteW         var ByteM         var byte'''''''''''''''''''yazi_reg  var byteharf_reg  var bytez         var bytey         var byte  A         VAR BYTEB         VAR BYTEC         VAR BYTED         VAR BYTEu         var bit'****************************************************************gosub SENSORYAZGOSUB SENSOROKU'gosub ZAMAN_OKULow RTC_RST              ' RTC yi resetleLow RTC_SCLK '****************************************************************clearpause 250'****************************************************************BASLA:yazi_reg=0      For W=0 To 11gosub yazi : yazi_Reg=yazi_reg+1gosub data_alaa:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1        if portc.4=1 then goto saat_goster1M=M+1If M<96                Then gosub sola_kay   : goto aa  If M>96   and m<192    Then gosub saga_kay   : goto aa If M>192  and m<201    Then gosub asagi_kay  : goto aa if m>201  and m<210    then gosub yukari_kay : goto aa If m>210  then m=0 goto saat_gostergoto basla '**************************************************************** GECIKME:FOR VERI=0 TO 1500PAUSEUS 1000NEXT RETURN'****************************************************************  kontrol:if rtchour=24  then rtchour=0    : rtcdate=rtcdate+1 : rtcday=rtcday+1 if rtcmin=60   then rtcmin=0  if rtchour=255 then rtchour=23 : rtcdate=rtcdate-1 : rtcday=rtcday-1 if rtcmin=255  then rtcmin=59gosub zaman_yazgosub gecikmegosub zaman_oku'if u=2 then u=0return'**************************************************************** saat_goster1:D=1GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11 '''''''''''''''''''''    if portc.0=1         then u=u+1             : gosub kontrol  if u=0 and portc.1=1 then rtchour=rtchour+1 :gosub kontrol   if u=0 and portc.2=1 then rtchour=rtchour-1 :gosub kontrol if u=1 and portc.1=1 then rtcmin=rtcmin+1   :gosub kontrol if u=1 and portc.2=1 then rtcmin=rtcmin-1   :gosub kontrol '''''''''''''''''''''if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0         if portc.4=1 then goto BASLAgoto SAAT_GOSTER1 '**************************************************************** saat_goster:D=1C=C+1    iF C=20 THEN C=0:  GOTO ISI_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR W=0 TO  11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''    if W=0 then RAKAM=rtchour DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if W=1 then RAKAM=RTCHOUR DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=2 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=3 then RAKAM=RTCmin  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=4 then RAKAM=RTCMiN  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=5 then rakam=":" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if W=6 then RAKAM=RTCsec  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if W=7 then RAKAM=RTCsec  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if W=8 OR W=9 OR W=10 OR W=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXT W=0 goto SAAT_GOSTER '****************************************************************ISI_GOSTER:D=2C=C+1    iF C=20 THEN C=0:  GOTO TARIH_GOSTER'''''''''''''''''''''GOSUB SENSOROKUFOR A=0 TO 11     if portc.4=1 then goto saat_goster1'''''''''''''''''''''if a=0 thenRAKAM=ISI DIG 1GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=1 then RAKAM=ISI DIG 0GOSUB DATA_AL2GOSUB GOSTERendif'''''''''''''''''''''if a=2 then rakam=223gosub data_al2gosub gosterendif'''''''''''''''if a=3 then rakam="C"gosub data_al2gosub gosterendif'''''''''''''''if sign="-" thenif A=10 then RAKAM="-"  GOSUB DATA_AL2 gosub GOSTERendifendif'''''''''''''''if sign="+" then if A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTER endifendif'''''''''''''''''''''NEXTA=0 GOTO ISI_GOSTER'****************************************************************TARIH_GOSTER:D=3C=C+1    iF C=15 THEN C=0:  GOTO GUN_GOSTER'''''''''''''''''''''GOSUB ZAMAN_OKU'''''''''''''''''''''    FOR B=0 TO  11           if portc.4=1 then goto saat_goster1'''''''''''''''''''''if B=0 then RAKAM=rtcDAte DiG 1  GOSUB DATA_AL2 gosub GOSTER  endif'''''''''''''''''''''if B=1 then RAKAM=RTCdate DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=2 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=3 then RAKAM=RTCmonth  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=4 then RAKAM=RTCMonth  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=5 then rakam="/" gosub data_al2 gosub goster ENDIF'''''''''''''''''''''if B=6 then RAKAM=RTCyear  DiG 1  GOSUB data_al2 gosub GOSTERendif'''''''''''''''''''''if B=7 then RAKAM=RTCyear  DiG 0  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''if B=8  OR B=9 OR B=10 OR B=11 then RAKAM=" "  GOSUB DATA_AL2 gosub GOSTERendif'''''''''''''''''''''    NEXTB=0goto TARIH_GOSTER '****************************************************************GUN_GOSTER:         if portc.4=1 then goto saat_goster1C=C+1    iF C=5 THEN C=0:  GOTO BASLA'''''''''''''''''''''GOSUB ZAMAN_OKUgosub yazi1GOSUB GOSTER2goto GUN_GOSTER'****************************************************************GOSTER:      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      NextRETURN'****************************************************************GOSTER2:yazi_reg=0      For W=0 To 11 gosub yazi1 : yazi_reg=yazi_reg+1gosub data_al      X=1      For I=0 To 7SHiftOut DTA1,CLK1,1,[SUTUN[I+88],SUTUN[I+80],SUTUN[I+72],_ SUTUN[I+64],SUTUN[I+56],SUTUN[I+48],SUTUN[I+40],_  SUTUN[I+32],SUTUN[I+24],SUTUN[I+16],SUTUN[I+8],SUTUN[I]]        PORTD=X        High STROBE1 : pauseus 200 : Low STROBE1         X=X*2        pause 3      Next     Next    pause 1RETURN'****************************************************************yazi:LookUp yazi_reg,[" ELEKTRONiK "],harf_regReturn'****************************************************************yazi1:if rtcday=1 then LookUp yazi_reg,["   PAZAR    "],harf_regif rtcday=2 then LookUp yazi_reg,[" PAZARTESi  "],harf_regif rtcday=3 then LookUp yazi_reg,["    SALI    "],harf_regif rtcday=4 then LookUp yazi_reg,["  CARSAMBA  "],harf_regif rtcday=5 then LookUp yazi_reg,["  PERSEMBE  "],harf_regif rtcday=6 then LookUp yazi_reg,["    CUMA    "],harf_regif rtcday=7 then LookUp yazi_reg,[" CUMARTESi  "],harf_regReturn'****************************************************************sola_kay:         if portc.4=1 then goto saat_goster1 For I=0 To 94    sutun[i]= sutun[i+1]    If i=95 Then sutun[95]=sutun[0] Next ipauseus 10000return'****************************************************************saga_kay:           if portc.4=1 then goto saat_goster1 For I=94 to 0 step -1    sutun[i]= sutun[i-1]    If i=0 Then sutun[0]=sutun[95] Next i pauseus 10000return'****************************************************************asagi_kay:         if portc.4=1 then goto saat_goster1for I=0 to 95   ARA=SUTUN[I]    z=ARA.7FOR X=7 to 1 STEP -1   ARA.0[x]=ARA.0[X-1] NEXT   ara.0=Z   sutun[I]=ARAnext pauseus 10000Return'****************************************************************yukari_kay:           if portc.4=1 then goto saat_goster1FOR I=0 to 95   ARA=SUTUN[I]   z=ARA.0FOR X=0 to 6   ARA.0[X]=ARA.0[X+1]NEXT   ARA.7=Z   SUTUN[I]=ARANEXTpauseus 10000 Return'**************************************************************** '****************************************************************  '***Sensör_Oku***************************************************SENSOROKU:            OWOUT   Comm_Pin, 1, [$CC, $44]' ISI değerini okuBekle:'           OWIN    Comm_Pin, 4, [TEMP]    ' Busy değerini oku'           IF      TEMP = 0 THEN Bekle  ' hala meşgulmü? , evet ise goto Bekle..!           OWOUT   Comm_Pin, 1, [$CC, $BE]' scratchpad memory oku           OWIN    Comm_Pin, 2, [HAM.Lowbyte, HAM.Highbyte]' İki byte oku ve okumayı bitir.           GOSUB   Hesapla           RETURN'****************************************************************           SENSORYAZ:          OWOUT   COMM_Pin, 1, [$CC, $4E, $00,$00,$31]          return           '****************************************************************             Hesapla:                 ' Ham değerden Santigrat derece hesabı    Sign  = "+"    IF SIGN_BITI = NEGAT_ISI THEN       Sign   = "-"         ham=($ffff-ham)+1     endif    ISI = Ham*10/16GEC:    FLOAT = (ISI //10)    ISI=ISI/10    RETURN                      '****************************************************************'****************************************************************'***********Zaman Oku***********ZAMAN_OKU:         High RTC_RST         SHiftOut RTC_DTA, RTC_SCLK, 0, [$BF]         SHiftIn RTC_DTA, RTC_SCLK, 1, [rtcsec, rtcmin, rtchour,rtcdate , rtcmonth,rtcday,rtcyear, MEM]          Low RTC_RST         MEM=rtcsec  : GoSub CEVIR:rtcsec=SAYI           MEM=rtcmin  : GoSub CEVIR:rtcmin=SAYI         MEM=rtchour : GoSub CEVIR:rtchour=SAYI         MEM=rtcdate : GoSub CEVIR:rtcdate=SAYI         MEM=rtcmonth: GoSub CEVIR:rtcmonth=SAYI         MEM=rtcyear : GoSub CEVIR:rtcyear=SAYI         MEM=rtcday  : GoSub CEVIR: rtcday=SAYI                 Return'***********Zaman Yaz***********ZAMAN_YAZ:    MEM=rtcsec   : GoSub TERSCEVIR :rtcsec=SAYI    MEM=rtcmin   : GoSub TERSCEVIR :rtcmin=SAYI    MEM=rtchour  : GoSub TERSCEVIR :rtchour=SAYI    MEM=rtcdate  : GoSub TERSCEVIR :rtcdate=SAYI    MEM=rtcmonth : GoSub TERSCEVIR :rtcmonth=SAYI    MEM=rtcyear  : GoSub TERSCEVIR :rtcyear=SAYI    MEM=rtcday   : GoSub TERSCEVIR :rtcday=SAYI           High  RTC_RST     SHiftOut RTC_DTA, RTC_SCLK, 0, [$8E, 0]    Low RTC_RST:pause 1     High RTC_RST              SHiftOut  RTC_DTA, RTC_SCLK, 0, [$BE, rtcsec, rtcmin, rtchour,rtcdate , rtcmonth, rtcday, rtcyear, 0]  'YAZ    Low RTC_RST     pause 10Return '***********Çevir***********               CEVIR:    ONLAR=MEM & %01110000    ONLAR=ONLAR>>4    BIRLER=MEM & %00001111    SAYI=ONLAR*10+BIRLERRETURN  '***********Ters Çevir***********TERSCEVIR:                    ONLAR=MEM DIG 1    ONLAR=ONLAR<<4    BIRLER=MEM DIG 0    SAYI=ONLAR+BIRLERRETURN    '****************************************************************   data_al:Select Case harf_regi=0if w=1  then  I=I+8  if w=2  then  I=i+16if w=3  then  I=i+24if w=4  then  I=i+32if w=5  then  I=i+40if w=6  then  I=i+48if w=7  then  I=i+56if w=8  then  I=i+64if w=9  then  I=i+72if w=10 then  I=i+80if w=11 then  I=i+88if w=12 then  I=i+96if w=13 then  I=i+104if w=14 then  I=i+112if w=15 then  I=i+120'''''''''''''''''''Case "A"for t=0 to 7 lookup t,[$FF,$81,$F6,$F6,$F6,$F6,$81,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "B"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "D"for t=0 to 7 lookup t,[ $FF,$80,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "E"for t=0 to 7 lookup t,[$FF,$80,$B6,$B6,$B6,$B6,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "F"for t=0 to 7 lookup t,[ $FF,$80,$F6,$F6,$F6,$F6,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "G"for t=0 to 7 lookup t,[$FF,$80,$BE,$B6,$B6,$B6,$86,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "H"for t=0 to 7 lookup t,[$FF,$80,$F7,$F7,$F7,$F7,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "I"for t=0 to 7 lookup t,[$FF,$BE,$BE,$80,$80,$BE,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "i"for t=0 to 7 lookup t,[$FF,$BF,$BB,$82,$82,$BB,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case "J"for t=0 to 7 lookup t,[$FF,$CE,$BE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "K"for t=0 to 7 lookup t,[$FF,$80,$F7,$EB,$DD,$BE,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "L"for t=0 to 7 lookup t,[$FF,$80,$BF,$BF,$BF,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''                       Case "M"for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$F7,$FB,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "N"  for t=0 to 7 lookup t,[$FF,$80,$FB,$F7,$EF,$DF,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "O"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$BE,$BE,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "P"for t=0 to 7 lookup t,[$FF,$80,$F6,$F6,$F6,$F6,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "R"for t=0 to 7 lookup t,[$FF,$80,$F6,$E6,$D6,$B6,$B9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "S"for t=0 to 7 lookup t,[$FF,$D9,$B6,$B6,$B6,$B6,$CD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "T"for t=0 to 7 lookup t,[$FF,$FE,$FE,$80,$80,$FE,$FE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "U"                               for t=0 to 7 lookup t,[$FF,$C0,$BF,$BF,$BF,$BF,$C0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "V"  for t=0 to 7 lookup t,[$FF,$E0,$DF,$BF,$BF,$DF,$E0,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Y"for t=0 to 7 lookup t,[$FF,$FC,$FB,$87,$87,$FB,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Z"for t=0 to 7 lookup t,[$FF,$9E,$AE,$B6,$BA,$BC,$BE,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "."for t=0 to 7 lookup t,[$FF,$FF,$FF,$CF,$CF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "Q"for t=0 to 7 lookup t,[$FF,$C1,$BE,$BE,$AE,$9E,$81,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "W"for t=0 to 7 lookup t,[$FF,$80,$DF,$EF,$EF,$DF,$80,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case ":"    for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "/"for t=0 to 7 lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "$"for t=0 to 7 lookup t,[$FF,$D9,$B6,$80,$80,$B6,$CD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''End SelectReturn'**************************************************************** data_al2:I=0Select Case RAKAMif D=2 then 'SICAKLIK'''''''''''    if A=0  then  i=i+32    if A=1  THEN  I=I+40    if A=2  THEN  I=I+48    if A=3  THEN  I=I+56    if A=4  THEN  I=i    if A=5  THEN  I=i+8    if A=6  THEN  I=I+16    if A=7  THEN  I=I+24    if A=8  THEN  I=I+64    if A=9  THEN  I=I+72    if A=10 THEN  I=I+80    if A=11 THEN  I=I+88endifif D=1 then 'SAAT'''''''''''''''    if w=0  then  I=I+16    if w=1  then  I=i+24    if w=2  then  I=i+32    if w=3  then  I=i+40    if w=4  then  I=i+48    if w=5  then  I=i+56    if w=6  then  I=i+64    if w=7  then  I=i+72    if w=8  then  I=i    if w=9  then  I=i+8    if w=10 then  I=i+80    if w=11 then  I=i+88endifif D=3 then'TARIH''''''''''''    if B=0  then  I=I+16    if B=1  then  I=i+24    if B=2  then  I=i+32    if B=3  then  I=i+40    if B=4  then  I=i+48    if B=5  then  I=i+56    if B=6  then  I=i+64    if B=7  then  I=I+72    if B=8  then  I=i    if B=9  then  I=i+8    if B=10 then  I=I+80    if B=11 then  I=I+88'''''''''''''''''''endifCase 0for t=0 to 7 lookup t,[$FF,$C1,$80,$A6,$B2,$80,$C1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 1for t=0 to 7 lookup t,[$FF,$BF,$BD,$80,$80,$BF,$BF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 2for t=0 to 7 lookup t,[$FF,$9D,$8C,$A6,$B2,$98,$9D,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 3for t=0 to 7 lookup t,[$FF,$DD,$9C,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 4for t=0 to 7 lookup t,[$FF,$E7,$E3,$E9,$80,$80,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 5for t=0 to 7 lookup t,[$FF,$D8,$98,$BA,$BA,$82,$C6,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 6for t=0 to 7 lookup t,[$FF,$C3,$81,$B4,$B6,$86,$CF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 7for t=0 to 7 lookup t,[$FF,$FC,$FC,$8E,$86,$F0,$F8,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 8for t=0 to 7 lookup t,[$FF,$C9,$80,$B6,$B6,$80,$C9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case 9for t=0 to 7 lookup t,[$FF,$F9,$B0,$B6,$96,$C0,$E1,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case ":"   for t=0 to 7 lookup t,[$FF,$FF,$FF,$99,$99,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "/"for t=0 to 7 lookup t,[$FF,$9F,$CF,$E7,$F3,$F9,$FC,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''Case "C"for t=0 to 7 lookup t,[$FF,$C1,$80,$BE,$BE,$BE,$DD,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''case 223   ' Derece işaretifor t=0 to 7 lookup t,[$FF,$FF,$F9,$F0,$F6,$F0,$F9,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return''''''''''''''''''' case "-"   for t=0 to 7 lookup t,[$FF,$E7,$E7,$E7,$E7,$E7,$E7,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return'''''''''''''''''''    Case " "for t=0 to 7 lookup t,[$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF],Z  SUTUN[I]=Z I=I+1NEXT   Return    End SelectReturnEnd

ete

#44
Programda bazı iyileştirmeler yapılması gerekiyor.
Mesela bir satır var ;
IF A=4 OR A=5 OR A=6 OR A=7 OR A=8 OR A=9 OR A=10 OR A=11 then 
Bu satır şöyle yazabilirsin.
IF A>3 and A<12 THEN
bu şekilde yazarak bir sürü fazladan byte harcamaktan kurtulmuş olursun derleme esnasında.
Buna benzer bir kaç satır var. Daha kısa olanlarıda aynı mantık çerçevesinde yazabilirsin.

Aslında programın karekter kodlama kısmı güzel olmadı. Aynı işi defalarca yapmak zorunda kalıyorsun.
Programda bir tane karekter okuma ve okunan karekterin datalarını ilgili sütun değişkenlerine atacak bir bölüm olması gerekirdi. Sende bu sağ el ile sol kulak işaret edilerek yaptırılıyor.
Bütün karekterlerin için bir data paketin olsa. Bunu birer lookup tablosuna bağlasan.
Daha üniversal olacak ve program hem daha az zaman kaybedecek hemde daha az yer kaplayacak.
Örnekle açıklayayım.

LOOKUP X,["YAZILACAK RAKAMLAR 123456789],HARF
şeklinde bir lookup tablosu olsa ki bu tablo kullanılabileceği gibi bu kısmı epromdan okuyarakda halletmek mümkün olacaktır.
Bu tablodan x=0 iken "Y" harfinin ASC değerini HARF değişkenine yüklemiş olduk.

Daha sonra bir select case tablosundan bu harfin datalarının adres değerini alsan.
YERAL:
    select case HARF
    case 0:YERI=0:return
    case 1:YERI=16:return
    case 2:YERI=32:return
    case 3:YERI=48:return
    case 4:YERI=64:return
    case 5:YERI=80:return
    case 6:YERI=96:return
    case 7:YERI=112:return
    case 8:YERI=128:return   
    case 9:YERI=144:return
...
    CASE 85:YERI=215:RETURN
END SELECT
RETURN

Buradan aldığım adres değeri Y harfine ait sütun datalarının başlangıç adresini oluşturacaktır. Bu da diyelimki 215 olsun

Şimdi harf datalarınında bir başka lookup tablsounda yer aldığını düşünelim. Mesela
HARFLER:
lookup YERI,[$07,$0F,$1C,$18,$18,$18,$18,$18_ '0 rakamı 0
            ,$03,$0F,$01,$01,$01,$01,$01,$01_ '1 rakamı 8
            ,$07,$0F,$1C,$18,$00,$00,$00,$00_ '2 RAKAMI 16
            ,$07,$0F,$1C,$18,$00,$00,$00,$01_ '3 RAKAMI 24
            ............
            ............
           ],VERI :RETURN 
şeklinde satırlarda bütün harfler ve rakamların sütun dataları yer alsa. Böylece bir döngü kurup gerekli dataları alıp sütun değişkenlerine yerleştirsen.
Sütun değişkenlerinin İndex değişkeni yine I olsun.
FOR Z=YERI  to (YERI+7)  şeklinde 8 adet datayı alsan ve
   SUTUN[I]=VERI
   I=I+1
NEXT
şeklinde yerlerine yerleştirsen işin hallolacaktır.

Saat ve Isı göstergelerinde anlamsız şekilde bir takım eklemeli çıkarmalı sistem kullanmışsın. Halbuki mantık şöyle olmalı.
Toplam 12 adet sütunun var. Saat göstergesi 2+1+2+1+2 =8 haneden oluşuyor. O halde 12-8=4 hane boş olacaktır. Baştan 2 hane ve sondan 2 hane boş olacaktır. O halde
For I=0 to 15
  SUTUN[I]=0
  SUTUN[I+80]=0
Next
Daha sonra  , TEMP=saat DIG 1 :GOSUB YERAL ile saat onlar hanesinin yerini belirlemiş olduk.
I değeri bunun için 16 dan başlayacaktır. Dolayısıyla I=16
For Z=YERI to YERI+7
   GOSUB HARFLER
   SUTUN[I]=VERI
   I=I+1
Next
şeklinde de ilk rakamın datalarını sütun değişkenlerine yerleştirmiş oluruz.
Ardından Temp=Saat DIG 0  Gosub Yeral
FOR Z= YERI TO YER+7
    GOSUB HARFLER
    SUTUN [I]=VERI
    I=I+1
Next şeklinde saatin işini bitirimiş oluruz. Sonra dakikaya geçeriz.
Bu şekilde saniyeyide sütun değişkenlerine aktardıktan sonra ekrana bu bilgileri verir ve sonrasında ister kaydırı ister ekranda tutarız.
Umarım dediklerimi anlamışsındır.

Ete

Powered by EzPortal