changing I2C bus speed

I did some tests with the I2C bus speed.

The speed of 100kHz is fixed in the Wire library, and it is used in the Wire.begin() function. It is passed to the twi.c file which sets the TWBR register.

The TWBR register can be set faster and slower.
It is a 8-bits register and it is default 72.
The value of 72 makes it easy to change the speed without the need to change the prescaler.
A value of 255 makes it three and a half times slower.
A value of 18 makes it four times faster.

void setup()
{
  Serial.begin(9600);

  Serial.print( "1, TWBR = ");
  Serial.println( TWBR);  
  
  Wire.begin();

  Serial.print( "2, TWBR = ");
  Serial.println( TWBR);  

  TWBR = 18;

  Serial.print( "3, TWBR = ");
  Serial.println( TWBR);  
}

I don't have a logic analyzer, so I used a audio-attenuator to my PC line-in with Audacity at 96kHz.
Attached is a picture for the i2c scanner at normal speed, and with TWBR at 255 and at 18.

i2c-twbr.png