New I2C-Configuration on J4 (8-pin Header)

Post Reply
User avatar
Panzerknacker
Posts: 244
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, X2, XU3, XU4, W
Contact:

New I2C-Configuration on J4 (8-pin Header)

Unread post by Panzerknacker » Thu Mar 27, 2014 10:58 pm

I use several i2c-sensors on i2c-4 that is connected to J4 (8-pin header).
Pin1 of J4 = GPIO-pin 199 = GPX1.0 = XE.INT8 = SCL
Pin3 of J4 = GPIO-pin 200 = GPX1.1 = XE.INT9 = SDA

Starting with kernel 3.8.19 (of today 27.03.14)
i2c-4 is not enabled automatically anymore.
/usr/src/linux/arch/arm/mach-exynos/machhkdk4412.c has changed.

To get it back load the custom gpio i2c module:
root@odroidu3:~# modprobe i2c_gpio_custom bus0=4,200,199

You get:
root@odroidu3:~# i2cdetect -l
i2c-0 i2c s3c2410-i2c I2C adapter
i2c-1 i2c s3c2410-i2c I2C adapter
i2c-2 i2c i2c-gpio2 I2C adapter
i2c-3 i2c s3c2410-i2c I2C adapter
i2c-4 i2c i2c-gpio4 I2C adapter
i2c-7 i2c s3c2410-i2c I2C adapter
i2c-8 i2c s3c2410-i2c I2C adapter

Pressure sensor in i2c-4 is back:
root@odroidu3:~/mehari/i2c-bmp085# ./testBMP085
Temperature 21.9°C
Pressure 949.68hPa

To load it automatically at boot:
add the module to /etc/modules

Code: Select all

root@odroidu3:/~# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

# Use i2c-gpio-custom bus[0..3]=i2cbus-nr,sda-pin,sdc-pin
i2c-gpio-custom bus0=4,200,199
i2c-dev
w1_therm


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

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by odroid » Fri Mar 28, 2014 12:10 pm

We should let you know first. :oops:
Thank you for the guide!

Because some people wanted to use the Pin#1 & #3 as a normal GPIO instead of I2C, we've removed the i2c-gpio.4 platform driver.
After kernel update, you can access the Pin#1 of XE.INT8(gpio199) and Pin#3 of XE.INT9(gpio200)

If you want to enable the I2C, please use the "i2c-gpio-custom" driver as Panzerknacker mentioned.

#ex) modprobe i2c-gpio-custom bus0=bus_num,sda_pin,scl_pin
modprobe i2c-gpio-custom bus0=4,200,199

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Tue Jul 08, 2014 3:52 pm

Hi

Kindly correct me if I am wrong

Pin 1 = SCL, pin 3 = SDA, pin 7= GND, pin 8 = PWR...

With this I can make qa standard I2C wiring and connect it with any board that
has I2C compatibility without the need of a IO shield

After connecting it, I need to activate it by using "i2c-gpio-custom"

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

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by odroid » Tue Jul 08, 2014 4:17 pm

Refer the schematics of IO shield.
http://www.hardkernel.com/main/products ... &tab_idx=2

It will be helpful to make your own add-on board.

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Tue Jul 08, 2014 5:49 pm

IS it necessary to use the shield or we can make connections from the U3 itself...if yes, how

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

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by odroid » Tue Jul 08, 2014 6:06 pm

No.. you don't need it.
Just a reference for your design.

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Tue Jul 08, 2014 6:22 pm

I can use male headers and wires with connectors for the purpose

I believe the pin arrangement that I have mentioned above would enable I2C configuration

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

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by odroid » Tue Jul 08, 2014 6:30 pm

It is the main reason why I recommended the schematics.
You must understand our shield schematics before you start to design your own hardware.

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Wed Jul 23, 2014 12:44 pm

hi


The I2C bus requires VDD, SCL, SDA, GND. kindly mention the pin numbers of the GPIO port on the odroid-u3
Though I have some idea, I will be eternally grateful if you could explain by means of a drawing

User avatar
memeka
Posts: 4081
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by memeka » Wed Jul 23, 2014 1:04 pm


funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Wed Jul 23, 2014 1:37 pm

Thanks a lot memeka

I have some doubts reg the diagram
1. what is that after UART Rx (pin 2)
2. For I2C, where can I take SCL and SDA, may I use GPIO 199 (pin 1) and GPIO 200 (pin 3)

User avatar
memeka
Posts: 4081
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by memeka » Wed Jul 23, 2014 1:50 pm

1. VDD 1.8V
2. Don't know
but
if you look at the schematics like @odroid said: https://docs.google.com/file/d/0B4UPrML ... BwMjQ/edit
8-port pin on io shield is JP2 first in top left
then in top right you see SCL is GPX1.0 and SDA is GPX1.1
that;s pins 1 and 3 on JP2
thats GPIO199 and GPIO200
so, my conclusion:
* GPIO199 is SCL
* GPIO200 is SDA
* VDD is 1k8V
* GND is GND

of course i do not vouch this is accurate am I not responsible for whatever happens if I am wrong :P

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Wed Jul 23, 2014 1:56 pm

Thanks a lot

I can also draw 5V from pin 8

User avatar
memeka
Posts: 4081
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by memeka » Wed Jul 23, 2014 2:00 pm

yes, but SCL and SDA will work on 1.8V, if you put 5V on them you have a chance of frying the board...

so if you want to use 5V, then make sure you put a level shifter on those 2 GPIOs and then use the 5V pin for VDD and forget the 1.8V pin

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Wed Jul 23, 2014 2:06 pm

thank you

Respectech
Posts: 279
Joined: Wed Nov 13, 2013 9:20 am
languages_spoken: English, German, some Ukrainian, some Spanish
ODROIDs: All the ODROIDs!!

Well, the ones released since the U2.
Location: California
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Respectech » Sat Sep 06, 2014 3:23 am

memeka, regarding your response where you said: "does https://lh5.googleusercontent.com/EpPyb ... w1896-h859 help ?"

When I click that link, it says that I am not authorized to view that.

funfrancis
Posts: 60
Joined: Wed Jun 11, 2014 12:24 pm
languages_spoken: english
ODROIDs: Odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by funfrancis » Wed Sep 10, 2014 10:27 pm

You can have a look at the attachment on the pin config

(this is the file that was not opening for you)
Attachments
Odroid Pin Config.jpg
Odroid Pin Config.jpg (196.7 KiB) Viewed 15045 times

ptp
Posts: 2
Joined: Thu Oct 30, 2014 11:26 am
languages_spoken: english
ODROIDs: odroid u3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by ptp » Thu Oct 30, 2014 12:00 pm

Hello everyone,

@Funfrancis:

Thank you for the picture, it's very helpful. That should be part of odroid technical detail.

I have a few questions:

1) SPI
if i have the board in the same position as the funfrancis picture.
1 - bottom left
3 - bottom right
2 - top left
4 - top right

2) UART connector
Is the uart connector different from the uart in the gpio 2x4 connector ? Can i use the uart in the same away as the gpio ? If yes how can i disable the console output ? and what is the linux device name ?

3) GPIO Connectors ?
what is the specs of the pins headers, i tried a few and even breadboard pins are not a match, where can i buy a male connector (4x2) and (2x2).

Any help will be very appreciated,

Regards,
Pedro

mdrjr
Site Admin
Posts: 11698
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by mdrjr » Thu Oct 30, 2014 11:53 pm

ptp wrote:Hello everyone,

@Funfrancis:

Thank you for the picture, it's very helpful. That should be part of odroid technical detail.

I have a few questions:

1) SPI
if i have the board in the same position as the funfrancis picture.
1 - bottom left
3 - bottom right
2 - top left
4 - top right

2) UART connector
Is the uart connector different from the uart in the gpio 2x4 connector ? Can i use the uart in the same away as the gpio ? If yes how can i disable the console output ? and what is the linux device name ?

3) GPIO Connectors ?
what is the specs of the pins headers, i tried a few and even breadboard pins are not a match, where can i buy a male connector (4x2) and (2x2).

Any help will be very appreciated,

Regards,
Pedro
This is a thread for the i2c configuration, please create your own thread with questions that aren't about i2c ....

spartacusRising
Posts: 10
Joined: Fri Apr 11, 2014 12:55 am
languages_spoken: english
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by spartacusRising » Sat Jan 24, 2015 12:53 pm

Hello Folks,
I used the modprobe command:

Code: Select all

# modprobe i2c_gpio_custom bus0=4,200,199
This worked in getting the i2c-4. I also added the lines to the /etc/modules directory. However after i tried the command:

Code: Select all

# i2cdetect -l
I received:
-bash: i2cdetect: command not found
I thought this command would show the adapters as Panzerknacker said:
You get:
root@odroidu3:~# i2cdetect -l
i2c-0 i2c s3c2410-i2c I2C adapter
i2c-1 i2c s3c2410-i2c I2C adapter
i2c-2 i2c i2c-gpio2 I2C adapter
i2c-3 i2c s3c2410-i2c I2C adapter
i2c-4 i2c i2c-gpio4 I2C adapter
i2c-7 i2c s3c2410-i2c I2C adapter
i2c-8 i2c s3c2410-i2c I2C adapter
What can I do to enable the command and the i2c? I am trying to use the gpio shield but am failing. I have been through the February article to set it up and following the Accessing I/O Shield page, http://forum.odroid.com/viewtopic.php?f=80&t=8685 but the example from the u3_shield_GPIO_sysfs.c is not working.
I looked in my /sys/class/gpio directory and none of the gpio pins on the board are there:
  • gpio#289~#304
What do I need to do to get the pins recognized?
I will appreciate any and all help!

User avatar
Panzerknacker
Posts: 244
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, X2, XU3, XU4, W
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Panzerknacker » Sat Jan 24, 2015 5:02 pm

for i2c-detect do:
sudo apt-get install i2c-tools

btw GPIO-numbering may have changed, s. forum, should open another thread for GPIO.

spartacusRising
Posts: 10
Joined: Fri Apr 11, 2014 12:55 am
languages_spoken: english
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by spartacusRising » Sun Jan 25, 2015 10:32 am

Thank you for a fast response! I installed i2c-detect but when I call i2cdetect -l nothing is returned. Do you know why that might be?

User avatar
Panzerknacker
Posts: 244
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, X2, XU3, XU4, W
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Panzerknacker » Sun Jan 25, 2015 11:15 pm

modprobe i2c-dev? (s. thread above)

sudo i2cdetect -l?

spartacusRising
Posts: 10
Joined: Fri Apr 11, 2014 12:55 am
languages_spoken: english
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by spartacusRising » Mon Jan 26, 2015 2:08 am

That was it thanks!

Texel
Posts: 2
Joined: Sat Mar 14, 2015 6:27 pm
languages_spoken: english
ODROIDs: U3, U3 Shield
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Texel » Sat Mar 14, 2015 6:34 pm

Dear all,

I have a U3 Shield. But since the new Kernel I face also the problem that first the i2c-4 was not available. this is fixed now. however I cannot get the GPIOs 289-304 back. How can I create the 289 GPIO?

I2cdetect -l. Lists the i2c-gpio4 .... But the GPIOs in the directory are still missing (289...)

Thanks a lot for any help.

Kind regards,

Texel

Texel
Posts: 2
Joined: Sat Mar 14, 2015 6:27 pm
languages_spoken: english
ODROIDs: U3, U3 Shield
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Texel » Sat Mar 14, 2015 7:09 pm

Hi, found the new mapping 289 is now 341 ....

Kr texel

User avatar
Panzerknacker
Posts: 244
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, X2, XU3, XU4, W
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by Panzerknacker » Sun Mar 15, 2015 3:26 am

Just for reference for future questions on GPIO-numbering and the history behind:
http://forum.odroid.com/viewtopic.php?f ... 080#p80080
http://forum.odroid.com/viewtopic.php?f ... 243#p64112

Btw. with newer kernels (3.19, 4.0) the GPIO numbering will change again.

BARC
Posts: 10
Joined: Sat Jun 27, 2015 8:44 am
languages_spoken: english
ODROIDs: U3
Contact:

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by BARC » Fri Aug 14, 2015 6:21 am

I have an IMU that connects to the board using i2c. It worked on the ODroid u3 without the shield. When we installed the shield, although we did everything that was mentioned in the thread, the ODroid failed to connect with the IMU. Is there a trick with the wire connection?

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

Re: New I2C-Configuration on J4 (8-pin Header)

Unread post by odroid » Sat Aug 15, 2015 11:23 am

BARC wrote:I have an IMU that connects to the board using i2c. It worked on the ODroid u3 without the shield. When we installed the shield, although we did everything that was mentioned in the thread, the ODroid failed to connect with the IMU. Is there a trick with the wire connection?
Was there any conflict with othe I2C device on the shield?

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 3 guests