« "-". AVR.RU», . : https://avr.ru/ready/measure/mass/metal_seek

"-"

. .

:
1. , , . 帠 ( ).
2. . , , , . ( ) , . , .

. , 砠 , , , .

50 , 1. , , , 30 60 , 帠 , .

.1. : - ATtiny2313V-20PI (DD2); CD4001B (DD1.1, DD1.2); CD4001 (DD1.3); ( ) 847  (VT3); BC847B (VT2), HCM1605F (G1); - 307̠ (HL3); BC847B (VT3) LM358N (DA3.1); - BAV-70 (DA1, DA2), 1,0 Ԡ (4) BC847B (VT4); - MAX 667 (D1); BC847B (VT1) 307̠ (HL1); 307̠ (HL2).

. 1 - (/int/Files/Picture/Metal_seek/Metalseek_pic.1.PNG)

. 50 , DD1.3 c 15 (3) DD2, 1 , 14 (2) DD2. WA1. WA2 , , (>50 ) . 4, R14 DD2 ( 12). , R13, R15 RP1, ( 13). RP1 . , 50 . 1 , , 4 VT4, .

(HL3) 9 (PD5) DD2 5 .
D1 5  . 5,5   帠 7 , , VT1, HL1.
LC .
65110 (. . 2). SMD . 1206, D. . (600 800 ) 8 10 90 ( ).

.2 - (/int/Files/Picture/Metal_seek/Metalseek_pic.2.PNG)

, ( ) , , , , .. . .3 , G758(V), 26018065 , .


.3 - (/int/Files/Picture/Metal_seek/Metalseek_pic.3.PNG)

-50. 1 13 , , .

, 1 13 ( ) 4, . 170140 ( ) 60 , 4 . , RP1 . C . , , , 15 -20 , , , GND .

, , (. ) 頠 .

FILE PCAD (/int/Files/Dounload/Metal_seek/File PCAD.zip). <www.avr.ru>.

, . - PORTD.6 PORTD.5. TIMER1 c , TIMER0 . :
N = Fc / (Ft * K * 2)
Fc ;

Ft ;

.

, 1 0 N, 0 (255-N) 255. 255 , ( Pulse) OC0A (PB2), 0 (255-N).   2 1 . 1 (50 80, 45 89, 40 100, 35 114). .

' "metall.bas"
'
' - 8
' :
'1 - X (8000000/(X0000*2)=Hlimit )
'0 - 1 (8000000/(64*1000*2)=63 ),255-63=192-Llimit
'
$regfile = "attiny2313a.dat" '
$crystal = 8000000 ' ()
$hwstack = 40
$swstack = 16
$framesize = 32
'$sim '

Config Pinb.3 = Output '
Config Pinb.2 = Output ' 1
Config Pinb.1 = Input ' "-"
Config Pinb.0 = Input ' "+"
Config Pind.6 = Output ' ""
Config Pind.5 = Output '
Set Portb.2
Set Portb.3

Config Aci = On , Compare = Off '. , .

Signal Alias Portd.6 ' PD6- ""
Sounds Alias Portd.5 ' PD5 -
Comp Alias Acsr.5 '
Lowfreq Alias Portb.2 '
Higfreq Alias Portb.3 ' ( )

Config Timer0 = Timer , Prescale = 64 '. 0 = 64
Config Timer1 = Timer , Prescale = 1 , Compare A = Toggle , Clear Timer = 1 '..=1, OC1A
' . ,
Stop Timer0 '
Stop Timer1
On Timer0 Pulse ' 0

Const Hlimit = 80 ' () 1- 50
'Const Hlimit = 89 ' 45 '
'Const Hlimit = 100 ' 40
'Const Hlimit = 114 ' 35
Compare1a = Hlimit ' 1
Const Llimit = 192 ' () 0 ( 1)

Enable Interrupts '
Enable Timer0 ' 0
Timer0 = Llimit '
Timer1 = 0
Start Timer0 '
Start Timer1

Do '
If Comp = 1 Then ' . .1
Set Signal '
Sound Sounds , 200 , 600 '
Else
Reset Signal '
Reset Sounds
End If
Loop
Pulse: ' 0
Stop Timer0 ' 0
Timer0 = Llimit ' 0
Toggle Lowfreq '
Start Timer0 ' 0
Return
End 'end program

C metall.bas Metal_seek_prog (/int/Files/Dounload/Metal_seek/Metal_seek_prog.zip).

c BASCOM AVR <www.mcselec.com/download (http://www.mcselec.com/download)> . , , .


andre (http://forum.avr.ru/member.php?u=11273)




© AVR.RU, 2021.