This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #define BAUD 9600 | |
| #define MYUBRR F_CPU/16/BAUD-1 | |
| void USART_Init(unsigned int ubrr) | |
| { | |
| /*Set baud rate */ | |
| UBRR0H = (unsigned char)(ubrr>>8); | |
| UBRR0L = (unsigned char)ubrr; | |
| /*Enable receiver and transmitter */ | |
| UCSR0B = (1<<RXEN0)|(1<<TXEN0); | 
NewerOlder