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

90USB1287-16AU 参数 Datasheet PDF下载

90USB1287-16AU图片预览
型号: 90USB1287-16AU
PDF下载: 下载PDF文件 查看货源
内容描述: 单片机具有ISP功能的Flash和USB控制器64 / 128K字节 [Microcontroller with 64/128K Bytes of ISP Flash and USB Controller]
分类和应用: 微控制器
文件页数/大小: 434 页 / 3172 K
品牌: ATMEL [ ATMEL ]
 浏览型号90USB1287-16AU的Datasheet PDF文件第225页浏览型号90USB1287-16AU的Datasheet PDF文件第226页浏览型号90USB1287-16AU的Datasheet PDF文件第227页浏览型号90USB1287-16AU的Datasheet PDF文件第228页浏览型号90USB1287-16AU的Datasheet PDF文件第230页浏览型号90USB1287-16AU的Datasheet PDF文件第231页浏览型号90USB1287-16AU的Datasheet PDF文件第232页浏览型号90USB1287-16AU的Datasheet PDF文件第233页  
AT90USB64/128  
state of the TWI bus. The application software can then decide how the TWI should behave in  
the next TWI bus cycle by manipulating the TWCR and TWDR Registers.  
Figure 20-11 is a simple example of how the application can interface to the TWI hardware. In  
this example, a Master wishes to transmit a single data byte to a Slave. This description is quite  
abstract, a more detailed explanation follows later in this section. A simple code example imple-  
menting the desired behavior is also presented.  
Figure 20-11. Interfacing the Application to the TWI in a Typical Transmission  
3. Check TWSR to see if START was  
sent. Application loads SLA+W into  
TWDR, and loads appropriate control  
signals into TWCR, makin sure that  
TWINT is written to one,  
5. Check TWSR to see if SLA+W was  
sent and ACK received.  
Application loads data into TWDR, and  
loads appropriate control signals into  
TWCR, making sure that TWINT is  
written to one  
1. Application  
writes to TWCR to  
initiate  
transmission of  
START  
7. Check TWSR to see if data was sent  
and ACK received.  
Application loads appropriate control  
signals to send STOP into TWCR,  
making sure that TWINT is written to one  
and TWSTA is written to zero.  
TWI bus START  
SLA+W  
A
Data  
A
STOP  
Indicates  
TWINT set  
4. TWINT set.  
Status code indicates  
SLA+W sent, ACK  
received  
2. TWINT set.  
Status code indicates  
START condition sent  
6. TWINT set.  
Status code indicates  
data sent, ACK received  
1. The first step in a TWI transmission is to transmit a START condition. This is done by  
writing a specific value into TWCR, instructing the TWI hardware to transmit a START  
condition. Which value to write is described later on. However, it is important that the  
TWINT bit is set in the value written. Writing a one to TWINT clears the flag. The TWI  
will not start any operation as long as the TWINT bit in TWCR is set. Immediately after  
the application has cleared TWINT, the TWI will initiate transmission of the START  
condition.  
2. When the START condition has been transmitted, the TWINT Flag in TWCR is set, and  
TWSR is updated with a status code indicating that the START condition has success-  
fully been sent.  
3. The application software should now examine the value of TWSR, to make sure that  
the START condition was successfully transmitted. If TWSR indicates otherwise, the  
application software might take some special action, like calling an error routine.  
Assuming that the status code is as expected, the application must load SLA+W into  
TWDR. Remember that TWDR is used both for address and data. After TWDR has  
been loaded with the desired SLA+W, a specific value must be written to TWCR,  
instructing the TWI hardware to transmit the SLA+W present in TWDR. Which value to  
write is described later on. However, it is important that the TWINT bit is set in the value  
written. Writing a one to TWINT clears the flag. The TWI will not start any operation as  
long as the TWINT bit in TWCR is set. Immediately after the application has cleared  
TWINT, the TWI will initiate transmission of the address packet.  
4. When the address packet has been transmitted, the TWINT Flag in TWCR is set, and  
TWSR is updated with a status code indicating that the address packet has success-  
fully been sent. The status code will also reflect whether a Slave acknowledged the  
packet or not.  
229  
7593A–AVR–02/06  
 复制成功!