.include "m32def.inc"
      
    ldi  r16,high(ramend)  
    out  sph,r16
    ldi  r16,low(ramend)
    out  spl,r16
    sbi  ddrb,5    
  begin:sbi  portb,5    
    rcall  delay_1ms  
    cbi  portb,5    
    rcall  delay_1ms  
    rjmp   begin
  
  delay_1ms:
    ldi  r20,high(9999)
    out  icr1h,r20    
    ldi  r20,low(9999)
    out  icr1l,r20    
    ldi  r20,0
    out  tcnt1h,r20    
    out  tcnt1l,r20    
    ldi  r20,0x02
    out  tccr1a,r20    
    ldi  r20,0x19
    out  tccr1b,r20    
  again: in  r20,tifr    
    sbrs  r20,icf1    
    rjmp  again
    ldi  r20,1<<icf1
    out  tifr,r20    
    ldi  r19,0
    out  tccr1b,r19    
    out  tccr1a,r19    
    ret