ich hatte als test einfach vor ausgelöst durch das senden eines bytes via RS232 die LED an bzw. ausgehen zu lassen. allerdings funktioniert das ganze nur ein mal. sprich ich kann sie anmachen.
wäre nett wenn mir jemand erklären könnte warum.Code:.include "m16def.inc" .def temp = r16 .equ CLOCK = 10000000 .equ BAUD = 9600 .equ UBRRVAL = CLOCK/(BAUD*16)-1 .org 0x00 rjmp main .org URXCaddr ; Interruptvektor für UART-Empfang rjmp int_rxc ; Hauptprogramm main: ldi r16, 0xFF out DDRB, r16 ldi r16, 0xFF out PORTB, r16 cbi DDRB, 4 sbi PORTB, 0 ldi temp, LOW(RAMEND) out SPL, temp ldi temp, HIGH(RAMEND) out SPH, temp ; Baudrate einstellen ldi temp, LOW(UBRRVAL) out UBRRL, temp ldi temp, HIGH(UBRRVAL) out UBRRH, temp ; Frame-Format: 8 Bit ldi temp, (1<<URSEL)|(3<<UCSZ0) out UCSRC, temp sbi UCSRB, RXCIE ; Interrupt bei Empfang sbi UCSRB, RXEN ; RX (Empfang) aktivieren sbi UCSRB, TXEN ; RX (Empfang) aktivieren s1: sei ; Interrupts global aktivieren loop: rjmp loop ; Interruptroutine: wird ausgeführt sobald ein Byte über das UART empfangen wurde int_rxc: sbis PORTB, 0 sbi PORTB, 0 sbic PORTB, 0 cbi PORTB, 0 reti







Zitieren

Lesezeichen