ATmega128
TWI Register
Description
TWI Bit Rate Register
– TWBR
Bit
Read/ W rite
Initial Value
7
TWBR7
R/ W
0
6
TWBR6
R/ W
0
5
TWBR5
R/ W
0
4
TWBR4
R/ W
0
3
TWBR3
R/ W
0
2
TWBR2
R/ W
0
1
TWBR1
R/ W
0
0
TWBR0
R/ W
0
TWBR
? Bits 7..0 – TWI Bit Rate Register
T W BR selects the division factor for the bit rate generator. The bit rate generator is a frequency
divider which generates the SCL clock frequency in the Master modes. See “Bit Rate Generator
Unit” on page 203 for calculating bit rates.
TWI Control Register –
TWCR
Bit
Read/ W rite
Initial Value
7
TWINT
R/ W
0
6
TWEA
R/ W
0
5
TWSTA
R/ W
0
4
TWSTO
R/ W
0
3
TWWC
R
0
2
TWEN
R/ W
0
1
R
0
0
TWIE
R/ W
0
TWCR
The T W CR is used to control the operation of the T W I. It is used to enable the T W I, to initiate a
master access by applying a START condition to the bus, to generate a receiver acknowledge,
to generate a stop condition, and to control halting of the bus while the data to be written to the
bus are written to the T W DR. It also indicates a write collision if data is attempted written to
T W DR while the register is inaccessible.
? Bit 7 – TWINT: TWI Interrupt Flag
This bit is set by hardware when the T W I has finished its current job and expects application
software response. If the I-bit in SREG and T W IE in T W CR are set, the MCU will jump to the
T W I interrupt vector. W hile the T W INT flag is set, the SCL low period is stretched.
The T W INT flag must be cleared by software by writing a logic one to it. Note that this flag is not
automatically cleared by hardware when executing the interrupt routine. Also note that clearing
this flag starts the operation of the T W I, so all accesses to the T W I Address Register (T W AR),
T W I Status Register (T W SR), and T W I Data Register (T W DR) must be complete before clearing
this flag.
? Bit 6 – TWEA: TWI Enable Acknowledge Bit
The T W EA bit controls the generation of the acknowledge pulse. If the T W EA bit is written to
one, the ACK pulse is generated on the T W I bus if the following conditions are met:
1. The device’s own slave address has been received.
2. A general call has been received, while the T W GCE bit in the T W AR is set.
3. A data byte has been received in Master Receiver or Slave Receiver mode.
By writing the T W EA bit to zero, the device can be virtually disconnected from the Two-wire
Serial Bus temporarily. Address recognition can then be resumed by writing the T W EA bit to one
again.
? Bit 5 – TWSTA: TWI START Condition Bit
The application writes the T W STA bit to one when it desires to become a master on the Two-
wire Serial Bus. The T W I hardware checks if the bus is available, and generates a START con-
dition on the bus if it is free. However, if the bus is not free, the T W I waits until a STOP condition
is detected, and then generates a new START condition to claim the bus Master status. T W STA
must be cleared by software when the START condition has been transmitted.
205
2467X–AVR–06/11
相关PDF资料
ATMEGA64RZAPV-10AU BUNDLE ATMEGA644P/AT86RF230 TQFP
ATP101-TL-H MOSFET P-CH 30V 25A ATPAK
ATP102-TL-H MOSFET P-CH 30V 40A ATPAK
ATP103-TL-H MOSFET P-CH 30V 55A ATPAK
ATP104-TL-H MOSFET P-CH 30V 75A ATPAK
ATP106-TL-H MOSFET P-CH 40V 30A ATPAK
ATP107-TL-H MOSFET P-CH 40V 50A ATPAK
ATP108-TL-H MOSFET P-CH 40V 70A ATPAK
相关代理商/技术参数
ATMEGA128RFA1-ZUR SL514 制造商:Atmel Corporation 功能描述:
ATMEGA128RFA1-ZUR00 制造商:Atmel Corporation 功能描述:2.4GHZ 802.15.4 128K SOC REVF 制造商:Atmel Corporation 功能描述:2.4GHZ 802.15.4 128K SOC REVF T&R - Bulk 制造商:Atmel from Components Direct 功能描述:ATMEL ATMEGA128RFA1-ZUR00 MICROCONTROLLERS (MCU) 制造商:Atmel 功能描述:Atmel ATMEGA128RFA1-ZUR00 Microcontrollers (MCU) 制造商:Atmel Corporation 功能描述:MCU AVR 2.4GHZ 128K FLASH 64VQFN 制造商:Atmel Corporation 功能描述:2.4GHZ 802.15.4 128K SOC Revision F 制造商:Atmel 功能描述:2.4GHZ 802.15.4 128K SOC REVF
ATMEGA128RFR2-ZF 功能描述:IC RF TXRX+MCU 802.15.4 64-VFQFN 制造商:microchip technology 系列:- 包装:托盘 零件状态:在售 类型:TxRx + MCU 射频系列/标准:802.15.4 协议:Zigbee? 调制:DSSS, O-QPSK 频率:2.4GHz 数据速率(最大值):2Mbps 功率 - 输出:3.5dBm 灵敏度:-100dBm 存储容量:128kB 闪存,4kB EEPROM,16kB SRAM 串行接口:I2C,JTAG,SPI,USART GPIO:35 电压 - 电源:1.8 V ~ 3.6 V 电流 - 接收:5mA ~ 12.5mA 电流 - 传输:8mA ~ 14.5mA 工作温度:-40°C ~ 125°C 封装/外壳:64-VFQFN 裸露焊盘 标准包装:260
ATMEGA128RFR2-ZU 制造商:Atmel Corporation 功能描述:2.4GHZ 802.15.4 128K SOC IND 85C - Bulk
ATMEGA128RFR2-ZUR 制造商:Atmel Corporation 功能描述:2.4GHZ 802.15.4 128K SOC 85C T&R - Tape and Reel
ATMEGA128RZAV-8AU 功能描述:射频微控制器 - MCU AVR Z-Link Bundle RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:Si100x 数据总线宽度:8 bit 最大时钟频率:24 MHz 程序存储器大小:64 KB 数据 RAM 大小:4 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:LGA-42 安装风格:SMD/SMT 封装:Tube
ATMEGA128RZAV-8MU 功能描述:射频微控制器 - MCU AVR Z-Link Bundle RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:Si100x 数据总线宽度:8 bit 最大时钟频率:24 MHz 程序存储器大小:64 KB 数据 RAM 大小:4 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:LGA-42 安装风格:SMD/SMT 封装:Tube