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

ATMEGA8-16AI 参数 Datasheet PDF下载

ATMEGA8-16AI图片预览
型号: ATMEGA8-16AI
PDF下载: 下载PDF文件 查看货源
内容描述: 位的AVR微控制器8K字节在 - 系统内可编程Flash [-bit AVR Microcontroller with 8K Bytes In- System Programmable Flash]
分类和应用: 微控制器
文件页数/大小: 303 页 / 5122 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA8-16AI的Datasheet PDF文件第167页浏览型号ATMEGA8-16AI的Datasheet PDF文件第168页浏览型号ATMEGA8-16AI的Datasheet PDF文件第169页浏览型号ATMEGA8-16AI的Datasheet PDF文件第170页浏览型号ATMEGA8-16AI的Datasheet PDF文件第172页浏览型号ATMEGA8-16AI的Datasheet PDF文件第173页浏览型号ATMEGA8-16AI的Datasheet PDF文件第174页浏览型号ATMEGA8-16AI的Datasheet PDF文件第175页  
ATmega8(L)  
TWA6  
R/W  
1
TWA5  
R/W  
1
TWA4  
R/W  
1
TWA3  
R/W  
1
TWA2  
R/W  
1
TWA1  
R/W  
1
TWA0  
R/W  
1
TWGCE  
R/W  
0
TWAR  
Read/Write  
Initial Value  
The TWAR should be loaded with the 7-bit Slave address (in the seven most significant  
bits of TWAR) to which the TWI will respond when programmed as a Slave Transmitter  
or Receiver, and not needed in the Master modes. In multimaster systems, TWAR must  
be set in masters which can be addressed as Slaves by other Masters.  
The LSB of TWAR is used to enable recognition of the general call address (0x00).  
There is an associated address comparator that looks for the slave address (or general  
call address if enabled) in the received serial address. If a match is found, an interrupt  
request is generated.  
• Bits 7..1 – TWA: TWI (Slave) Address Register  
These seven bits constitute the slave address of the TWI unit.  
• Bit 0 – TWGCE: TWI General Call Recognition Enable Bit  
If set, this bit enables the recognition of a General Call given over the Two-wire Serial  
Bus.  
Using the TWI  
The AVR TWI is byte-oriented and interrupt based. Interrupts are issued after all bus  
events, like reception of a byte or transmission of a START condition. Because the TWI  
is interrupt-based, the application software is free to carry on other operations during a  
TWI byte transfer. Note that the TWI Interrupt Enable (TWIE) bit in TWCR together with  
the Global Interrupt Enable bit in SREG allow the application to decide whether or not  
assertion of the TWINT Flag should generate an interrupt request. If the TWIE bit is  
cleared, the application must poll the TWINT Flag in order to detect actions on the TWI  
bus.  
When the TWINT Flag is asserted, the TWI has finished an operation and awaits appli-  
cation response. In this case, the TWI Status Register (TWSR) contains a value  
indicating the current 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 77 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 descrip-  
tion is quite abstract, a more detailed explanation follows later in this section. A simple  
code example implementing the desired behavior is also presented.  
171  
2486M–AVR–12/03  
 复制成功!