neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

29 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