From: hackbard Date: Mon, 8 Dec 2003 16:17:46 +0000 (+0000) Subject: interrupts rule :) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ccc8d37baa475b73975e46f2f9f536543b7cd3f;p=my-code%2Fatmel.git interrupts rule :) --- diff --git a/beginners/test_int.asm b/beginners/test_int.asm new file mode 100644 index 0000000..bae423e --- /dev/null +++ b/beginners/test_int.asm @@ -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