init_uart:
	
	ldi	tmp1,f_baud
	out	ubrr,tmp1	
	ldi	tmp1,(1<<TXEN)|(1<<RXEN) ; initialize UART for TX and RX
	out	UCR,tmp1
	ret
;Get chr from uart
;Return carry=1 - succes chr in Tmp1
;else carry=0 no chr
get_uart:
	clc
	sbis	usr,rxc		; test if character has been received
	ret
	in	tmp1,udr	; Read byte from the UART
	sec
	ret
;Wait until UART is free and transmit Tmp1
put_uartw:
	sbis	usr,udre	;test for TX register empty
	rjmp	put_uartw	;wait until uart is redy		
	out	udr,tmp1	;send the byte
	ret

