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

ATMEGA2560-16AU-SL383 参数 Datasheet PDF下载

ATMEGA2560-16AU-SL383图片预览
型号: ATMEGA2560-16AU-SL383
PDF下载: 下载PDF文件 查看货源
内容描述: [Microcontroller, 8-Bit, FLASH, AVR RISC CPU, 16MHz, CMOS, PQFP100, 14 X 14 MM, 1 MM HEIGHT, 0.50 MM PITCH, GREEN, PLASTIC, MS-026AED, TQFP-100]
分类和应用: 时钟微控制器
文件页数/大小: 448 页 / 7518 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第208页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第209页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第210页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第211页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第213页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第214页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第215页浏览型号ATMEGA2560-16AU-SL383的Datasheet PDF文件第216页  
check that there are no unread data in the receive buffer. Note that the TXCn Flag must be  
cleared before each transmission (before UDRn is written) if it is used for this purpose.  
The following simple USART initialization code examples show one assembly and one C func-  
tion that are equal in functionality. The examples assume asynchronous operation using polling  
(no interrupts enabled) and a fixed frame format. The baud rate is given as a function parameter.  
For the assembly code, the baud rate parameter is assumed to be stored in the r17:r16  
Registers.  
Assembly Code Example(1)  
USART_Init:  
; Set baud rate  
out  
out  
UBRRnH, r17  
UBRRnL, r16  
; Enable receiver and transmitter  
ldi  
out  
r16, (1<<RXENn)|(1<<TXENn)  
UCSRnB,r16  
; Set frame format: 8data, 2stop bit  
ldi  
out  
ret  
r16, (1<<USBSn)|(3<<UCSZn0)  
UCSRnC,r16  
C Code Example(1)  
#define FOSC 1843200// Clock Speed  
#define BAUD 9600  
#define (MYUBRR FOSC/16/BAUD-1)  
void main( void )  
{...  
USART_Init ( MYUBRR );  
...} // main  
void USART_Init( unsigned int ubrr){  
/* Set baud rate */  
UBRRH = (unsigned char)(ubrr>>8);  
UBRRL = (unsigned char)ubrr;  
/* Enable receiver and transmitter */  
UCSRB = (1<<RXEN)|(1<<TXEN);  
/* Set frame format: 8data, 2stop bit */  
UCSRC = (1<<USBS)|(3<<UCSZ0);  
} // USART_Init  
Note:  
1. See “About Code Examples” on page 10.  
More advanced initialization routines can be made that include frame format as parameters, dis-  
able 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.  
212  
ATmega640/1280/1281/2560/2561  
2549L–AVR–08/07  
 复制成功!