Things to check:
- hardware - wiring
- value of M103C fuse (= compatibility mode)
- XTAL frequency and prescalers, as the formula for BAUD depends on it: BAUD = Fosc/16(UBRR+1)
- USART double speed flag (UCSRA)
- frame format
- UDREn flag set
You also may get better insight into your code if you use predefined symbolic values, e.g.
/* Enable receiver and transmitter */
UCSRB = (1<<RXEN)|(1<<TXEN);
see the examples in the data sheet (pg 176ff)
On the frame format I understand you are set to async, 8-bit (UCSR1B:2 = 0, UCSR1C:2,1 = 11
), parity disabled, 1 stop bit
In void TX_CHAR(char ch)
I understand you are checking the status of bit 7 (RXC1) by using mask 0x20H
. On the other hand you dont have the RX enabled (RXEN1 meaning UCSR1B:4=0)
I wonder if you shouldn't better check bit 6 (TXC1). Again ... using the symbolic values would help to better understand the code.
Hope this helps ...