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

ATMEGA48PA-CCU 参数 Datasheet PDF下载

ATMEGA48PA-CCU图片预览
型号: ATMEGA48PA-CCU
PDF下载: 下载PDF文件 查看货源
内容描述: [RISC Microcontroller, 8-Bit, FLASH, AVR RISC CPU, 20MHz, CMOS, PBGA32, 4 X 4 MM, 0.60 MM HEIGHT, 0.50 MM PITCH, GREEN, PLASTIC, UFBGA-32]
分类和应用: 闪存微控制器
文件页数/大小: 349 页 / 2752 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第165页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第166页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第167页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第168页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第170页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第171页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第172页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第173页  
ATmega48/88/168  
and “SBI” instructions must be replaced with instructions that allow access to  
extended I/O. Typically “LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and  
“CBR”.  
The function simply waits for the transmit buffer to be empty by checking the UDREn  
Flag, before loading it with new data to be transmitted. If the Data Register Empty inter-  
rupt is utilized, the interrupt routine writes the data into the buffer.  
Sending Frames with 9 Data  
Bit  
If 9-bit characters are used (UCSZn = 7), the ninth bit must be written to the TXB8 bit in  
UCSRnB before the low byte of the character is written to UDRn. The following code  
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 UDRn,r16  
ret  
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. The example code assumes that the part specific header file is included.  
For I/O Registers located in extended I/O map, “IN”, “OUT”, “SBIS”, “SBIC”, “CBI”,  
and “SBI” instructions must be replaced with instructions that allow access to  
extended I/O. Typically “LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and  
“CBR”.  
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.  
169  
2545D–AVR–07/04  
 复制成功!