;    
;       libr_mpr.txt

;    
;WDT_off:
;      wdr
;        ; Clear WDRF in MCUSR
;      in tmp0,MCUSR
;      cbr tmp0,(1<<WDRF)
;      out MCUSR,tmp0
        ; Write logical one to WDCE and WDE
        ; Keep old prescaler setting to prevent unintentional Watchdog Reset
;      in  tmp0,WDTCSR
;      ori tmp0,(1<<WDCE)|(1<<WDE)
;      out WDTCSR,tmp0
        ; Turn off WDT
;      cbr tmp0,(1<<WDE)
;      out WDTCSR,tmp0
;    ret

;  () 
WDT_off:
     wdr
     in  tmp0,WDTCR
     ori tmp0,(1<<WDCE)|(1<<WDE)
     out WDTCR,tmp0
       ; Turn off WDT
     cbr tmp0,(1<<WDE)
     out WDTCR,tmp0
   ret

;   0   
tim_start:
     ldi tmp0,1<<PSR10
     ldi tmp1,tim_on
     out GTCCR,tmp0
     out TCCR0B,tmp1
   ret

;   
tiks:
  sbr tmp7,1<<f_tiks
 reti

;

murg_bod_0:
  ldi tmp2,2
time_bod_0:
  sbrs tmp7,f_tiks ; 
   rjmp time_bod_0
   cbr tmp7,1<<f_tiks ;      . 
   dec tmp2
   brne time_bod_0 ;   
;   cbi DDRB,R_led ; R_led=1
  ret

;

murg_bod_1:
  sbrs tmp7,f_tiks ;       . 
   rjmp murg_bod_1
   cbr tmp7,1<<f_tiks ;   
;   sbi DDRB,R_led ; R_led=0
  ret

;