List Info

Thread: I2C transactions & STOP condition




I2C transactions & STOP condition
country flaguser name
France
2007-07-22 16:31:39
Hi,

I recently had a look on i2c devices code, and notices that
some
devices transactions does not ends with a STOP conditions.

By example, the adt7463 code should use
I2C_OP_{READ,WRITE}_WITH_STOP
instead of I2C_OP_{READ,WRITE} for adt7463c_receive_1(),
adt7463c_send_1() and adt7463c_write_1() functions.

If i understand the i2c specifications correctly, all
transferts begin
with a START condition, and terminates with a STOP
condition; in
between, the i2c bus remains busy.

Do the attached patch looks correct ?

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

  
Re: I2C transactions & STOP condition
country flaguser name
Sweden
2007-07-22 16:57:04
On Sun, 22 Jul 2007 23:31:39 +0200
Nicolas Joly <njolypasteur.fr> wrote:

>
> Hi,
>
> I recently had a look on i2c devices code, and notices
that some devices
transactions does not ends with a STOP conditions.
>
> By example, the adt7463 code should use
I2C_OP_{READ,WRITE}_WITH_STOP
instead of I2C_OP_{READ,WRITE} for adt7463c_receive_1(),
> adt7463c_send_1() and adt7463c_write_1() functions.
> If i understand the i2c specifications correctly, all
transferts begin
with a START condition, and terminates with a STOP
condition; in
between, the i2c bus remains busy.

It is technically allowed to perform multiple consecutive
transfers
without sending a STOP condition, using a technique called
"repeated
start". This works fine as long as there is only one
bus master present.

>
> Do the attached patch looks correct ?

IMO, yes. The code calls iic_release_bus(), and before this
the stop
condition needs to be sent. (b/c none of our i2c controller
drivers seem
to automatically send a stop on release.)

Kind regards,
-Tobias



Re: I2C transactions & STOP condition
country flaguser name
France
2007-07-22 17:34:28
On Sun, Jul 22, 2007 at 11:57:04PM +0200, Tobias Nygren
wrote:
> On Sun, 22 Jul 2007 23:31:39 +0200
> Nicolas Joly <njolypasteur.fr> wrote:
> >
> > Hi,
> >
> > I recently had a look on i2c devices code, and
notices that some devices
> transactions does not ends with a STOP conditions.
> >
> > By example, the adt7463 code should use
I2C_OP_{READ,WRITE}_WITH_STOP
> instead of I2C_OP_{READ,WRITE} for
adt7463c_receive_1(),
> > adt7463c_send_1() and adt7463c_write_1()
functions.
> > If i understand the i2c specifications correctly,
all transferts begin
> with a START condition, and terminates with a STOP
condition; in
> between, the i2c bus remains busy.
> 
> It is technically allowed to perform multiple
consecutive transfers
> without sending a STOP condition, using a technique
called "repeated
> start". This works fine as long as there is only
one bus master present.

I was aware of that  Only the
last one need the STOP condition.

But the adt7463 code only issue a single tranfert in each
function,
then the START and STOP conditions are in the same
operation.

> > Do the attached patch looks correct ?
> 
> IMO, yes. The code calls iic_release_bus(), and before
this the stop
> condition needs to be sent. (b/c none of our i2c
controller drivers seem
> to automatically send a stop on release.)

Thanks.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )