hi !!
hier sind die wichtigsten teile
.equ CLOCK = 3686400
.equ BAUD = 9600
.equ UBRRVAL = CLOCK/(BAUD*16)-1
; Baudrate einstellen
ldi temp1, LOW(UBRRVAL)
sts UBRR1L, temp1
ldi temp1, HIGH(UBRRVAL)
sts UBRR1H, temp1
; RX / TX aktivieren
ldi temp1, (1<<RXEN)|(1<<TXEN)
sts UCSR1B,temp1
; Set frame format: 8data, 2stop bit
ldi temp1, (1<<USBS)|(3<<UCSZ0)
sts UCSR1C,temp1
USART_Transmit:
; Wait for empty transmit buffer
;push temp1
lds temp1, UCSR1A
sbrs temp1 ,UDRE1
rjmp USART_Transmit
; Put data (r18) into buffer, sends the data
;pop temp1
sts UDR1,temp2
ret
USART_Receive:
; Wait for data to be received
;push temp1
lds temp1, UCSR1A
sbrs temp1 ,RXC
rjmp USART_Receive
; Get and return received data from buffer
;pop temp1
lds temp3, UDR1
ret
juergen