Other Parts Discussed in Thread: EK-TM4C1294XL
I'm working on the Ek-TM4C1294XL. So I was trying the i2c . While
configuring the I2C master bus i found the following calculations in the i2c.c driver file (also using i2c driver from Software Development Kit)
ui32I2CClk = 16000000(Clock Frequency)
ui32SCLFreq = 100000(Standard Mode)
ui32TPR = ((ui32I2CClk + (2 * 10 * ui32SCLFreq) - 1) /
(2 * 10 * ui32SCLFreq)) - 1;
HWREG(ui32Base + I2C_O_MTPR) = ui32TPR;
After calculating I got 8.99 value on the paper. But in the MTPR register.
i'm getting 0x07 value?? How is this possible can anybody please explain me??
Also when i checked datasheet the calculations are different??
SCL_PERIOD= 2 × (1 +TIMER_PRD) × (SCL_LP+SCL_HP) ×CLK_PRD
For example:
CLK_PRD= 50 ns
TIMER_PRD= 2
SCL_LP=6
SCL_HP=4
yields a SCL frequency of:
1/SCL_PERIOD= 333 Khz
Please can anybody explain??????