EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

I2C - Do i need to check all the states of I2C bus?

Started by abhay February 1, 2007
hi,
i am working with philips microcontroller LPC935 which is to be
attached to I2C port expander.
i have to write a code for this .As my device is configured as master
receiver to read (i have to read only) the value or status of port
pins .

my question is that : Do i need to check for all 25 states of I2C bus
from status register  for my operation ?

abhay wrote:
> hi, > i am working with philips microcontroller LPC935 which is to be > attached to I2C port expander. > i have to write a code for this .As my device is configured as master > receiver to read (i have to read only) the value or status of port > pins . > > my question is that : Do i need to check for all 25 states of I2C bus > from status register for my operation ? >
It depends. If the bus does not have other chips which could claim bus mastership, you can forget the states with change of mastership and losing the arbitration. Otherwise, you have to consider all the states. -- Tauno Voipio tauno voipio (at) iki fi
On Feb 1, 12:14 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> wrote:
> abhay wrote: > > hi, > > i am working with philips microcontroller LPC935 which is to be > > attached to I2C port expander. > > i have to write a code for this .As my device is configured as master > > receiver to read (i have to read only) the value or status of port > > pins . > > > my question is that : Do i need to check for all 25 states of I2C bus > > from status register for my operation ? > > It depends. > > If the bus does not have other chips which could > claim bus mastership, you can forget the states > with change of mastership and losing the arbitration. > > Otherwise, you have to consider all the states. > > -- > > Tauno Voipio > tauno voipio (at) iki fi
there is no other chip on the bus , just one slave port expander................do u have a small C-code for this application
"abhay" <abhaym244@gmail.com> schrieb im Newsbeitrag 
news:1170324919.031490.122320@p10g2000cwp.googlegroups.com...
> On Feb 1, 12:14 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> wrote:
Hi,
> > there is no other chip on the bus , just one slave port > expander................do u have a small C-code for this application >
On such port expander you might even get by without considering clock stretching etc. Try to find the far most simple I2C example for your controller. Afaik all you need to do is to send a start condition, send the adress with R/W set to read and then read out the status byte - followed by a stop. /Roland

The 2024 Embedded Online Conference