/* File: Serialio.asm Copyright ©1998, 1999 Larry Barello Author: Larry Barello lbarello@accessone.com You are allowed to use this file for personal use only. You may use, embed, modify or distribute the contents of this file in any way you see fit as long as you include this copyright notice in the resulting file. Any commercial or industrial use including publishing or distributing in any form requires the written authorization of the copyright holder(s). No guarantees are made about fitness, functionality, correctness or performance of this file. The file is supplied on a "AS IS" basis, with no responsibility assumed by the author(s) for bug fixes, support, or damages of any sort arising from the use of this file. Contact the author with problem reports or fixes, feature requests or additions and questions. They are welcomed and will be incorporated as time and energy permits. */ #include "Registers.inc" #include "avrx.inc" MODULE SERIALIO EXTERN CPUCLK _IntProlog _Epilog EXTERN AvrXWaitSemaphore AvrXIntSetSemaphore PUBLIC _GetChar PutChar _PrintString PUBLIC UDRE_Interrupt RxC_Interrupt PUBLIC PutCR PutSpace InitSerialIO PushChar ; ; Needed for USART interrupt ; BAUDRATE = 19200 UCR_INIT = 1< '9' brlt ph01 ; subi '9' and add 'A' subi TxByte, ('9' + 1 - 'A') ph01: rcall PutChar ph02: dec R25 brne ph00 ret ;----------------------------------------- ; Put out a hex word ; ; Passed: Y = word ; PutHexWord: ldi R24, 4 rjmp _PutHex ;----------------------------------------- ; Put out a two ascii hex byte ; Yl = byte ; PutHexByte: ldi R24, 2 rjmp _PutHex END