I2C transfer speed

Hi there on the G400D module, is it a hardware limitation to only support 2 modes of transfer?

What do you mean? Please clarify

Yes it is a hardware limitation.

  • The G400D uses the Microchip SAM9X35 MPU.

  • I2C compatible I/O is provided by this chip using the Two Wire Interface (TWI) peripheral.

  • The TWI support standard mode speed I/O @ 100KHz and the fast mode speed I/O @ 400KHz

  • The GHI TinyCLR I2C library supports fast mode and standard mode

      var settings = new I2cConnectionSettings(0x1C);   
      settings.BusSpeed = I2cBusSpeed.FastMode;
    

OR

    var settings = new I2cConnectionSettings(0x1C);     
    settings.BusSpeed = I2cBusSpeed.StandardMode;

Others modes like the Fast mode plus @ 1Mbit/s or high speed mode @ 3.4 Mbit/s are not available on the G400D.

What is the device that you want to interface ? What is the max speed that the device supports ?

oh! Now I understand.

Thanks that’s the answer I’m looking for :slightly_smiling_face:, @Gus_Issa do you have plans for supporting the two higher modes on any future products?

Can you please share more details about your application?

I believe the G400 can support I2C clock rates “up to” 400 kHz and I’m really, really hoping TinyCLR maintains this functionality. From the Atmel-11055F-ATARM-SAM9X35-Datasheet_31-Aug-15 data sheet:

  1. Two-wire Interface (TWI)
    37.1 Description
    The Atmel Two-wire Interface (TWI) interconnects components on a unique two-wire bus, made up of one clock line and one data line with speeds of up to 400 Kbits per second, based on a byte-oriented transfer format. It can be used with any Atmel Two-wire Interface bus Serial EEPROM and I²C compatible device

In .Net Micro, you have to define the clock rate when you configure the I2C port and it seems like you can pick any value you want up to 400 kHz. We have to work with SMBus devices that have a clock rate specified as 20 to 100 kHz. The specific devices we have to work with only work at 20 kHz. As I said earlier, I’m really hoping that TInyCLR will continue with the abilty to set the I2C clock rate at any value up to the maximum the specific MPU being targeted supports.

You could modify the AT91SAM9X35_I2c_SetActiveSettings function on AT91SAM9X35_I2C.cpp to try and achieve this.

We will look into this request.

Great, thanks.