AnsweredAssumed Answered

LPC15xx I2C timing slightly different than described in the manual?

Question asked by volkeroth on Sep 24, 2016
Latest reply on Apr 11, 2017 by Carlos_Mendoza

I implemented an I2C driver for the LPC1549 and was puzzled to see that the timing is not quite as expected.
I'm using a clock frequency of 72MHz and an I2C clock divider of 18 (so I write the value 17 to CLKDIV) so the I2C peripheral clock is 4MHz.
According to the manual, writing 0x33 to MSTTIME should result in 5 clock ticks high (1.25µs), 5 clock ticks low (1.25µs) and a clock frequency of 400kHz (2.5µs period).
That is not the case though. The resulting frequency is 363.72kHz because the low period is 1.49µs (well, considering the slew rate probably more like 1.5µs) instead of 1.25µs.
So obviously a value of 3 in MSTSCLLOW doesn't lead to 5 clock ticks (1.25µs @4MHz) as the manual says but to 6 clock ticks (1.5µs @ 4MHz).
When I change my code to assume that the value written to MSTSCLLOW is actually three (instead of two) ticks lower than what the peripheral uses, I get a perfect 400kHz.
So is this a mistake in the manual???

Outcomes