, , , ; , ; , .

.1. , ࠠ ATtiny2313 (DD1), 847  (VT1, VT2) RS-232, , , DB9-F ( ) (1) MAX3232 (DD3).

. 1 - 1

DD2 (CD4011B), R2, C7. , VT1, VT2 . 9 12 . DD1, DD2, DD3 5, 78L05 (DA1).

DD1 BASCOM, () RS-232, Bascom, .

4 . 1,3 0 (2) . , .
ʠ , Write command Enter 18 1 8 Enter.

TXlaser (DOLOOP) : (Urxc) 0 (Timer0).

1,3 (Prescale) = 1024. , Z = 253 ( 2) 255. , 2, Z = 253. , 2 1,3 (. .2).   2 , .

. 2 -

  , (1 8). , 8, ERROR.

PD6 頠 ( HL1 ), .
  PD6 , 䠠 HL1 .
TXlaser:

$regfile = "attiny2313a.dat"
$crystal = 1000000
$hwstack = 40
$swstack = 16
$framesize = 32

Config Pind.0 = Input 'UART - RxD
Config Portd.1 = Output 'UART - TxD
Config Portd.6 = Output ' HL1
Config Portb.2 = Output ' OC0A

'.0-.=1024:
Config Timer0 = Timer , Prescale = 1024
Stop Timer0 '


Dim N As Byte ' '
Dim N0 As Byte

Const Z = 253 ' .=1,3
Timer0 = Z

On Urxc Rxd ' .
On Timer0 Pulse ' .

Enable Interrupts '
Enable Urxc
Enable Timer0

Do '
Set Portd.6 ' HL1
Loop

Rxd: ' .
Reset Portd.6 '
Stop Timer0
M1:
Print "Write commad"
Input "Enter 1...8:" , N0 '
If N0 > 8 Then '
Print "Error"
Goto M1
End If
N0 = N0 * 2
N0 = N0 - 1 ' -
Toggle Portb.2
Start Timer0 '
Return

Pulse: ' .
Stop Timer0
Toggle Portb.2
Reset Portd.6 '
Timer0 = Z
N = N + 1 ' -
If N = N0 Then ' =
N = 0
N0 = 0
Waitms 500 ' 0,5
Else
Start Timer0 ',
End If
Return
End 'end program


4662 (. .3). , , SMD . ATtiny2313 DIP. DIP TRS (SCS) 20,  .

. 3 - 1

TXD.PCB FILE PCAD.
.4. DA3.1 (LM358N) , 3, R8, R9 1, 50 -100 . DA3.2 DA4.2 ⠠ . DA4.1 (), CD4011D (DD2) - DD2.1, DD2. C ATtiny2313 (DD1) T0 (PB4) 3. , Timer0, Timer1, , . DD1, , 18 .1 PORTB 07, . 8 7 .1, VT1, 1.

. 4 - 1

9 -12. 5, 78L05 DA5 DA2.

  RXlaser Timer0 , , Timer1, ,  ( 8).

  (DOLOOP) Timer1 (=0), Z=1.
  c Timer1 PORTB . Timer1- Z=0.
RXlaser :

$regfile = "attiny2313a.dat"
$crystal = 4000000
$hwstack = 40
$swstack = 16
$framesize = 32

Ddrb = 255 'PORTB-
Portb = 0
Ddrd = 0 'PORTD-
Portd = 255 ' PORTD
Config Timer0 = Counter , Prescale = 1 , Edge = Falling '
Config Timer1 = Timer , Prescale = 1024 , Clear Timer = 1 '
Stop Timer1
Timer1 = 0
Counter0 = 0

' :
Dim X As Byte
Dim Comm As Byte
Dim Z As Bit
Dim K As Bit

X =80
Compare1a = X '- .
Z = 0

On Compare1a Pulse '

Enable Interrupts '
Enable Compare1a

Do '
If Z = 0 Then '
K = Portd.3
If K = 0 Then '
Start Timer1
Z = 1
End If
End If
Loop

Pulse: ' ..
Stop Timer1
Comm = Counter0 '
Comm = Comm - 1 '
Portb = 0 '
Set Portb.comm ' ,.
Z = 0
Counter0 = 0
Timer1 = 0
Return
End 'end program

TXlaser RXlaser Lazer_prog.

4662 (. 5). SMD , , DIP TRS(SCS) 20.

. 5 - 1

. 7 DA4.2 R18 , , , 100 . 1 DA4.1 (R21) . , .
RXD.PCB FILE PCAD.

頠 30 36 . , .

( 2) .6.   1 2 , 30 DD2.1, DD2.4.. .

. 6 - 2

頠 ( 2) 10561 (DA1). .7. DA1 10 , DD3.1, DD3.2, DA3 C9, R24.   2 1.

. 7- 2

, www.Avr.ru .


andre