init_uart:
	
	ldi	tmp1,f_baud
	out	ubrr,r16	 ;la un quartz 8mhz baud=9600
	ldi	tmp1,(1<<TXEN)|(1<<RXEN) ; initialize UART for TX and RX
	out	UCR,tmp1
	ret
send:
	rcall	hex_asc
	rcall	put_uartw
	mov	tmp1,tmp2
	rcall	put_uartw
	ldi	tmp1,$0d
	rcall	put_uartw
	ldi	tmp1,$0a
	rcall	put_uartw
	ret
get_uart:
	clc
	sbis	usr,rxc		; test if character has been received
	ret
	in	tmp1,udr	; Read byte from the UART
	sec
	ret
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

