Ic2 from UEXT communiation

Started by RalfSmit, September 10, 2014, 08:57:20 PM

Previous topic - Next topic

RalfSmit

Hey Guys/Girls

I'm not verry familiar with the Olimex, im currently running Debian on it , and i would like to have i2c(TWI) communication with a motherboard that acts as master.

First step is ofcourse to get it working for me to test it in the Terminal.
Lets say i connect my sda and SCL to the corresponding pins on the UEXT,
How can i astablish i2c communication or can i check that there is some input?

Kind Regards,
Ralf Smit

kgolding

Hello,

I've been playing with i2c today, and I've worked out the there are a few different i2c connections on the olimex. UEXT 1 appears as connection index 2, so to see what devices are on that i2c connection I used:

i2cdetect 2

Which, in my case showed my device at the address 0x4D. I then used the following command to read the default value from the said device:

i2cget -y 2 0x4d 0 w

The -y prevents the "Are you sure (y/n)" prompt, 2 is the UEXT1 i2c bus, 0x4d is my devices address, 0 is the data-address of the data I'm reading and the "w" makes it read a 16 bit word for me.

Hope that helps you get started!

Kevin