Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Difference between Start and Restart condition in I2C

Status
Not open for further replies.

savvej

Member
I am using PIC uC(as there was no separate entry for PIC ,I posted in AVR)-18f4520
Language C-using Microchip's C18 Library
In their C18 Library for I2C communications they have defined two functions :
Start
and
Restart.
And their description in manual seems to be same.

The book which I have referred is PIC microcontroller design by John Peatman.
There the procedure to read is jisted as follows:
1)Start
2)Send Device ADD + Write
3)Send Internal ADD
4)Stop
5)Start
6)Send Device ADD+ Read
7)Read I2C
8)NoACK
9)Stop

So here in step 5 does it imply Restart or Start?
 
I got it in their manual u posted...They say it as Repeated Start.From a tutorial on i2c by microchip ,it quotes as follows:

"A restart condition indicates that a device would like
to transmit more data, but does not wish to release the line. This is done when a
start must be sent, but a stop has not occurred. It is also a convenient way to send a
stop followed by a start right after each other. It prevents other devices from
grabbing the bus between transfers.
If you are talking to one device, such as a serial EEPROM, you may not want to be
interrupted when transmitting addresses and gathering data. A restart condition will
handle this.
The restart condition is represented by a “R” in this presentation.
The signaling used for a restart can be seen to be nothing more than a stop condition
quickly followed by a start condition.
The PICmicro microcontroller also will handle this. You simply request a restart
condition be sent, then wait for it to complete."

Anyways thanks for your interest and documentation of I2C you provided.
 
A restart is just a stop and start done too fast for anything else to grab the bus.

Mike.
 
A restart (or repeated start) is not the same as a Stop Start. I found this out the hard way.
Some devices only read with restart (e.g. ADRF6755), even if there is only one master on the I2C bus.
The Clock line must be released to do Starts and Stops.
Stop Start:
(if the data line is already high) Pull the clock line low, then Pull the data line low.
Release the clock line. Release the data line for a Stop. Pull the data line low for a Start.
Restart:
(if the data line is already low) Pull the clock line low, then Release the data line.
Release the clock line. Pull the data line low for a restart.
John
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top