AVR Assembler, Blink LED, 16-bit Timer

AVR Assembler, Blink LED, 16-bit Timer
Çeşme:
http://www.instructables.com/id/Command-Line-Assembly-Language-Programming-for-Ard-3/
  1. Arduino UNO
.nolist .include "./m328Pdef.inc" .list ;============== ; Declarations: .def temp = r16 .def coin = r17 .org 0x0000 rjmp start .org 0x0016 rjmp TIMER1_COMPA ;Timer/Counter1 Compare Match A start: ; 7812.5 = (0.5 * 16000000)/1024 = 500ms ldi temp, (7812>>8) sts OCR1AH, temp ldi temp, (7812 & 0xFF) sts OCR1AL, temp ldi temp, (1<<CS12)|(1<<CS10)|(1<<WGM12) sts TCCR1B, temp ldi temp, (1<<OCIE1A) sts TIMSK1, temp sei sbi DDRB, 5 ;====================== loop: nop rjmp loop TIMER1_COMPA: rcall togglebit sbrs coin, 0 cbi PORTB, 5 sbrc coin, 0 sbi PORTB, 5 reti togglebit: sbrc coin, 0 rjmp PC+3 sbrs coin, 0 rjmp PC+3 andi coin, 0xfe rjmp PC+2 ori coin, 0x01 ret