Hello, i am using Tiva Launchpad and Keil uVision 4.74.0.22. After compiling and flashing the compdcm_mpu9150 example from TivaWare 2.1.0 i am connected my 100MHz logic analyser (Saleae Logic 16 from aliexpress.com) to sda and scl lines and i was expected to see 400khz communication rate. But guess what i saw? First of all, rate is near 342khz (pulse period 2.92us) - that is first strange(unexpected) thing, because looking at the source code we can trace this part executing, while i2c module is initializing
//
// Initialize the I2C master module.
//
MAP_I2CMasterInitExpClk(ui32Base, ui32Clock, true);
where the ui32Clock is 40000000. According the data-sheet of the tm4c123gh6pm rev #15842.2741, page #1004, the formula to calculate expecting comm rate is SCL_PERIOD = 2 × (1 + TIMER_PRD) × (SCL_LP + SCL_HP) × CLK_PRD , where for our case CLK_PRD = 1/40000000; SCL_LP = 6; SCL_HP = 4; and TIMER_PRD is setting in time of I2CMasterInitExpClk execution. Checking the content of 0x4002.300C (I2C3 Master Timer Period (I2CMTPR) register address), we can see value of 0x04, which is providing us the the SCL_PERIOD = 2.5us. (as expected)
The second strange thing is that ratio scl_high/sch_low is 0.78 (on the screen: 1.28/(2.92-1.28)), but according the data-sheet it is fixed at 4/6 (0.666....).
So, do you have any ideas of what is going on?