I2C controller tests in MITT

I2C test modules that are included in the MITT software package can be used to test data transfers for an I2C controller and its driver. The MITT board acts as a client device connected to the I2C bus.

Before you begin

Hardware setup

Picture of the MITT I2C hardware setup.

Bus interface Pin-out ACPI and schematics Connection solution
I2C All lines needed (SCL, SDA and GND) ACPI table Simple male block (on debug board)
  1. Connect the I2C adapter to JB1 on the MITT board.

    Picture of the MITT I2C header.

  2. Use the jumper on to the I2C header (above JB1) to select the correct I2C voltage between 3.3V and 1.8V. In this image, 1.8V is selected.

  3. Connect SCL, SDA, and GND pins on the adapter board to the exposed SCL, SDA, and GND lines on the system under test.

    Picture of the I2C adapter.

  4. Use the jumper on the I2C adapter board to select the correct I2C voltage between 3.3V and 1.8V. In this image, the 1.8V is selected.

  5. On the MITT board, set switch SW0 to the high position. This position enables the default mode for I2C when the MITT is powered.

    Picture of SW0 on the MITT board.

  6. Use the RESET button to power cycle the MITT board. If the wire connections to the I2C controller are correct, LD7 (SDA indicator) and LD6 (SCL indicator) turn on. If either LED doesn't turn on, there's a wiring issue because either SDA or, SCL, or both are pulled low.

Test driver and ACPI configuration

Perform these steps on the system under test that has the I2C controller:

  1. Install WITTTest driver included in the MITT software package by running this command:

    pnputil -a WittTest.inf

    Microsoft PnP Utility
    
    Processing inf :            WittTest.inf
    Driver package added successfully.
    Published name :            oem6.inf
    
    Total attempted:              1
    Number successfully imported: 1
    

    Note

    PnpUtil.exe is included in %SystemRoot%\System32.

  2. Modify the system ACPI and include this ASL table. You can use the Microsoft ASL compiler.

    Note

    Change "\\_SB_.I2C2" to ACPI entry name for the I2C controller to test.

    //TP1 100Khz Standard Target Device(TP1)
    Device(TP1) {
        Name (_HID, "STK0001")
        Name (_CID, "WITTTest")
        Method(_CRS, 0x0, NotSerialized)
        {
          Name (RBUF, ResourceTemplate ()
          {
            I2CSerialBus ( 0x11, ControllerInitiated, 100000,AddressingMode7Bit, "\\_SB_.I2C2",,, , )
          })
          Return(RBUF)
        }
    }
    
    //TP2 400Khz  Fast Target
    Device(TP2) {
        Name (_HID, "STK0002")
        Name (_CID, "WITTTest")
        Method(_CRS, 0x0, NotSerialized)
        {
          Name (RBUF, ResourceTemplate ()
          {
            I2CSerialBus ( 0x12, ControllerInitiated, 400000,AddressingMode7Bit, "\\_SB_.I2C2",,, , )
          })
          Return(RBUF)
        }
    }
    
    //TP3 1 Mhz  FastPlus Target
    Device(TP3) {
        Name (_HID, "STK0003")
        Name (_CID, "WITTTest")
        Method(_CRS, 0x0, NotSerialized)
        {
          Name (RBUF, ResourceTemplate ()
          {
            I2CSerialBus ( 0x13, ControllerInitiated, 1000000,AddressingMode7Bit, "\\_SB_.I2C2",,, , )
          })
          Return(RBUF)
        }
    }
    
    //TP4 1.4 Mhz High Speed, optional target
    Device(TP4) {
        Name (_HID, "STK0004")
        Name (_CID, "WITTTest")
        Method(_CRS, 0x0, NotSerialized)
        {
          Name (RBUF, ResourceTemplate ()
          {
            I2CSerialBus ( 0x14, ControllerInitiated, 1400000,AddressingMode7Bit, "\\_SB_.I2C2",,, , )
          })
          Return(RBUF)
        }
    }
    
    //TP5 3.4 Mhz High Speed, optional target
    Device(TP5) {
        Name (_HID, "STK0005")
        Name (_CID, "WITTTest")
        Method(_CRS, 0x0, NotSerialized)
        {
          Name (RBUF, ResourceTemplate ()
          {
            I2CSerialBus ( 0x15, ControllerInitiated, 3400000,AddressingMode7Bit, "\\_SB_.I2C2",,, , )
          })
          Return(RBUF)
        }
    }
    

    Note

    Only TP1-3 are required to run MITT I2C tests. TP4 and TP5 are optional targets.

I2C automation tests

  1. Create a folder on the system under test.

  2. Copy the TAEF binaries to the folder and then add it to your PATH environment variable. The required TAEF binaries are in %ProgramFiles(x86)%\Windows Kits\8.1\Testing\Runtimes\TAEF .

  3. Copy Muttutil.dll and Mitti2ctest.dll from the MITT software package to the folder.

  4. View all MITT I2C tests by using the /list option:

    "C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF\te" MITTI2CTest.dll /list

    Test Authoring and Execution Framework v3.7k for x64
    
    
            C:\Program Files(x86)\MITT\x64\MITTI2CTest.dll
                MITTI2CTest
                    MITTI2CTest::BasicIORead
                    MITTI2CTest::BasicIOWrite
                    MITTI2CTest::BasicIOSeq
                    MITTI2CTest::BasicIOKernel
                    MITTI2CTest::DeviceNACK
                    MITTI2CTest::LockUnlock
                    MITTI2CTest::CancelRead
                    MITTI2CTest::CancelWrite
                    MITTI2CTest::CancelSequence
                    MITTI2CTest::ClockStretching
                    MITTI2CTest::PerfRead
                    MITTI2CTest::PerfWrite
                    MITTI2CTest::PerfSequence
                    MITTI2CTest::BusRecovery
                    MITTI2CTest::Power
                    MITTI2CTest::Stress
    

You're now ready to run I2C tests. You can run a single test, all tests at once, or run tests manually.

  • Run a single test by using the /name:<test name> option. This command runs the BasicIORead test:

    "C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF\te" MITTI2CTest.dll /name:MITTI2CTest::BasicIORead

  • Run all tests by using this command:

    "C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF\te" MITTI2CTest.dll

  • Run tests manually by using SPBCmd.exe tool included in the MITT software package.

I2C adapter schematic

I2C adapter schematic diagram.