i2c problem with windows 10

Options
Sergei
Sergei New Member Posts: 2
Hello, community!
i am programming up board in C#. OS: windows 10 x64
is there any way to make i2c work? without peripherals, up board is not more than a toy.
i have used this project as a reference: https://developer.microsoft.com/en-us/windows/iot/samples/i2cportexpander

here is the code i took from raspberry pi project:
I2cDevice i2cPortExpander;
...
var i2cSettings = new I2cConnectionSettings(0x01);
string deviceSelector = I2cDevice.GetDeviceSelector("I2C1");
var i2cDeviceControllers = await DeviceInformation.FindAllAsync(deviceSelector);
i2cPortExpander = await I2cDevice.FromIdAsync(i2cDeviceControllers[0].Id, i2cSettings);


i tried this code on my rpi board (OS windows 10 iot), and everything works fine.
but if i try the same on up board, the i2cDeviceControllers value has zero length (on rpi it had 1 member that i could access),
thats why the next function throws exception when i try to access i2cDeviceControllers[0]
tried to rewrite it somehow, 4 example string deviceSelector = I2cDevice.GetDeviceSelector();
i tried different names in the parameters of GetDeviceSelector - nothing brought any result.

is it because of OS i use on the up board? all i2c controller drivers have been successfully installed.
there were I2cController and II2cControllerProvider classes, i think, i must use them, but how?

best regards, Sergei.

Comments

  • Aling
    Aling Guest Posts: 561 admin
    Options
    In Windows, the way to enable I2C may be different from in R-Pi.
    Here is information from our technical team:
    **
    I2C driver, it depends on what end device will connect. BIOS has to claim the resource for the I2C end device for Windows to aware the existence of the end device.
    ***
    At this moment Taiwan team is away for CNY now, if you still can not sort it out, let's wait for them to be back soon.
  • Martin Mayr
    Martin Mayr New Member Posts: 54
    edited February 2017
    Options
    Hello did you get any update about your request for I2C on UP board yet ?
    I will have earlier or later the same request ... (not yet far enough with my Up board but I think it will be interesting to get I2C HAT boards on the UP board running ...
    Please inform me if you have any news about it ...
    At the moment I just start with the GPIO of the board ... under C# ... idem Win10 x64 ...
    Best regards
    Martin
    mmayr@mmm-it.com
Privacy Policy