Из-за кодвизарда в коде много лишнего. Выкладываю основное
Код
; 280 // USART1 initialization
; 281 // Communication Parameters: 8 Data, 1 Stop, No Parity
; 282 // USART1 Receiver: On
; 283 // USART1 Transmitter: On
; 284 // USART1 Mode: Asynchronous
; 285 // USART1 Baud rate: 9600
; 286 UCSR1A=0x00;
STS 0xC8,R30
; 287 UCSR1B=0xD8;
LDI R30,LOW(216)
STS 0xC9,R30
; 288 UCSR1C=0x06;
LDI R30,LOW(6)
STS 0xCA,R30
; 289 UBRR1H=0x00;
LDI R30,LOW(0)
STS 0xCD,R30
; 290 UBRR1L=0x67;
LDI R30,LOW(103)
STS 0xCC,R30
Код
; 328 putchar1('a');
LDI R30,LOW(97)
ST -Y,R30
RCALL _putchar1
Код
; 96 // USART1 Transmitter interrupt service routine
; 97 interrupt [USART1_TXC] void usart1_tx_isr(void)
; 98 {
.CSEG
_usart1_tx_isr:
ST -Y,R30
ST -Y,R31
IN R30,SREG
ST -Y,R30
; 99 if (tx_counter1)
TST R7
BREQ _0xA
; 100 {
; 101 --tx_counter1;
DEC R7
; 102 UDR1=tx_buffer1[tx_rd_index1];
MOV R30,R6
LDI R31,0
SUBI R30,LOW(-_tx_buffer1)
SBCI R31,HIGH(-_tx_buffer1)
LD R30,Z
STS 0xCE,R30
; 103 if (++tx_rd_index1 == TX_BUFFER_SIZE1) tx_rd_index1=0;
INC R6
LDI R30,LOW(8)
CP R30,R6
BRNE _0xB
CLR R6
; 104 };
_0xB:
_0xA:
; 105 }
LD R30,Y+
OUT SREG,R30
LD R31,Y+
LD R30,Y+
RETI
; 106
; 107 // Write a character to the USART1 Transmitter buffer
; 108 #pragma used+
; 109 void putchar1(char c)
; 110 {
_putchar1:
; 111 while (tx_counter1 == TX_BUFFER_SIZE1);
_0xC:
LDI R30,LOW(8)
CP R30,R7
BREQ _0xC
; 112 #asm("cli")
cli
; 113 if (tx_counter1 || ((UCSR1A & DATA_REGISTER_EMPTY)==0))
TST R7
BRNE _0x10
LDS R30,200
ANDI R30,LOW(0x20)
BRNE _0xF
_0x10:
; 114 {
; 115 tx_buffer1[tx_wr_index1]=c;
MOV R30,R5
LDI R31,0
SUBI R30,LOW(-_tx_buffer1)
SBCI R31,HIGH(-_tx_buffer1)
LD R26,Y
STD Z+0,R26
; 116 if (++tx_wr_index1 == TX_BUFFER_SIZE1) tx_wr_index1=0;
INC R5
LDI R30,LOW(8)
CP R30,R5
BRNE _0x12
CLR R5
; 117 ++tx_counter1;
_0x12:
INC R7
; 118 }
; 119 else
RJMP _0x13
_0xF:
; 120 UDR1=c;
LD R30,Y
STS 0xCE,R30
; 121 #asm("sei")
_0x13:
sei
; 122 }
ADIW R28,1
RET
; 123 #pragma used-
; 124