]> hackdaworld.org Git - my-code/atmel.git/commitdiff
interrupts rule :)
authorhackbard <hackbard>
Mon, 8 Dec 2003 16:17:46 +0000 (16:17 +0000)
committerhackbard <hackbard>
Mon, 8 Dec 2003 16:17:46 +0000 (16:17 +0000)
beginners/test_int.asm [new file with mode: 0644]

diff --git a/beginners/test_int.asm b/beginners/test_int.asm
new file mode 100644 (file)
index 0000000..bae423e
--- /dev/null
@@ -0,0 +1,71 @@
+;
+; portd 3-7 blinken lights ;)
+;
+; author: hackbard@hackdaworld.dyndns.org
+;
+
+.include "../include/2313def.inc"
+
+; RESET
+rjmp INIT
+nop
+
+; INT0
+reti
+nop
+
+; INT1
+reti
+nop
+
+; T1 CAPT1
+reti
+nop
+
+; T1 COMP1
+reti
+nop
+
+; T1 OVF1
+reti
+nop
+
+; T0 OVF0
+reti
+nop
+
+; UART RX
+rjmp UART_RX
+nop
+
+; UART UDRE
+reti
+nop
+
+; UART TX
+reti
+nop
+
+; ANA_COMP
+reti
+nop
+
+UART_RX:
+in r16, UDR
+andi r16, $7C
+out DDRD, r16
+reti
+
+INIT:
+ldi r16, Low(RAMEND)
+out SPL, r16
+
+; baudrate einstellen
+ldi r16, 11 ; "38400 bps wert" in r16
+out UBRR, r16 ; write to uart baudrate register
+sbi UCR, (RXEN|RXCIE) ; enable tx at uart control register
+
+sei
+
+MAIN:
+rjmp MAIN