Home/Support/Support Forum/i2c repeated start condition
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

i2c repeated start condition

0 votes
Hi all,

Is there any method to invoke a repeated start (or "restart") signal during an i2c transmission?

The desired transmission should be:
Start->DeviceAddress->Write->RegisterAddress->*Start*->DeviceAddress->Write->Data->Stop

The "restart" sequence is actually a repeated start condition that must appear between a start signal, and a stop signal. The device-address is sent again after the restart condition. If you look at the file I have attached, which shows a standard i2c transmission, you will see I have highlighted the repeated start, or "restart" signal.

Slave Device: MCP23017
The MCP23017 datasheet shows the transmission that it expects (page 7).

Thanks,
David
asked Jul 23, 2010 in Linux by dprocter01 New to the Community (2 points)
recategorized Dec 5, 2013 by tuxembb

Please log in or register to answer this question.

4 Answers

0 votes
Hi,

You do not say which Digi module you are working with. I have done some I2C work with the CC9P2915, and I believe that this will do the repeated start that you require, if you use the standard I2C API with I2C_HOST_WRITE_THEN_READ as the flag.

I originaly used this and looked carefully at exactly how it worked and I beileve that it did do the repeated start, but Ihad problems at the other end of the link and have now changed it to a write followed by a read, as two transactions, so I cannot easily check again.
answered Jul 23, 2010 by rdeabill Community Contributor (142 points)
0 votes
Device: Connect ME 9210, NET+OS 7.4

Tried using I2C_HOST_WRITE_THEN_READ, but as the call suggests, this writes, then reads. What I need, is a method to write, then write.

The chip I am trying to communicate with is a MCP23017, please see the attached image1.jpg to see the desired transmission, and the actual output (from I2C_HOST_WRITE_THEN_READ).

Thanks.
answered Jul 23, 2010 by dprocter01 New to the Community (2 points)
0 votes
Sorry, I did not read the origional post properly. There does not appeat to be any simple way that the Digi API will let you do this.

It is possible to implement an I2C master in software by directly programming the GPIO pins rather than using the hardware interface and the Digi APIs.

As the older Digi ME had no I2C hardware I had to do this with some ME units and it worked very well. This does allow you full control over exactly how the signals are generated and you should be able to do what you need.
answered Jul 23, 2010 by rdeabill Community Contributor (142 points)
0 votes
It seems strange that this is not part of the API, as it is listed in the NXP I2C specification. Many devices use this method, so I can not really understand why it has not been implemented.

Thanks for your help.
answered Jul 23, 2010 by dprocter01 New to the Community (2 points)
...