Closed GoogleCodeExporter closed 9 years ago
This option has been implemented for the Due and for SSD1306/SH1106.
Original comment by olikr...@gmail.com
on 21 Dec 2014 at 7:37
for avr, this is the change:
void u8g_i2c_init(uint8_t options)
{
/*
TWBR: bit rate register
TWSR: status register (contains preselector bits)
prescalar
0 1
1 4
2 16
3 64
f = F_CPU/(16+2*TWBR*prescalar)
F_CPU = 16MHz
TWBR = 152;
TWSR = 0;
--> 50KHz
TWBR = 72;
TWSR = 0;
--> 100KHz
TWBR = 12;
TWSR = 0;
--> 400KHz
F_CPU/(2*100000)-8 --> calculate TWBR value for 100KHz
*/
u8g_i2c_opt = options;
TWSR = 0;
if ( options & U8G_I2C_OPT_FAST )
{
TWBR = F_CPU/(2*400000)-8;
}
else
{
TWBR = F_CPU/(2*100000)-8;
}
u8g_i2c_clear_error();
}
testing required
Original comment by olikr...@gmail.com
on 21 Dec 2014 at 10:15
works nicely with the Arduino Uno
Original comment by olikr...@gmail.com
on 21 Dec 2014 at 2:03
test ok
Original comment by olikr...@gmail.com
on 21 Dec 2014 at 5:00
It works fine at 400khz on Uno.
Original comment by honda.po...@gmail.com
on 21 Dec 2014 at 10:44
Original issue reported on code.google.com by
olikr...@gmail.com
on 20 Dec 2014 at 8:27