1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/projekte/attiny13/blink.asm
Eve Entropia db55ca4bf7 calc time
2011-02-24 00:02:10 +01:00

28 lines
409 B
NASM

.INCLUDE "tn13def.inc"
; data direction = output
sbi DDRB, 1 ; PB1
loop:
; clear bit
cbi PORTB, 1
; wait
; takes roughly ((2+2)*(256*256))/(9.6*1000*1000/8) ~ .218 seconds.
; 2 cycles SBIW + 2 cycles BRNE for 256*256 subtractions
; 9.6 MHz (CKSEL[1..0] = 10) with CKDIV=8
loop1:
sbiw ZL, 1
brne loop1
; set bit
sbi PORTB, 1
; wait
loop2:
sbiw ZL, 1
brne loop2
; again! again! again!
rjmp loop