0
\$\begingroup\$

I am learning i2c communication and I got stuck in understanding: clock data, I understand what data is, but what means: clock? Tried to google it, but cannot find proper information about it.

Example:

Serial ports are asynchronous (no clock data is transmitted)

\$\endgroup\$
3
\$\begingroup\$

It's the difference between asynchronous and synchronous data that you're referring to here.

With synchronous data such as I2C, one line (the clock line or SCL) is used to indicate to the slave that data is ready to be read on the other line (the data line or SDA). The slave also uses this clock for timing of sending out its data.

The beauty of this method is that the receiving end receives the clock that synchronises the clock and data (hence the word synchronous). This way, the slave device does not need to know what the speed of the data stream is.

Compare this with a UART (serial port as you called it). This only has one input line (receive data) and has no way of knowing for sure when a data bit is valid. Both ends have to know the baud rate that each other are transmitting at.

If you Google synchronous and asynchronous data transmission you will find a whole host of good articles explaining this in depth.

Edit: thanks to Tony for pointing this out. Although there is an advantage in having a separate clock and data in terms of synchronisation, the disadvantage is needing the extra line. SPI has a separate receive and transmit data line as well as a clock and a chip select. At least I2C has bidirectional comms with only two wires, but is a lot slower than SPI.

Long distance is also an issue for a protocol such as I2C. It is intended for on-board communication; you start to get clock to data skew as frequency increases.

You might also be interested to read about Manchester encoded data which embeds a clock within the data stream (and can be sent as a balanced signal to give long reach at high speed).

\$\endgroup\$
  • \$\begingroup\$ You mention the pro of a clock in comms, as you're describing more broadly than just I2C. Worth adding the cons of a separate clock in comms, which include another signal/track/wire, increased skew problems at higher speeds and distance. Wil upvote if modified. \$\endgroup\$ – TonyM Feb 13 '18 at 11:06
1
\$\begingroup\$

Serial ports are asynchronous (no clock data is transmitted)

Asynchronous communication protocols don't have a separate clock signal. Both transmitter and receiver side agree on a clock. Only the begin and end of transmission has to be indicated then.

Synchronous communication protocols feature a separate clock signal. The transmitter will dictate its clock to the receiver.

clock data is probably a poor translation. In my opinion it should be data clock, which makes more sense.

\$\endgroup\$
  • \$\begingroup\$ Synchronous communication does not need to have a separate clock signal and it has nothing to do with "protocols". \$\endgroup\$ – Andy aka Feb 13 '18 at 10:59
  • \$\begingroup\$ What do you mean by "separate clock signal" \$\endgroup\$ – Mitu Raj Feb 13 '18 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.