Haberler:

[move]Türkiye'nin Elektronik ve Metal Dedektörlerini Buluşturan İlk Sitesi Teknoloji Ekibi'ne Hoş Geldiniz.[/move]

Ana Menü

bu dedektör hakkında bilgisi olan varmı ?

Başlatan eqoder, 03 Aralık 2008, 12:56:23

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

eqoder

Arkadaşlar bu dedektörü daha önce gören yada yapan varmı aranızda?  cihazın kodlarıda verilmiş, 
inceleyip anlayan arkadaşlar düşüncelerini paylaşırsa sevinirim.. iyi çalışmalar.

[IMG]http://img116.imageshack.us/img116/9875/semaik9.th.jpg[/img]

kodlar:
' Aubrey Kozak Metal Detector
DEFINE OSC 20
'Set serial communication parameters
'Enable receiver
DEFINE HSER_RCSTA 90h
'Enable transmitter
DEFINE HSER_TXSTA 20h
'Set baud rate to 9600
DEFINE HSER_BAUD 9600
'Automatically clear over-run errors
DEFINE HSER_CLROERR 1
'Slow speed I2C bus for real-time clock communication (100 kHz,
DS1307)
DEFINE I2C_SLOW 1
'******Variable Declarations
'Oscillating variables
w1 VAR WORD
w2 VAR WORD
insig VAR WORD
'Time variables
cont VAR BYTE 'I2C control byte for real -time clock (bottom bit
must be low in PBP,
for R/W)
addr VAR BYTE 'real time clock variables
ds_sec VAR BYTE
ds_min VAR BYTE
ds_hr VAR BYTE
ds_day VAR BYTE
ds_dat VAR BYTE
ds_mon VAR BYTE
ds_yr VAR BYTE
ds_cont VAR BYTE
e_sec VAR BYTE
e_min VAR BYTE
secs VAR BYTE
mins VAR BYTE
hour VAR BYTE
wkdy VAR BYTE
mndy VAR BYTE
mnth VAR BYTE
year VAR BYTE
InChar VAR BYTE 'serial com buffer (for DFetc.)
DFIdx VAR WORD
DFStartAddress VAR WORD
DFEndAddress VAR WORD
DFStore VAR BYTE
Time VAR WORD 'alternates min, sec data
i VAR WORD 'loop index
'Delay to see Metal Detector is working
PAUSE 1000
HIGH PORTB.0
PAUSE 1000
LOW PORTB.0
'******Main Program
'default initial time
secs = 33
mins = 33
hour = 9
wkdy = 3
mndy = 9
mnth = 7
year = 3
'enable & set real-time clock
addr = 0
ds_sec = 0'((secs / 10) << 4) | (secs // 10) 'enable oscillator,
set seconds
ds_min = 0'((mins / 10) << 4) | (mins // 10) 'minutes
ds_hr = 0'((hour / 10) << 4) | (hour // 10) 'hours (24 hr clock)
ds_day = wkdy
'day of the week
ds_dat = 0'((mndy / 10) << 4) | (mndy // 10) 'date
ds_mon = 0'((mnth / 10) << 4) | (mnth // 10) 'month
ds_yr = 0'((year / 10) << 4) | (year // 10) 'year - last two
digits only
ds_cont= %00010000
'1second sq wave on pin 7 (open drain)
cont = %11010000
I2CWRITE PORTC.4, PORTC.3, cont, addr, [ds_sec, ds_min, ds_hr,
ds_day, ds_dat,
ds_mon, _
ds_yr, ds_cont]
'Initialize data file address & index
DFStartAddress = 2096 'First useable program memory hex.
(in dec. 2096)
DFEndAddress = 6553 'Last useable program memory hex. (in
dec. 6553)
DFIdx = 0 'Initialize to start of
data file
DFStore = 0 'Sampling is initially turned
off
'Metal Detector
COUNT PORTD.7,28,w1
'******Main Program Loop
WHILE (1) 'Infinite Loop
PAUSE 100 'cut sampling time down to
4 samples per second
'Metal Detector Loop
COUNT PORTD.7,28,w2
HIGH PORTB.0
HIGH PORTB.1
HIGH PORTB.2
HIGH PORTB.3
HIGH PORTB.4
HIGH PORTB.5
HIGH PORTB.6
HIGH PORTB.7
if w2 > w1 then
if (w2 - w1) > 15 then LOW PORTB.7
if ((w2 - w1) > 5) AND ((w2 - w1) <= 10) then LOW PORTB.6
if (w2 - w1) <= 5 then LOW PORTB.5
endif
if w1 > w2 then
if (w1 - w2) <= 5 then LOW PORTB.3
if ((w1 - w2) > 5) AND ((w1 - w2) <= 10) then LOW PORTB.2
if (w1 - w2) > 15 then LOW PORTB.1
endif
'HSEROUT [(w1-w2)+48]
HSEROUT [13] 'carriage
HSEROUT [10]
if (w2 = w1) then LOW PORTB.4
LOW PORTB.0
'Time Loop
if (DFEndAddress <= (DFStartAddress + DFIdx)) then
DFStore = 0 'turn off sampling if
data file is full
endif
DFStore = DFStore + 1
insig = abs(w2 - w1) 'insig equals absolute value of (w2 -
w1)
'Start by checking for keyboard input - jump to NO INPUT if needed
HSERIN 100, NO_INPUT, [STR InChar \1] 'Get
character from serial port
HSEROUT [InChar]
'Echo character back to terminal
if (InChar = "c") then DFIdx = 0 'clears
if (InChar = "s") & (DFEndAddress > (DFStartAddress +
DFIdx)) then DFStore =
DFStore ^ 1 'stores(exclusive or)
if (InChar = "o") then
HSEROUT ["reading start"]
for i = 0 to DFIdx STEP 2
READCODE (DFStartAddress + i), insig
HSEROUT [DEC insig]
HSEROUT [" "]
READCODE (DFStartAddress + i+1), Time
HSEROUT [DEC (Time>>8)]
HSEROUT [" "]
HSEROUT [DEC (Time & 2 55)]
HSEROUT [13]
'carriage
HSEROUT [10]
next i
HSEROUT ["reading done"]
endif
NO_INPUT:
cont = %11010001
addr = 0
I2CRead PORTC.4, PORTC.3, cont, addr, [ds_sec, ds_min]
e_sec = ((ds_sec & 240)>>4)*10 + (ds_sec & 15) 'set in
binary time
e_min = ((ds_min & 240)>>4)*10 + (ds_min & 15)
Time = (e_min << 8) + (e_sec)
'shift
HSEROUT [DEC e_min]
HSEROUT [" "]
HSEROUT [DEC e_sec]
if DFStore then
WRITECODE (DFStartAddress + DFIDX), ((w2 - w1))
' WRITECODE (DFStartAddress + DFIDX), ((w2 > w1) OR (w1 >
w2))
' WRITECODE (DFStartAddress + DFIDX), (w2 > w1)
DFIdx = DFIdx + 1
WRITECODE (DFStartAddress + DFIDX), Time
DFIdx = DFIdx + 1
endif
WEND

Pdf Dosyası:
   Not: baskı devreside var
Linkback: bu dedektör hakkında bilgisi olan varmı ?

cihan19

ENDUSTRİYEL ELEKTRONİK FETHİYE

mutsuz4

bana bu deve calışsada fazla bir sonuc verecegini zannetmiyorum bobini direk entegreden sürülmüş bence mesafe az olur calışsada.. sanrım rs232 baglantısı da var bu ne için acaba?
[move](BiLGi PaYLaŞıLDıKÇa ÇoĞaLıR)[/move]
                        J@F


Paylaş whatsappPaylaş facebookPaylaş linkedinPaylaş twitterPaylaş myspacePaylaş redditPaylaş diggPaylaş stumblePaylaş technoratiPaylaş delicious