Help regarding I2C lines on CON4 of mini2440

ketul
Hello friends,

I am new to this forum and also to linux.

I am facing a problem with the I2C lines present on CON4. Actually i am
interfacing an ADC externally to this lines; i don't know how to access
this lines i have used i2c-tools and the output of the i2cdetect command is
 as below:
[root@FriendlyARM /]# i2cdetect -r 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c/0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 51 52 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

it is showing my ADC at 0x68; i have rechecked it by disconnecting my ADC
from the board after that this command doesn't show any device on 0x68 it
is marked empty.

I have read linux documentations for I2C and using ioctl for passing
address but there itself it shows error.
can some one please provide me a sample code for using I2C for an external
device connected on mini2440 it would be very helpful thanks in advance...

Dave McLaughlin
Hi there,

I created a JNI for use with Android that uses I2C on a Mini6410 but the
code should help you figure out how it works.

Try here

https://sourceforge.net/projects/mini6410-i2c/

Dave...

Dave McLaughlin
PS. I used a Microchip MCP3424 which has the same I2C address you are
using.

:o)

Dave...

ketul
@ Dave McLaughlin

Hey thank you so much for the code just 1 doubt i am also using the same
ADC as you are how to pass the read and write address the datasheet of
MCP3424 says write address is 0b11010000 and read address is 0b11010001 so
how do you pass this address this has been a headache for me now...
It would be helpfull if you can clear my doubts regarding this...

Thanx in advance....:-D

ketul
Do we need to rebuild the kernel for enabling the I2C lines of CON4 as the
MINI_2440_USER_MANUAL says that this pins are all GPIO, but they are marked
as special function interfaces. They can be configured for other purposes
too by setting related CPU registers.

What does this mean..??

Please Help me...!!

SQ3BKL
Hi
 I have the same problem with COM4 connector and I2C bus. Connecting
expaner PCF 8574 at SDA and SCL to COM4 does not work. When you connect the
SDA and SCL pins EEPROM AT24C08 for detecting it without any problems. I
tried with and without the resistor pullapp him. I think you have to turn
in the Linux kernel
 How do i2c activation in COM4?
 Please help me !

Dave McLaughlin
Hi Ketul,

The address is used by shifting it 1 bit to the right from the datasheet.
Bit 0 is the read and write bit of the I2C protocol. 0x68 is the result of
this shift. I have to admit, when switching from programming
microcontrollers to using Linux drivers this part confused me at first too.

Email me and I will send you the Java code I use to read the MCP3424

It will help to understand how this works.

dave AT axoninstruments DOT biz

Cheers.
Dave...