You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			20 lines
		
	
	
		
			658 B
		
	
	
	
		
			Markdown
		
	
			
		
		
	
	
			20 lines
		
	
	
		
			658 B
		
	
	
	
		
			Markdown
		
	
| # Super Simple UART config for ATmega
 | |
| 
 | |
| lets you use normal `printf()` in your code.
 | |
| 
 | |
| ### Adjustments to make
 | |
| the dafault configuration works on an atmega328p with 38400 baud. Any other setup might require one of the following changes.
 | |
| 
 | |
| #### Set baudrate in 'uart.h'
 | |
| line 6:
 | |
| `#define BAUD 38400`
 | |
| 
 | |
| #### Select which UART to use
 | |
| If your controller has more than one UART hardware and you want to use a different than UART0,
 | |
| change the register defines in the following way:
 | |
| 
 | |
| ##### Example: UART0 -> UART3
 | |
| from `#define UART_BAUD_REGH UBRR0H` to `#define UART_BAUD_REGH UBRR3H`</br>
 | |
| and</br>
 | |
| from `#define UART_UCSZ0_BM UCSZ00` to `#define UART_UCSZ0_BM UCSZ30`
 |