;**********************************************************************
;
;  Copyright (C) 2007-2008 Elmar Hanlhofer http://www.plop.at
;
;  This program is free software; you can redistribute it and/or modify
;  it under the terms of the GNU General Public License as published by
;  the Free Software Foundation; either version 2 of the License, or
;  (at your option) any later version.
;
;  This program is distributed in the hope that it will be useful,
;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;  GNU General Public License for more details.
;
;
;
;**********************************************************************




; send data to usart
serialSend:
    sbis UCSRA,UDRE
    rjmp serialSend
    out UDR,r16
ret          

; read data from usart
serialRead:

    push r16
    push r17
    clr r16
    ldi r17,0
_serialRead:    
	sbis UCSRA,RXC
	rjmp _serialRead
    pop r17
    pop r16
    
    in r16,UDR
    clc
ret

    