Connect to I2C

userHead cmoetzing 2016-06-18 07:31:24 16515 Views16 Replies
I want to connect some sensor via I2C. As I understand the I2C connectors are connected to the CPU (area U1). I guess this means there is no need to run things over RemoveDevice() in C#. I found ... ta.xaml.cs as example. I guess I can access them directly through this lib, but what are the addresse? Can find anything on that.

Thx in advance
2016-08-04 17:44:58 new firmata here: ... ndaFirmata
userHeadPic LattePanda
2016-08-04 03:59:58 I am not a Windows .NET pro.

I guess just by adding the I2C namespace we do not magically get the functionality.

Code: Select all

I2cDevice.GetDeviceSelector(); get me following selector

Code: Select all

System.Devices.InterfaceClassGuid:="{A11EE3C6-8421-4202-A3E7-B91FF90188E4}" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True But I can not get a device or a controller. Both calls yield nothing.

Code: Select all

DeviceInformationCollection deviceInfos = await DeviceInformation.FindAllAsync(selector); I2cController controller = await I2cController.GetDefaultAsync(); I gues there is a reason why the Windows IoT image only exists for some hand picked CPUs. They are probably wired in the framework and our CPU is not.
userHeadPic cmoetzing
2016-08-04 03:45:49 I had a look at the examples.

Code: Select all

I2cConnectionSettings(ACCEL_I2C_ADDR) In the example the I2C_ADDR is a magical 0x53 stating it is the correct one for a specific CPU. How do I obtain that address other than from


Oh wait, that is what we are missing all along. Stuck again after 5 mins.
userHeadPic cmoetzing
2016-07-31 16:51:09 So I have found a way for using I2C of atom processor. You need to add to reference Windows IoT Extensions for the UWP (Reference Manager - Universal Windows - Extensions). So you can get access to Windows.Devices.I2c namespace. The example for it: ... elerometer and ... ge.xaml.cs.
So till Default Firmata does not work properly you can use i2c from Z8300.
userHeadPic Pe4eHbKa
2016-07-17 17:43:15 So we are still waiting and waiting for the promised documentation. userHeadPic cmoetzing
2016-07-09 16:07:34
m-obi wrote:For me, I have to use the I2C from Z8300.(...)
Yes, me too ! I would like to use one of the I2Cs for fan control and power management.

So please LattePanda team, give us some more information.
Voltage level, differences between I2C-0, I2C-2, I2C-DDIO(?) and some C# examples for API(??) calls.
userHeadPic Lutz
2016-07-09 06:55:34 For me, I have to use the I2C from Z8300. Because I'm using the Arduino as ISP-Programmer. userHeadPic m-obi
2016-07-09 01:39:50 I believe the problem is USB/Serial driver support for the Arduino Leonardo board under the .NET core framework i.e. the IOT sample quoted should work on Windows 10 if LattePanda/Microsoft fixed the USB support. Until then, we are stuck with Arduino scripts and wpf/winforms serial communications using System.IO.Ports i.e. the old System.Core

See the UWP firmata thread for more info.
userHeadPic srcox
2016-07-08 03:14:46 But we have no Win 10 IoT on the LP. It's just Win 10. userHeadPic m-obi
2016-07-08 02:48:00 There is some example of using I2C without arduino (Atom Z8300 has it`s own I2C interface) ... elerometer
userHeadPic Pe4eHbKa
2016-07-08 02:21:47 We are all still waiting. Any updates? userHeadPic m-obi
2016-06-27 16:31:23 sorry for delayed response, guys. we will get some documentation up in due course. userHeadPic LattePanda
2016-06-26 14:10:56
cmoetzing wrote: (...)
How can we write to I2C via RemoteWiring when I2C is placed in area U1 which is not connected to ATmega32u4? Can you please provide some example?
@LattePanda team : we still need an answer to this...
Maybe not a complete example, but a link to a page with explanations
userHeadPic Lutz
2016-06-18 22:35:37 I still would be intereste in some info to connect to the I2C directly. I guess the way over RemoteWiring won't work either right now thanks to this littel bug viewtopic.php?f=6&t=209.

Somehow disappointing experience working whith this little device...
userHeadPic cmoetzing
2016-06-18 19:20:50 I think, there are 4 different I2C-Interfaces :
I2C-0, I2C-2, I2C-DDIO on 10-pin-header connected to the CPU
I2C on 24-pin-header connected to Arduino-D2 and -D3 (Meant by Lattepanda team in the quote ?)
( ... ral_device )

Additional question : What voltage level is used on the CPU-I2Cs ?
Maybe 1,8V and we need level shifter IC ?
Or the CPU-I2C-Pins are 5V tolerant (I don't think so) ?
userHeadPic Lutz
2016-06-18 18:44:28 I gues the above link to Windows IoT Core is a wrong hint. The IoT Core Image does not exist for LP.

Please Lattapanda team explain this part:
Windows Remote Arduino enables the following functionality out of the box:
1. GPIO – Analog and Digital I/O * digitalWrite - Digital Write * digitalRead - Digital Read * analogWrite - Analog Write * analogRead - Analog Read * pinMode - Set the mode for any pins. * Eventing - receive events when values change / are reported 2. I2C/TwoWire * Send/Receive data to and from other devices over I2C 3. Custom protocols via Firmata SysEx command
How can we write to I2C via RemoteWiring when I2C is placed in area U1 which is not connected to ATmega32u4? Can you please provide some example?
userHeadPic cmoetzing