欢迎访问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文件第188页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第189页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第190页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第191页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第193页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第194页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第195页浏览型号ATMEGA48PA-CCU的Datasheet PDF文件第196页  
Assembly Code Example(1)  
USART_Init:  
clr r18  
out UBRRnH,r18  
out UBRRnL,r18  
; Setting the XCKn port pin as output, enables master mode.  
sbi XCKn_DDR, XCKn  
; Set MSPI mode of operation and SPI data mode 0.  
ldi r18, (1<<UMSELn1)|(1<<UMSELn0)|(0<<UCPHAn)|(0<<UCPOLn)  
out UCSRnC,r18  
; Enable receiver and transmitter.  
ldi r18, (1<<RXENn)|(1<<TXENn)  
out UCSRnB,r18  
; Set baud rate.  
; IMPORTANT: The Baud Rate must be set after the transmitter is  
enabled!  
out UBRRnH, r17  
out UBRRnL, r18  
ret  
C Code Example(1)  
void USART_Init( unsigned int baud )  
{
UBRRn = 0;  
/* Setting the XCKn port pin as output, enables master mode. */  
XCKn_DDR |= (1<<XCKn);  
/* Set MSPI mode of operation and SPI data mode 0. */  
UCSRnC = (1<<UMSELn1)|(1<<UMSELn0)|(0<<UCPHAn)|(0<<UCPOLn);  
/* Enable receiver and transmitter. */  
UCSRnB = (1<<RXENn)|(1<<TXENn);  
/* Set baud rate. */  
/* IMPORTANT: The Baud Rate must be set after the transmitter is  
enabled */  
UBRRn = baud;  
}
Note:  
1. The example code assumes that the part specific header file is included. For I/O Reg-  
isters 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. Typ-  
ically "LDS" and "STS" combined with "SBRS", "SBRC", "SBR", and "CBR".  
Data Transfer  
Using the USART in MSPI mode requires the Transmitter to be enabled, i.e. the TXENn  
bit in the UCSRnB register is set to one. When the Transmitter is enabled, the normal  
port operation of the TxDn pin is overridden and given the function as the Transmitter's  
serial output. Enabling the receiver is optional and is done by setting the RXENn bit in  
the UCSRnB register to one. When the receiver is enabled, the normal pin operation of  
the RxDn pin is overridden and given the function as the Receiver's serial input. The  
XCKn will in both cases be used as the transfer clock.  
192  
ATmega48/88/168  
2545D–AVR–07/04  
 复制成功!