Hi guys,
using icc-avr app-builder I have this code to write something in hyperterminal from the uart port of mega 88. I just wonder why this does not work?
can anyone please suggest?
void main()
{
uart0_init();
while(1)
{
//transmit data
while( ! (UCSR0A & ( 1<<UDRE0) ) )
;
UDR0 = 0x55;
}
}
void uart0_init(void)
{
UCSR0B = 0x00; //disable while setting baud rate
UCSR0A = 0x00;
UCSR0C = 0x06;
UBRR0L = 0x08; //set baud rate lo
UBRR0H = 0x00; //set baud rate hi
UCSR0B = 0xD8;
}
cheers!!