FPGARelated.com
Forums

Regarding driving of SCL and SDA pins of I2C

Started by Unknown ●April 13, 2005
You can find everything that you want to know at the Philips site:

http://www.semiconductors.philips.com/markets/mms/protocols/i2c/

I recommend that you download and read the specification first. You can
probably safely ignore anything related to multimaster or high-speed
mode, but be aware that these exist. They also have discussion forums
where you can ask questions.

-Keith

On Wed, 13 Apr 2005 23:14:58 -0400, Mark Jones wrote:

> James Beck wrote: >> In article <upWdnTeAPOxSqcDfRVn-sA@buckeye-express.com>, abuse@127.0.0.1 >> says... >> >>>praveen.kantharajapura@gmail.com wrote: >>> >>>>Hi all, >>>> >>>>This is a basic qustion regarding SDA and SCL pins. >>>>Since both these pins are bidirectional these should pins need to be >>>>tristated , so that the slave can acknowledge on SDA. >>> >>> >>> No, both pins are not bidirectional. Only the master device drives the SCK >>>line, and all slaves must leave their SCK's as input. >> >> >> Not true, a slave device can extend a cycle through clock stretching and >> the only way to do that is for the slave device to be able to hold the >> clock line low. >> >> http://www.i2c-bus.org/clockstretching/ >> > > Explain that to a Noob. > > Please.
A slave device can use the clock as a primitive flow control mechanism. If the slave takes some amount of time to process a byte, it can prevent the master from starting the next byte by simply holding the clock low. The master cannot clock the data until the clock is released by the slave. I2C clocks are not really clocks, they are 'data valid' signals. They don't have to go at any a particular rate, and aren't constrained by anything except setup and hold times for the devices. Regards, Bob Monsen
On Wed, 13 Apr 2005 05:30:39 -0700, praveen.kantharajapura wrote:

> Hi all, > > This is a basic qustion regarding SDA and SCL pins. > Since both these pins are bidirectional these should pins need to be > tristated , so that the slave can acknowledge on SDA. > > But i have seen in some docs that a '1' need to be converted to a 'Z' > while driving on SDA and SCL, what is the reason behind this???? > > Thanks in advance, > Praveen
You need a primer in I2C. If you are the only master, and drive the SDA wire to 1, nothing bad will happen unless, the slave thinks it's supposed to ack at the wrong time, at which time you'll get a short between the master and slave. The standard specifies resistors you can add to keep the devices from getting damaged in this case. However, you CANNOT drive SCL to 1, because a slave is allowed to hold you off by driving it low. You have to notice this, so driving it high is not going to work unless you make the clock slow enough so that the slave will never hold you off. In most I2C applications, the bus and clock should only go high when nobody is pulling it low. There are 'fast' modes of I2C which may not obey this restriction. However, a device starts off in the pullup mode, and then switches over, I believe. ---- Regards, Bob Monsen
<praveen.kantharajapura@gmail.com> schrieb im Newsbeitrag
news:1113452931.790055.285850@f14g2000cwb.googlegroups.com...
> > Antti Lukats wrote: > > <praveen.kantharajapura@gmail.com> schrieb im Newsbeitrag > > news:47cf10b7.0504130430.9a34497@posting.google.com... > > > Hi all, > > > > > > This is a basic qustion regarding SDA and SCL pins. > > > Since both these pins are bidirectional these should pins need to > be > > > tristated , so that the slave can acknowledge on SDA. > > > > > > But i have seen in some docs that a '1' need to be converted to a > 'Z' > > > while driving on SDA and SCL, what is the reason behind this???? > > > > > > Thanks in advance, > > > Praveen > > > > well in order to drive '1' (EXERNAL RESISTIVE PULLUP) you need to Z > the wire > > eg tristate it. > > 0 is driven as 0 > > 1 is driven (or relased) as Z, ext pullup will pull the wire high > > In order to drive a '1' , i will not tristate it to 'Z' i will drive a > '1' only. > Any issues(Hardware malfunction) if i drive a'1' instead of 'Z' > > > > > Antti
YES, the other poster. The master should drive 0 and Z at least on the SDA pin and only in the case that there is no multimastering and no clock stretching it is ok to drive 0 and 1 on the SCL antti
In article <y_qdnVg1FKwRfcDfRVn-2w@buckeye-express.com>, abuse@127.0.0.1 
says...
> James Beck wrote: > > In article <upWdnTeAPOxSqcDfRVn-sA@buckeye-express.com>, abuse@127.0.0.1 > > says... > > > >>praveen.kantharajapura@gmail.com wrote: > >> > >>>Hi all, > >>> > >>>This is a basic qustion regarding SDA and SCL pins. > >>>Since both these pins are bidirectional these should pins need to be > >>>tristated , so that the slave can acknowledge on SDA. > >> > >> > >> No, both pins are not bidirectional. Only the master device drives the SCK > >>line, and all slaves must leave their SCK's as input. > > > > > > Not true, a slave device can extend a cycle through clock stretching and > > the only way to do that is for the slave device to be able to hold the > > clock line low. > > > > http://www.i2c-bus.org/clockstretching/ > > > > Explain that to a Noob. > > Please. >
Click on the link please. That's why I included it, or do you mean you don't understand what the link is explaining?