Line 9: Line 9:
 
=Registers=
 
=Registers=
 
====TWBR ( TWI Bit Rate Register )====
 
====TWBR ( TWI Bit Rate Register )====
 +
 +
{| class="wikitable" style="text-align:center; background-color:#3DA8BB;"
 +
!colspan = '8'|EEDR
 +
|-
 +
|  7  ||  6  ||  5  ||  4  ||  3  ||  2  ||  1  ||  0 
 +
|-
 +
|TWBR7||TWBR6||TWBR5||TWBR4||TWBR3||TWBR2||TWBR1||TWBR0
 +
|}
  
 
'''Bits [7:0] – Bit Rate '''
 
'''Bits [7:0] – Bit Rate '''
 +
 
It selects the division factor for the bit rate generator. The bit rate generator is basically a frequency
 
It selects the division factor for the bit rate generator. The bit rate generator is basically a frequency
 
divider. It generates the SCL clock frequency in the Master modes.
 
divider. It generates the SCL clock frequency in the Master modes.

Revision as of 13:09, 4 February 2015


Basics

The I²C (Inter-Integrated Circuit) protocol, referred to as I-squared-C, I-two-C, or IIC) is two wire serial communication protocol for connecting low speed peripherals to a micrcontroller or computer motherboard.

You can go through I²C /TWI Basics tutorials to understand how I²C works.

Registers

TWBR ( TWI Bit Rate Register )

EEDR
7 6 5 4 3 2 1 0
TWBR7 TWBR6 TWBR5 TWBR4 TWBR3 TWBR2 TWBR1 TWBR0

Bits [7:0] – Bit Rate

It selects the division factor for the bit rate generator. The bit rate generator is basically a frequency divider. It generates the SCL clock frequency in the Master modes.

TWCR

TWSR

TWDR

Practical Example

AVR Interfacing: RTC DS1307