JAL İLE FREKANS GÖNDERME

Başlatan sozkarabacak, 03 Haziran 2008, 13:56:16

sozkarabacak

Arkadaşlar elimizde aşağıda örneğini göreceğiniz yazılım mevcut. Bu yazılım ile dancall marka araç telefonundan telsiz rölesi yapılabiliyor bu yazılım şu hali ile dtmf kontrollü olarak çalışmakta fakat bizim için bu yazılımdaki 3 adet frekans yeterli gelmemekte yazılım birde küçük bir sorunla çalışmakta başlama frekansı 440 küsürlerde başlamakta (kanımca binary hesaplamada bir yanlışlık var) daha sonra oradan dtmf şifreleri ile 1. kanal olan 439,425 frekansına gelebilmekte bu kanala geldiğinde -7,6 mhz shift ile çalışmakta yani kullandığımız telsizin mandalına bastığımızda bizi 431,825 ten dinleyip burdan duyduklarını 439.425 frekansından göndermektedir. Aynı mantıkla çeşitli dtmf şifreleri ile 3 ayrı kanala alınabilmektedir. Bizim Jal dilinden anlayan arkadaşlardan ricamız şu bu yazılım başlarken normal olarak 439.425 ten başlaması için nasıl bir değişiklik yapabiliriz. Birde bu yazılımı istediğimiz frekanslara göre nasıl değiştirebiliriz? Bu işin mantığını bilen arkadaşlardan yardım bekliyoruz.
elimizdeki yazılım:
include 16f84 ile  en son end loop
include 16f84_4
include jlib

-- A = 0

port_a_direction = all_input
pin_b0_direction = output
pin_b1_direction = output
pin_b2_direction = output
pin_b3_direction = output
pin_b4_direction = output
pin_b5_direction = output
pin_b6_direction = input
pin_b7_direction = output
var bit a = high -- is cos
var bit b = low
var bit c = low
var bit d = low
var bit e = high
var bit f = high
var bit g = high
var bit h = high  -- tx on off
var bit i = high  -- tx ton on off

var bit k = low  -- cor
var bit k1 = low  -- cor1
var bit k2 = low  -- cor2
var bit k3 = high  -- cor3
--
var bit b1 = low   -- bip1
var bit b2 = low   -- bip2
var bit b3 = low   -- bip3
var bit b4 = high   -- bip4
var bit b5 = low

procedure dur is
for 50 loop
var byte n
n = 160
for n  loop
assembler
nop
nop
nop
nop
nop
end assembler
end loop
end loop
end procedure

-- sifir rutini
procedure zero is
pin_b1 = low
asm nop
pin_b2 = high
pin_b2 = low
end procedure
--
-- bir rutini
procedure one is
pin_b1 = high
asm nop
pin_b2 = high
pin_b2 = low
end procedure


procedure stb is

pin_b0 = high
pin_b0 = low

end procedure
-- ----------------
procedure enable is

pin_b3 = high
pin_b3 = low

end procedure
--
procedure bekle is
var byte n
n = 16
for n  loop
assembler
nop
nop
nop
nop
nop
end assembler
end loop
end procedure


asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
-- ------------------------------------------
-- RX BOLUCU
-- ---------------------------------------------
procedure basla is
if a then
dur
dur
dur
dur
dur
dur
dur
dur
dur
dur
dur
dur
dur
pin_b1 = low
pin_b2 = low
bekle
zero
one
one
one
one
one
one
zero
zero
-- 1024 boluyor
one
zero
zero
one
enable
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
-- burası bölücü için
-- 46*20+0 = 920
-- ------------------------------------
-- TX BOLUCU
-- -------------------------------------

zero
zero
zero
one
zero
one
zero
zero
zero
one
zero
zero
-- --------------------------------------------
zero -- (one)1024'e bolucu. (zero)yukarısı aktif
zero
zero
one
stb
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
asm nop
-- burası bölücü için
-- 46*20+0 = 920
one -- A
one
one
one
one
one
zero
zero -- N
zero
zero
zero
zero
zero
zero
zero
zero
zero
one
one  -- N/A reg
zero -- N/A reg
stb
asm nop
asm nop
asm nop
asm nop
a = low
pin_b1 = low
pin_b2 = low
end if
end procedure
-- -------------------------------------
-- kanal1   (439,200)--431,600+21,3=452,900/25=binari
-- -------------------------------------
procedure kanal1 is
if b then
pin_b1 = low
pin_b2 = low
asm nop
asm nop
asm nop
-- -------------------------------------
zero -- N = 46
one -- zero
one -- zero
zero -- one
zero
zero
zero
one
one
zero
one
one
zero
-- -----------------------------------
zero -- A = 0
zero
one
zero
zero
one
zero -- N/A reg
enable
asm nop
asm nop
asm nop
asm nop
b = low
end if
end procedure
-- -------------------------------------
-- kanal2   439,250--431,650
-- -------------------------------------
procedure kanal2 is
if c then
pin_b1 = low
pin_b2 = low
asm nop
asm nop
asm nop
-- -------------------------------------
one -- zero -- N = 46
one -- zero
one -- zero
zero -- one
zero
zero
zero
one
one
zero
one
one
zero
-- -----------------------------------
zero -- A = 0
zero
one
zero
zero
one
zero -- N/A reg
enable
asm nop
asm nop
asm nop
asm nop
end if
c = low
end procedure
-- -------------------------------------
-- kanal3   439,375--431,775
-- -------------------------------------
procedure kanal3 is
if d then
pin_b1 = low
pin_b2 = low
asm nop
asm nop
asm nop
-- -------------------------------------
-- RX Modulu icin
-- -------------------------------------
one -- zero -- N = 46
one -- zero
zero
one
zero
zero
zero
one
one
zero
one
one
zero
-- -----------------------------------
zero -- A = 0
zero
one
zero
zero
one
zero -- N/A reg
enable
asm nop
asm nop
asm nop
asm nop
end if
d = low
end procedure
-- -------------------------------------
-- kana4   439,400--431,800
-- -------------------------------------
procedure kanal4 is
if e then
pin_b1 = low
pin_b2 = low
asm nop
asm nop
asm nop
-- -------------------------------------
one -- zero -- N = 46
zero
zero
zero -- one
one -- zero
zero
zero
one
one
zero
one
one
zero
-- -----------------------------------
zero -- A = 0
zero
one
zero
zero
one
zero -- N/A reg
enable
asm nop
asm nop
asm nop
asm nop
pin_b5 = low
pin_b6 = low
end if
e = low
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure ses ( byte in ton  ) is
 for 90 loop
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
procedure ses1 ( byte in ton  ) is
 for 50 loop
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
procedure ses0 ( byte in ton  ) is
 for 45 loop
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
-- -----------------------------------
procedure bekle1 ( byte in ton  ) is
 for 50 loop
 pin_b0 = low
   delay_10us ( ton )
 pin_b0 = low
   delay_10us ( ton )
 pin_b0 = low
   delay_10us ( ton )
 pin_b0 = low
   delay_10us ( ton )
 pin_b0 = low
   delay_10us ( ton )
 pin_b0 = low
   delay_10us ( ton )
end loop
end procedure


procedure cor is
if h == high then
if pin_b6 == low then
k = high
-- b = low
pin_b2 = high
pin_b4 = low
end if
end if
procedure ses is
             if b5 & b1 == high then
             b5 = low
                    end if
             if b5 & b2 == high then
             ses (25)
             b5 = low
                    end if
             if b5 & b3 == high then
             ses (25)
             ses0 (25)
             ses1 (25)
             b5 = low
                    end if
             if b5 & b4 == high then
             ses (25)
             ses0 (25)
             ses1 (25)
             ses0 (25)
             ses1 (25)
             b5 = low
                    end if
end procedure
             if pin_b6 & k & k1 == high then
             pin_b4 = high
             bekle1 (50)
             if pin_b6 & k & k1 == high then
             b5 = high
             ses
             if pin_b6 & k & k1 == high then
             bekle1 (25)
             k = low
             pin_b2 = low
             end if
             end if
             end if
                 if pin_b6 & k & k2 == high then
             pin_b4 = high
                 bekle1 (75)
                 if pin_b6 & k & k2 == high then
                 b5 = high
                 ses
                 if pin_b6 & k & k2 == high then
                 bekle1 (75)
                 if pin_b6 & k & k2 == high then
                 k = low
                 pin_b2 = low
                 end if
                 end if
                 end if
                 end if
                    if pin_b6 & k & k3 == high then
             pin_b4 = high
                    bekle1 (75)
                    if pin_b6 & k & k3 == high then
                    b5 = high
                    ses
                    if pin_b6 & k & k3 == high then
                    bekle1 (75)
                    if pin_b6 & k & k3 == high then
                    bekle1 (75)
                    if pin_b6 & k & k3 == high then
                    k = low
                    pin_b2 = low
                    end if
                    end if
                    end if
                    end if
                    end if
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure dtmfcor is
if g == high then
-- ####################
while ! pin_b6 & pin_a3 & pin_a2 & ! pin_a1 & ! pin_a0 == high loop
dur
-- 3333333333333333
while ! pin_b6 & ! pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high loop
dur
-- 00000000000000000
while ! pin_b6 & pin_a3 & ! pin_a2 & pin_a1 & ! pin_a0 == high loop
dur
-- ****************
if pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high then
g = low
pin_b2 = high
end if
end loop
end loop
end loop
end if
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure cor1 is
if g == low then
-- 2222222222222
   if ! pin_a3 & ! pin_a2 & pin_a1 & ! pin_a0 == high then
   g = high
   k1 = high
   k2 = low
   k3 = low
      else
      if ! pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high then
      g = high
      k1 = low
      k2 = high
      k3 = low
         else
         if ! pin_a3 & pin_a2 & ! pin_a1 & ! pin_a0 == high then
         g = high
         k1 = low
         k2 = low
         k3 = high
            else
            if ! pin_a3 & pin_a2 & ! pin_a1 & pin_a0 == high then
            g = high
            b1 = high
            b2 = low
            b3 = low
            b4 = low
              else
              if ! pin_a3 & pin_a2 & pin_a1 & ! pin_a0 == high then
              g = high
              b1 = low
              b2 = high
              b3 = low
              b4 = low
                else
                if ! pin_a3 & pin_a2 & pin_a1 & pin_a0 == high then
                g = high
                b1 = low
                b2 = low
                b3 = high
                b4 = low
                  else
                  if pin_a3 & ! pin_a2 & ! pin_a1 & ! pin_a0 == high then
                  g = high
                  b1 = low
                  b2 = low
                  b3 = low
                  b4 = high
end if
end if
end if
end if
end if
end if
end if
end if
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure dtmf is
if f == high then
-- ****************
while ! pin_b6 & pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high loop
dur
-- 3333333333333333
while ! pin_b6 & ! pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high loop
dur
-- 00000000000000000
while ! pin_b6 & pin_a3 & ! pin_a2 & pin_a1 & ! pin_a0 == high loop
dur
-- 1111111111111111111
while ! pin_b6 & ! pin_a3 & ! pin_a2 & ! pin_a1 & pin_a0 == high loop
dur
-- ####################
if pin_a3 & pin_a2 & ! pin_a1 & ! pin_a0 == high then
f = low
pin_b2 = high
end if
end loop
end loop
end loop
end loop
end if
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure ch is
pin_b4 = high
procedure sesu ( byte in ton  ) is
 for 60 loop
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
procedure sesk ( byte in ton  ) is
 for 30 loop
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = high
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
procedure sessiz ( byte in ton  ) is
 for 15 loop
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
 pin_b1 = low
   delay_10us ( ton )
end loop
end procedure
sessiz (100)
sessiz (100)
sessiz (100)
sessiz (100)
sesu (25)
sessiz (25)
sesk (25)
sessiz (25)
sesu (25)
sessiz (25)
sesk (25)
sessiz (25)
sessiz (25)
sessiz (25)
sesk (25)
sessiz (25)
sesk (25)
sessiz (25)
sesk (25)
sessiz (25)
sesk (25)
sessiz (25)

end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure kanal is
if f == low then
-- 1111111111111111111
if ! pin_a3 & ! pin_a2 & ! pin_a1 & pin_a0 == high then
f = high
c = high
ch
pin_b2 = low
kanal2


     else
     if ! pin_a3 & ! pin_a2 & pin_a1 & ! pin_a0 == high then
     f = high
     d = high
     ch
     pin_b2 = low
     kanal3


              else
              if ! pin_a3 & ! pin_a2 & pin_a1 & pin_a0 == high then
              dur
              f = high
              e = high
              ch
              pin_b2 = low
              kanal4


end if
end if
end if
end if
end procedure
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
forever loop
-- pin_b6 = low
basla
kanal3
cor
dtmfcor
cor1
-- pin_b6 = high
dtmf
kanal
end loop


Bu yazılımın çalıştığı devre:
http://picasaweb.google.com/33elektronik http://www.33elektronik.tr.cx MSN: [email]sukruozkarabacak@hotmail.com[/email]