欢迎访问ic37.com |
会员登录 免费注册
发布采购

ATMEGA8-16AI 参数 Datasheet PDF下载

ATMEGA8-16AI图片预览
型号: ATMEGA8-16AI
PDF下载: 下载PDF文件 查看货源
内容描述: 位的AVR微控制器8K字节在 - 系统内可编程Flash [-bit AVR Microcontroller with 8K Bytes In- System Programmable Flash]
分类和应用: 微控制器
文件页数/大小: 303 页 / 5122 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA8-16AI的Datasheet PDF文件第132页浏览型号ATMEGA8-16AI的Datasheet PDF文件第133页浏览型号ATMEGA8-16AI的Datasheet PDF文件第134页浏览型号ATMEGA8-16AI的Datasheet PDF文件第135页浏览型号ATMEGA8-16AI的Datasheet PDF文件第137页浏览型号ATMEGA8-16AI的Datasheet PDF文件第138页浏览型号ATMEGA8-16AI的Datasheet PDF文件第139页浏览型号ATMEGA8-16AI的Datasheet PDF文件第140页  
Assembly Code Example(1)  
USART_Init:  
; Set baud rate  
out UBRRH, r17  
out UBRRL, r16  
; Enable Receiver and Transmitter  
ldi r16, (1<<RXEN)|(1<<TXEN)  
out UCSRB,r16  
; Set frame format: 8data, 2stop bit  
ldi r16, (1<<URSEL)|(1<<USBS)|(3<<UCSZ0)  
out UCSRC,r16  
ret  
C Code Example(1)  
void USART_Init( unsigned int baud )  
{
/* Set baud rate */  
UBRRH = (unsigned char)(baud>>8);  
UBRRL = (unsigned char)baud;  
/* Enable Receiver and Transmitter */  
UCSRB = (1<<RXEN)|(1<<TXEN);  
/* Set frame format: 8data, 2stop bit */  
UCSRC = (1<<URSEL)|(1<<USBS)|(3<<UCSZ0);  
}
Note:  
1. The example codes assume that the part specific header file is included.  
More advanced initialization routines can be made that include frame format as parame-  
ters, disable interrupts and so on. However, many applications use a fixed setting of the  
Baud and Control Registers, and for these types of applications the initialization code  
can be placed directly in the main routine, or be combined with initialization code for  
other I/O modules.  
136  
ATmega8(L)  
2486M–AVR–12/03  
 复制成功!