Omega2(+) I2C bus is not open drain

  • Omega2(+) FW: 0.1.10-b160 I2C bus is not open drain because Onion's software engineer / coder set the 31st bit of SM0CTL0 register to '1' ( I think in the omega2-bootloader).
    I'm afraid it's a fairly strange 'unique' I2C bus configuration in the embedded / IoT world since the SoC has a dedicated, working HW I2C.

    MediaTek MT7688 Datasheet Version: 1.4 Release date: 15th April 2016
    I2C Base address: (0x10000900)
    0x10000940 SM0CTL0 Serial interface master 0 control 0 register

    bit 31 SM0_ODRAIN Open-drain output configuration
    0: When SIF output is logic 1, the output is pulled high by outer devices.
    SIF output is open-drained.
    1: When SIF output is logic 1, the output is pulled high by SIF master 0.

    root@99A5:~# devmem 0x10000940
    0x8190800E # ie. 1000 0001 1001 0000 1000 0000 0000 1110
    # my workaround
    root@99A5:~# cat /etc/rc.local
    # Put your custom commands here that should be executed once
    # the system init finished. By default this file does nothing.
    devmem 0x10000940 32 0x0190800E
    exit 0
    root@99A5:~# devmem 0x10000940
    0x0190800E # ie. 0000 0001 1001 0000 1000 0000 0000 1110

    Dear Onion hardware @administrators please correct me if I am wrong.

  • How to test it with a multimeter?

    When the Omega2(+)'s I2C master is in idle state and there aren't any I2C slave devices connected to the bus (ie. no I2C communication) the bus is free - both SDA and SCL lines are HIGH.

    1. Do measure the voltage of the SDA pin / line with a multimeter (positive wire to SDA, negative to GND).
      Let's say it is about +3.2V.

    2. Connect a 4.7kOhm resistor between the SDA pin and GND.

    • I2C is not open drain
      if the measured voltage is almost same than before (about +3.2V)

    • I2C is open drain (and the line has a 4.7kOhm pull-up resistor under the shield)
      if the measured voltage is about half than before (about +1.6V)

  • It's not open drain by default - but the situation is not so simple - and fairly interesting.
    I'll try to describe the details in the near future...

  • Do you have any other details to share?

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.