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

AT90PWM3B-16SU 参数 Datasheet PDF下载

AT90PWM3B-16SU图片预览
型号: AT90PWM3B-16SU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器具有8K字节的系统内可编程闪存 [8-bit Microcontroller with 8K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 361 页 / 6022 K
品牌: ATMEL [ ATMEL ]
 浏览型号AT90PWM3B-16SU的Datasheet PDF文件第186页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第187页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第188页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第189页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第191页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第192页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第193页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第194页  
chronous operation is used, the clock on the XCK pin will be overridden and used as  
transmission clock.  
18.6.1  
Sending Frames with 5 to 8 Data Bit  
A data transmission is initiated by loading the transmit buffer with the data to be transmitted. The  
CPU can load the transmit buffer by writing to the UDR I/O location. The buffered data in the  
transmit buffer will be moved to the Shift Register when the Shift Register is ready to send a new  
frame. The Shift Register is loaded with new data if it is in idle state (no ongoing transmission) or  
immediately after the last stop bit of the previous frame is transmitted. When the Shift Register is  
loaded with new data, it will transfer one complete frame at the rate given by the Baud Register,  
U2X bit or by XCK depending on mode of operation.  
The following code examples show a simple USART transmit function based on polling of the  
Data Register Empty (UDRE) flag. When using frames with less than eight bits, the most signifi-  
cant bits written to the UDR are ignored. The USART has to be initialized before the function can  
be used. For the assembly code, the data to be sent is assumed to be stored in Register R16.  
TABLE 3.  
Assembly Code Example(1)  
USART_Transmit:  
; Wait for empty transmit buffer  
sbis UCSRA,UDRE  
rjmp USART_Transmit  
; Put data (r16) into buffer, sends the data  
stsUDR,r16  
ret  
C Code Example(1)  
void USART_Transmit( unsigned char data )  
{
/* Wait for empty transmit buffer */  
while ( !( UCSRA & (1<<UDRE)) )  
;
/* Put data into buffer, sends the data */  
UDR = data;  
}
Note:  
1. 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 function simply waits for the transmit buffer to be empty by checking the UDRE flag, before  
loading it with new data to be transmitted. If the Data Register Empty interrupt is utilized, the  
interrupt routine writes the data into the buffer.  
18.6.2  
Sending Frames with 9 Data Bit  
If 9-bit characters are used (UCSZ = 7), the ninth bit must be written to the TXB8 bit in UCSRB  
before the low byte of the character is written to UDR. 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.  
190  
AT90PWM2/3/2B/3B  
4317J–AVR–08/10  
 复制成功!