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

ATMEGA2560 参数 Datasheet PDF下载

ATMEGA2560图片预览
型号: ATMEGA2560
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器与256K字节的系统内可编程闪存 [8- BIT Microcontroller with 256K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 407 页 / 2985 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA2560的Datasheet PDF文件第209页浏览型号ATMEGA2560的Datasheet PDF文件第210页浏览型号ATMEGA2560的Datasheet PDF文件第211页浏览型号ATMEGA2560的Datasheet PDF文件第212页浏览型号ATMEGA2560的Datasheet PDF文件第214页浏览型号ATMEGA2560的Datasheet PDF文件第215页浏览型号ATMEGA2560的Datasheet PDF文件第216页浏览型号ATMEGA2560的Datasheet PDF文件第217页  
ATmega640/1280/1281/2560/2561  
examples show a transmit function that handles 9-bit characters. For the assembly  
code, the data to be sent is assumed to be stored in registers R17:R16.  
Assembly Code Example(1)(2)  
USART_Transmit:  
; Wait for empty transmit buffer  
sbis UCSRnA,UDREn  
rjmp USART_Transmit  
; Copy 9th bit from r17 to TXB8  
cbi  
UCSRnB,TXB8  
sbrc r17,0  
sbi  
UCSRnB,TXB8  
; Put LSB data (r16) into buffer, sends the data  
out  
ret  
UDRn,r16  
C Code Example(1)(2)  
void USART_Transmit( unsigned int data )  
{
/* Wait for empty transmit buffer */  
while ( !( UCSRnA & (1<<UDREn))) )  
;
/* Copy 9th bit to TXB8 */  
UCSRnB &= ~(1<<TXB8);  
if ( data & 0x0100 )  
UCSRnB |= (1<<TXB8);  
/* Put data into buffer, sends the data */  
UDRn = data;  
}
Notes: 1. These transmit functions are written to be general functions. They can be optimized if  
the contents of the UCSRnB is static. For example, only the TXB8 bit of the UCSRnB  
Register is used after initialization.  
2. See “About Code Examples” on page 8.  
The ninth bit can be used for indicating an address frame when using multi processor  
communication mode or for other protocol handling as for example synchronization.  
213  
2549A–AVR–03/05  
 复制成功!