mbed i2c library, maximum frequency?

16 Feb 2012

Hi,

I have an i2c input expander, namely a MCP23017 device. The datasheet claims that the device will operate up to 1.7MHz, although this frequency is not included in the i2c standard. Is the mbed i2c library capable of running at this rate?

Thanks, James

16 Feb 2012

James Spadavecchia wrote:

Is the mbed i2c library capable of running at this rate?

Yes, it should. I have not tested it. Let me know otherwise.

LPC17xx user manual wrote:

Three enhanced I2C-bus interfaces, one with an open-drain output supporting the full I2C specification and Fast mode plus with data rates of 1Mbit/s.

17 Feb 2012

I'm not so sure, that the two I2C ports available on mbed (LPC1768) will support Fast Mode Plus (1 Mbps):

LPC17xx user manual wrote:

Remark: I2C0 pins SDA0 and SCL0 are open-drain outputs and fully I2C-bus compliant (see Table 73). I2C0 can be further configured through the I2CPADCFG register to support Fast Mode Plus (See Table 99).
Remark: I2C0 is not available in the 80-pin package.
Remark: I2C pins that do not use specialized I2C pads (as identified in Table 73) can be configured to an open-drain mode via the relevant IOCON registers, and can be used with fast mode (400 kHz) and standard mode (100 kHz) I2C. These pins do not include an analog filter to suppress line glitches, but a similar function is performed by the digital filter in the I2C block itself. These pins should be configured as: no pull-up, no pull-down, open drain mode.

So only I2C0 supports Fast Mode Plus and as far as i know, mbed uses I2C1 and I2C2 and not the specialized Pins for I2C0. I2C1 and I2C2 only support Standard Mode (100 kbps) and Fast Mode (400 kbps) per spec. It might work ok with higher datarates though, but i wouldn't count on reliability.

Best regards
Neni