I2C access from Windows without Arduino Firmata?

A place to talk about all the Operating Systems, Software & Hardware
Post Reply
User avatar
ikue
Posts: 2
Joined: Fri Apr 08, 2022 2:27 pm

Fri Apr 08, 2022 3:20 pm

Hi there,

I am new to the LattePanda Delta. Despite a lot of research on this topic, it is not clear to me yet how I2C can be accessed with this board.

As far as I understood, there are two options for I2C connectivity:
a) indirectly via the Leonardo (with Arduino Firmata) and Arduino ports on the board (D2 / D3 for SDA / SCL)
b) directly via Windows.Devices.I2C namespace and dedicated I2C pinouts on the board
-> purple circled area with 1.8 V, http://docs.lattepanda.com/content/delt ... layability

I need to use C# to access I2C. The ideal way would be directly, so option b.


After preparing a test program, I found out the following:
--------------
deviceSelector = I2cDevice.GetDeviceSelector();
controllers = await DeviceInformation.FindAllAsync(deviceSelector);
--------------
Problem: There are no controllers found.


Also if I try to access the I2C bus later on by
--------------
settings = new I2cConnectionSettings(MCP23017_ADDRESS1);
settings.BusSpeed = I2cBusSpeed.FastMode;
controller = await I2cController.GetDefaultAsync();
--------------
"controller" remains null and cannot be accessed.


Does anybody have a solution or suggestion for accessing the I2C bus directly from Windows?

User avatar
ccs_hello
Posts: 773
Joined: Sat Oct 13, 2018 9:16 pm

Wed Apr 20, 2022 3:44 pm

Note that the X86 side's I2C space is critical to system operation and system stability. I.e., not a playground, so please be careful.

From my very limited knowledge, reaching the I2C bus on X86 side needs to have sufficient knowledge and/or deep hacks on UEFI and ACPI.
This is why it's not seen in a typical Google Search result.
I.e., if you made a mistake on the X86 side, the loss can be the entire $400 board, while a mistake on the Arduino side and you burned it, your loss is less than $15, if choosing an external genuine Arduino board.

User avatar
ikue
Posts: 2
Joined: Fri Apr 08, 2022 2:27 pm

Sat Apr 30, 2022 12:46 pm

I do not see a point in these comments. It is clear that the I2C bus is also controlling other ICs, but this does not intervene with the option of controlling it from a proper Windows API (or native implementation).

Many other board manufacturers do this very well, like Advantech (SUSI API), Congatec and alike. From LattePanda, there seems to be no proper support at all. Routing all communication via the additional Atmel chip is not a good option.

User avatar
ccs_hello
Posts: 773
Joined: Sat Oct 13, 2018 9:16 pm

Tue May 03, 2022 12:26 pm

I think you have answered your own question, especially you mentioned Advantech and its SUSI API. You know Advantech is a specialized ICS firm doing all kind of industrial controls/embedded system (including X86 based embedeed system.) So its SUSI framework has shielded the underlying complexity and ugliness of I2C and SMbus. Not only that, its warranty term is quite genereous and the price is reflecting that as well.
Now that you ask if LP Alpha/Delta can accomplish that task, IMHO, in theory, that is possible. In reality, it is the time and cost invested in this direction. I can't answer that question. However, I'd suggest you look around to see if other "PC-like" SBC board, even it has brought out the I2C leads (just two pins), what can they do in this area, especially in support, longivity, stability, etc.

Ecosystem is the key! Not just two hareware pins.
My 2 cents and feel free to ignore my post. There is no need to start a debate.

User avatar
designersystems
Posts: 3
Joined: Thu Apr 21, 2022 4:47 pm

Wed May 04, 2022 12:46 pm

I have also been looking at using the x86 side I2C interfaces for SMbus communication for an external battery manager IC.

There are two I2C interfaces defined, I2C_0 and I2C_2, on the x86 side connector but little information about how these are accessible via Windows 10 and which interface to use for SMbus. As battery management is part of the standard Windows 10 ACPI functionality there should be hardware and low level driver support to allow this to happen.
I also need to access the I2C interfaces for external peripherals, similar to MCP23017, so it would be good to know if anyone has actually managed to do this ?

Post Reply