probiers mal so vieleicht fuktzs jaCode:.include "m16def.inc" .def temp = R16 .equ CLOCK = 3686000 .equ BAUD = 9600 .equ UBRRVAL = CLOCK/(BAUD*16)-1 .org 0x00 rjmp main .org 0x0016 rjmp int_rxc ; Hauptprogramm main: ldi temp, LOW(RAMEND) out SPL, temp ldi temp, HIGH(RAMEND) out SPH, temp ldi temp, 0xFF ; Port B = Ausgang out DDRB, 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 sei ; Interrupts global aktivieren loop: rjmp loop ; Endlosschleife ; Interruptroutine: wird ausgeführt sobald ein Byte über das UART empfangen wurde int_rxc: in temp, UDR out PORTb, temp reti
Lesezeichen