Proteus AVR例子

源代码在线查看: usart.c

软件大小: 911 K
上传用户: kxjs2007
关键词: Proteus AVR
下载地址: 免注册下载 普通下载 VIP

相关代码

				#define USART_C
				#include "includes.h"
				
				
				void usart_putchar(char c)
				{
					if (c == '\n')
						usart_putchar('\r');
					while(UCSRA & (1 					UDR = c;
				}
				
				void init_usart(void)
				{
					// USART initialization
					// Communication Parameters: 8 Data, 1 Stop, No Parity
					// USART Receiver: Off
					// USART Transmitter: On
					// USART Mode: Asynchronous
					// USART Baud rate: 19200
					UCSRA=0x00;
					UCSRB=0x08;
					UCSRC=0x86;
					UBRRH=0x00;
					UBRRL=0x0C;
					
					//fdevopen(usart_putchar, NULL, 0);
				}
				
				
				
				
							

相关资源