.
. ۸ "Solomon" 70$.
, ۸ . "Solomon"-SL30.
250 . . "Attiny 15L". . 10- 4 . .
1.

DD3 - - Attiny 15.
- 1- .
- 2- - ( ).
- 3- - ( ).
- 5- ( ).
- 6- - . - . . .
- 7- "".
DD2-1 .
DD2-2 1 . DD1 (i118) . R19. I118 . 7080.
VD14 - .
VD 3-8. R16-R18 . 10 c R16, , , . 1 , , 6 , . Atiny 15 . 2- . 1 . 2 , , Atmel.
;*********************************************************
;******* *****************************
;
; ..
;******* ************************************
.include "tn15def.inc"
.def xfilt1 =r18 ;
.def status =r20 ;
.def temp =r21 ;
.def RGres =r22 ;
.def AL =r23 ;
.def AH =r24 ;
.def XH =r25 ;
.def var1 =r26 ;
;****************************************************
.cseg ;
.org 0 ;
rjmp reset ;
nop ;
nop
nop
rjmp timer1 ; 1
rjmp timer ; 10
nop
nop ;
nop
;******************************************************
reset:
cli ;
clr xfilt1
ldi temp,0
out OSCCAL,temp ; .
ldi temp,0x22
out ADMUX,temp ; 82
ldi temp,0x80
out ADCSR,temp ; (80)
ldi temp,245
out TCNT0,temp ; 10 (220)
ldi temp,5
out TCCR0,temp ; 1\256
ldi temp,0x0e
out TCCR1,temp ; 1\256 1
ldi temp,0x17
out WDTCR,temp ;wd 0.9
ldi temp,6
out TIMSK,temp ; 0 1
sbi DDRB,1 ;7 6
sbi DDRB,2
cbi DDRB,3 ;
cbi DDRB,4
cbi DDRB,5
sbi DDRB,0
sbi PORTB,0
sbi PORTB,1
cbi PORTB,2 ;
clr status
clr XH ; 0
clr ZL ;
ldi temp,0
out GIMSK,temp
ldi temp,0
zut MCUSR,temp ;
ldi temp,00
out ACSR,temp ;
ldi temp,32
out MCUCR,temp ; "sleep" 32
;***********************************************************
wait:
;
sbrc status,0 ;
rcall Readadc ;
rcall MakeDeltak ;
cli
ldi temp,32
out MCUCR,temp ;
sei
sleep
rjmp wait ;
;*********************************************************
;*****
;*****10 .**********************************************
Readadc:
cbr status,1
sbi ADCSR,6 ;
wwww:
sbis ADCSR,4
rjmp wwww
in var1,ADCH ;
ldi temp,0x23 ;
out ADMUX,temp
ldi temp,64
del:
dec temp ;
cpi temp,0
brne del
sbi ADCSR,6 ;
wwww1:
sbis ADCSR,4 ;
rjmp wwww1
in xfilt1,ADCH ;
ldi temp,0x22
out ADMUX,temp ;
ret
;**************************************************************
;************************************************************
;****
;**** ************************************************
MakeDeltak:
work:
cp var1,xfilt1 ;
brlo swon
cbi PORTB,2 ;
rjmp swoff
swon:
sbi PORTB,2 ;
rjmp swoff
swoff:
ret
;*******************************************************************
;******************************************************************
;******* 10 *******************
timer:
sbi PORTB,1
sbr status,1 ;
sbic PINB,0 ;
rjmp set
mov temp,xfilt1
lsr temp
out TCNT1,temp ; 1
cbi PORTB,1
rjmp EXE
set:
mov temp,var1
lsr temp
out TCNT1,temp ; 1
cbi PORTB,1 ; 0
EXE:
ldi temp,128 ;
out TCNT0,temp
reti
;************************************************************
timer1:
sbi PORTB,1 ; 1
reti
|
, Solomon, 40 . , , 40 . - ( ). , , .
|