.include "8515def.inc" .def temp = R16 .equ CLOCK = 4000000 .equ BAUD = 2400 .equ UBRRVAL = CLOCK/(BAUD*16)-1 ldi temp, LOW(RAMEND) out SPL, temp ldi temp, HIGH(RAMEND) out SPH, temp ldi temp, 0xFF ; Port D = Ausgang out DDRB, temp ; Baudrate einstellen ldi temp, 103 ; 2400baud out UBRR, temp ; TX aktivieren sbi UCR,TXEN receive_loop: sbis UCR, RXC ; warten bis ein Byte angekommen ist rjmp receive_loop in temp, UDR ; empfangenes Byte nach temp kopieren out PORTB, temp ; ... und an Port D ausgeben. rjmp receive_loop ; zurück zum Hauptprogramm