Communicate through i2c with the DLP3010

Post Reply
TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Communicate through i2c with the DLP3010

Unread post by TedJack » Thu Jan 05, 2017 1:28 am

Hi there,

I'm trying to communicate through i2c with the DLP3010 using an ODROID-XU4.

I'm also using the i2ctools to send command to the DLP3010.

I can detect the device using i2cdetect and I get this address: 0x1B in accordance to the datasheet http://www.ti.com/lit/ug/dlpu020a/dlpu020a.pdf.

What I wanna do is to Write Display Image Orientation.

The DLP3010 address is: 0x1B
The register address: 0x14
The data address: 0x04

So the command I'm sending is:

i2cset -y 4 0x1B 0x14 0x04

But it doesn't work at all and I get:
Error: Write failed

Maybe I misunderstood something. Do you have any idea what I'm doing wrong?

Kind regards,

User avatar
rooted
Posts: 6440
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by rooted » Thu Jan 05, 2017 4:04 am

Try the command as root.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Thu Jan 05, 2017 11:50 am

Is the DLP3010 is 1.8Volt interface compatible?

Also check the I2C bus numbers.
http://odroid.com/dokuwiki/doku.php?id= ... odroid-xu4

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Thu Jan 05, 2017 4:48 pm

odroid wrote:Is the DLP3010 is 1.8Volt interface compatible?

Also check the I2C bus numbers.
http://odroid.com/dokuwiki/doku.php?id= ... odroid-xu4
I've already tried it as root and the DLP runs on 3.3V. I'm using a Bidirectional 1.8V to 3.3V Level shifter.

Also, I've noticed that there's a mistake in the documentation.
On the ODROID-XU4, the hardware i2c: PIN 14 (SCL) and PIN 16 (SDA) is actually at I2C-4: /dev/i2c-4 not at /dev/i2c-3.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Thu Jan 05, 2017 6:52 pm

We will double check the I2C numbering tomorrow on the latest kernel update.
And we will test the weather board functionality with Pin14 and Pin16.

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Thu Jan 05, 2017 8:03 pm

odroid wrote:We will double check the I2C numbering tomorrow on the latest kernel update.
And we will test the weather board functionality with Pin14 and Pin16.
Great! Do you know the default speed of the I2C line? And how to change it?

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Thu Jan 05, 2017 8:23 pm

The actual speed was around 340Khz even we set it 400khz mode in Kernel configuration.
The GPIO Bitbang I2C was 100Khz as far as I remember.

One user already confirmed I2C#3 was moved to I2C#4 with a certain kernel update a couple of months ago. :(
We will check it again tomorrow.

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Fri Jan 06, 2017 12:11 am

I'm not sure if I understood. Is the speed 100khz or 340khz?

User avatar
rooted
Posts: 6440
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by rooted » Fri Jan 06, 2017 2:34 am

Through hardware it's 340, software is 100.

At least I believe this is what odroid is saying.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Fri Jan 06, 2017 4:52 pm


TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Fri Jan 06, 2017 10:32 pm

odroid wrote:HW is 370Khz and SW is 28Khz only.
http://odroid.com/dokuwiki/doku.php?id= ... 2c_signals
Okay I got it thanks. How can I set the HW i2c to 100Khz?

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Sat Jan 07, 2017 10:37 am

You might need to change the I2C device driver kernel source code.
https://github.com/hardkernel/linux/blo ... os5.c#L149

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Sat Jan 07, 2017 7:11 pm

odroid wrote:You might need to change the I2C device driver kernel source code.
https://github.com/hardkernel/linux/blo ... os5.c#L149
Oh really? There's no easiest way doing this?
Assuming that I modify the driver. What is the next step to put it back on the ODROID?
Do I have to rebuild everything?

Please guide me a little bit. I'm a bit confused on how to pull that off.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Sun Jan 08, 2017 2:01 pm

Try to build/install the kernel source on XU4 first.
http://odroid.com/dokuwiki/doku.php?id= ... nux_kernel

If it works, just edit the code and build it again.

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Sun Jan 08, 2017 8:38 pm

odroid wrote:Try to build/install the kernel source on XU4 first.
http://odroid.com/dokuwiki/doku.php?id= ... nux_kernel

If it works, just edit the code and build it again.
Okay Imma try this on Ubuntu but my main goal is to do it on Android 7.1 (CM14.1). I should have mentioned this.

Is it related?

Kind regards,

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Mon Jan 09, 2017 11:26 am

Android needs the cross compiling.

Let's try a simpler way. We followed below steps in XU4 Ubuntu 16.04 image.

1. Get a dts from dtb via devicetree tools.
sudo dtc -I dtb -O dts -o 100k.dts /media/boot/exynos5422-odroidxu3.dtb

2. Find the i2c@12c70000 section in the dts file with an editor.
vi 100k.dts

3. Change samsung,i2c-max-bus-freq
0x3d0900->0x186a0

4. Compile the dts to dtb
sudo dtc -I dts -O dtb -o /media/boot/exynos5422-odroidxu3.dtb 100k.dts

After this change, we could get around 70Khz with an oscilloscope.

Try a similar steps on your Linux PC to manage the Android DT files.

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Mon Jan 09, 2017 7:49 pm

odroid wrote:Android needs the cross compiling.

Let's try a simpler way. We followed below steps in XU4 Ubuntu 16.04 image.

1. Get a dts from dtb via devicetree tools.
sudo dtc -I dtb -O dts -o 100k.dts /media/boot/exynos5422-odroidxu3.dtb

2. Find the i2c@12c70000 section in the dts file with an editor.
vi 100k.dts

3. Change samsung,i2c-max-bus-freq
0x3d0900->0x186a0

4. Compile the dts to dtb
sudo dtc -I dts -O dtb -o /media/boot/exynos5422-odroidxu3.dtb 100k.dts

After this change, we could get around 70Khz with an oscilloscope.

Try a similar steps on your Linux PC to manage the Android DT files.
Thanks for the very clear answer.

One more question:

Are you sure that the i2c on bus 4 (i2c-4) is i2c@12c70000?

Cause I did what you wrote but it didn't really affect the clock speed.

Kind Regards,

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Tue Jan 10, 2017 10:07 am

We will check the address on our official Android 4.4 DT file.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Tue Jan 10, 2017 6:37 pm

Android OS doesn't have the I2C driver in the kernel.
You need to apply this patch to the kernel dtsi to enable the HW I2C bus on 30pin header.

Code: Select all

diff --git arch/arm/boot/dts/exynos5422-pinctrl.dtsi arch/arm/boot/dts/exynos5422-pinctrl.dtsi
index 7a91ef0..7df990b 100755
--- arch/arm/boot/dts/exynos5422-pinctrl.dtsi
+++ arch/arm/boot/dts/exynos5422-pinctrl.dtsi
@@ -575,14 +575,12 @@
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <0>;
 		};
-/*
 		i2c1_bus: i2c1-bus {
 			samsung,pins = "gpb3-3", "gpb3-2";
 			samsung,pin-function = <2>;
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <3>;
 		};
-*/
 		i2s1_bus: i2s1-bus {
 			samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
 					"gpb0-4";
diff --git arch/arm/boot/dts/exynos5422_evt0.dtsi arch/arm/boot/dts/exynos5422_evt0.dtsi
index 9917ace..00d77cd 100755
--- arch/arm/boot/dts/exynos5422_evt0.dtsi
+++ arch/arm/boot/dts/exynos5422_evt0.dtsi
@@ -578,7 +578,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-/*
 	i2c_1: i2c@12C70000 {
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x12C70000 0x1000>;
@@ -591,7 +590,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-*/
 /*
 	i2c_2: i2c@12C80000 {
 		compatible = "samsung,s3c2440-i2c";

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Wed Jan 11, 2017 1:55 am

odroid wrote:Android OS doesn't have the I2C driver in the kernel.
You need to apply this patch to the kernel dtsi to enable the HW I2C bus on 30pin header.

Code: Select all

diff --git arch/arm/boot/dts/exynos5422-pinctrl.dtsi arch/arm/boot/dts/exynos5422-pinctrl.dtsi
index 7a91ef0..7df990b 100755
--- arch/arm/boot/dts/exynos5422-pinctrl.dtsi
+++ arch/arm/boot/dts/exynos5422-pinctrl.dtsi
@@ -575,14 +575,12 @@
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <0>;
 		};
-/*
 		i2c1_bus: i2c1-bus {
 			samsung,pins = "gpb3-3", "gpb3-2";
 			samsung,pin-function = <2>;
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <3>;
 		};
-*/
 		i2s1_bus: i2s1-bus {
 			samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
 					"gpb0-4";
diff --git arch/arm/boot/dts/exynos5422_evt0.dtsi arch/arm/boot/dts/exynos5422_evt0.dtsi
index 9917ace..00d77cd 100755
--- arch/arm/boot/dts/exynos5422_evt0.dtsi
+++ arch/arm/boot/dts/exynos5422_evt0.dtsi
@@ -578,7 +578,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-/*
 	i2c_1: i2c@12C70000 {
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x12C70000 0x1000>;
@@ -591,7 +590,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-*/
 /*
 	i2c_2: i2c@12C80000 {
 		compatible = "samsung,s3c2440-i2c";
Okay I see but Can you please give me the steps to follow to apply this patch to the kernel dtsi on Android?

I'm not really familiar with that.

Kind regards,

lsc1117
Posts: 101
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by lsc1117 » Wed Jan 11, 2017 10:44 am

Hi,

You can apply the patch to the android kernel source with following command.

cd /path/to/linux

patch -p0 < patchfile

TedJack
Posts: 118
Joined: Thu Oct 27, 2016 10:50 pm
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by TedJack » Sun Jan 29, 2017 1:53 am

odroid wrote:Android OS doesn't have the I2C driver in the kernel.
You need to apply this patch to the kernel dtsi to enable the HW I2C bus on 30pin header.

Code: Select all

diff --git arch/arm/boot/dts/exynos5422-pinctrl.dtsi arch/arm/boot/dts/exynos5422-pinctrl.dtsi
index 7a91ef0..7df990b 100755
--- arch/arm/boot/dts/exynos5422-pinctrl.dtsi
+++ arch/arm/boot/dts/exynos5422-pinctrl.dtsi
@@ -575,14 +575,12 @@
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <0>;
 		};
-/*
 		i2c1_bus: i2c1-bus {
 			samsung,pins = "gpb3-3", "gpb3-2";
 			samsung,pin-function = <2>;
 			samsung,pin-pud = <3>;
 			samsung,pin-drv = <3>;
 		};
-*/
 		i2s1_bus: i2s1-bus {
 			samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
 					"gpb0-4";
diff --git arch/arm/boot/dts/exynos5422_evt0.dtsi arch/arm/boot/dts/exynos5422_evt0.dtsi
index 9917ace..00d77cd 100755
--- arch/arm/boot/dts/exynos5422_evt0.dtsi
+++ arch/arm/boot/dts/exynos5422_evt0.dtsi
@@ -578,7 +578,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-/*
 	i2c_1: i2c@12C70000 {
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x12C70000 0x1000>;
@@ -591,7 +590,6 @@
 		clock-names = "rate_i2c", "gate_i2c";
 		status = "disabled";
 	};
-*/
 /*
 	i2c_2: i2c@12C80000 {
 		compatible = "samsung,s3c2440-i2c";
When I execute the patch, it doesn't work. I obtain the output below from the terminal.

Code: Select all

$ patch < i2cpatch.patch 
(Patch is indented 4 spaces.)
patching file exynos5422-pinctrl.dtsi
Hunk #1 FAILED at 575.
1 out of 1 hunk FAILED -- saving rejects to file exynos5422-pinctrl.dtsi.rej
(Patch is indented 4 spaces.)
patching file exynos5422_evt0.dtsi
Hunk #1 FAILED at 578.
Hunk #2 FAILED at 590.
2 out of 2 hunks FAILED -- saving rejects to file exynos5422_evt0.dtsi.rej
I'll try to edit the file manually.

lsc1117
Posts: 101
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by lsc1117 » Tue Jan 31, 2017 10:19 am

Okay,
You can just remove the comments to enable the H/W I2C(i2c70000).

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Communicate through i2c with the DLP3010

Unread post by odroid » Tue Feb 07, 2017 10:11 am

The latest Android update has enabled the I2C port by default.
http://odroid.com/dokuwiki/doku.php?id= ... _note_v4.4

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 6 guests