|
; 17
; 20 //
; 21 // ** InitUART -- the routine initiates the UART module
; 22 //RSEG CODE:CODE:NOROOT(1)
; 23 void InitUART(void)
; 24 {
; 25 UBRR = UBRR_VALUE; // Set the Baud Rate register
; __nearfunc void InitUART();
InitUART:
LDI R16,1
OUT 0x09,R16
; 26 UCSRB = CHR9_BIT | TXB8_BIT; // Set UART Control Register bits
LDI R16,5
OUT 0x0A,R16
; 27 }
RET
; 42
; 43 //
; 44 // ** TransmitByte -- the function sends one byte to UART
; 45 //RSEG CODE:CODE:NOROOT(1)
; 46 void TransmitByte(char _data)
; 47 {
; 48 UCSRB |= TXEN_BIT; // Turn transmitter on
; __nearfunc void TransmitByte(char);
TransmitByte:
SBI 0x0A,0x03
; 49 while (!(UCSRA & (1<??TransmitByte_0:
SBIS 0x0B,0x05
RJMP ??TransmitByte_0
; 50 UDR = _data; // Start transmission
OUT 0x0C,R16
; 51 }
RET
E-mail: info@telesys.ru