#include /** * communicate at 9600 baud using * builtin USART. Clock is external * 4MHz. */ void usart_init(void) { UBRRL = 25; // 9600 bps UCSRB |= _BV(TXEN); } void usart_putchar(uint8_t c) { UDR = c; while(bit_is_clear(UCSRA, TXC)); UCSRA = _BV(TXC) ; // clear the bit by writing a ONE } main() { char msg[] = "Hello"; int i; usart_init(); while(1) { for(i = 0; msg[i]; i++) usart_putchar(msg[i]); } }