3

For the MII interface signals, I read on Wikipedia - MII on the Tx and Rx signals.

But I am confused about why there are two clocks (for Tx and Rx)?

Are the directions mentioned for transmitter signals and receiver signals mentioned in the wikipedia table correct?

Because it's a little confusing.

enter image description here

ocrdu
  • 8,705
  • 21
  • 30
  • 42

2 Answers2

3

The tx clock is generated locally via the phy and a crystal oscillator whereas the rx clock is recovered from the incoming data.

The wikipedia link you provided tells you this.

Kartman
  • 5,930
  • 2
  • 6
  • 13
  • Oh, thank you. so, there's Clock data recovery mechanism done on this right –  Mar 11 '22 at 05:05
  • Could you please explain on what you meant when you said the "Rx clock is recovered from the incoming data" ? –  Mar 11 '22 at 07:07
  • Like why do we have 2 clock signals from the PHY to MAC? Could you please explain the purpose? –  Mar 11 '22 at 07:20
  • The whole purpose of encoding data is to provide a means of recovering it. The encoding puts in clocking information with the data. When we come to receive the encoded data, we need to recover the clocking information otherwise we wouldn’t be able to determine each bit from the next. On the transmitter end, the bits are sent precisely, but on their way through the cable the bits get shifted here and there by noise and reflections. That’s why we need to encode clocking info along with the data. The PHY does this for us and presents the MAC with the raw data along with the recovered clock. – Kartman Mar 11 '22 at 11:17
  • So, the encoding puts the clocking information with the data? So, all encoding techniques like NRZ, NRZI, Manchester, PAM and others, in this encoding step only, the clock is added to the data? Am I correct? –  Mar 11 '22 at 13:17
  • We seem to be stuck with this circular method of questioning. Rather than ask ‘am I correct’? - do your research and your answer will be evident. – Kartman Mar 11 '22 at 17:54
  • OK. One question. In MII tranmission, TX is from MAC to PHY. Since MAC is transmitting the data, the tx clock should also be from MAC to PHY right? But why is the tx clock from PHY to MAC? Unable to understand the logic behind this? –  Mar 14 '22 at 09:02
  • The phy needs a frequency reference so most of them tend to have a oscillator for an external crystal or an external oscillator. Since the tx data needs to be synchronous with the phy encoding it makes perfect sense that the phy supplies the clock. I somehow think you’ve skipped a lot of fundamental learning as you seem to make a lot of assumptions. – Kartman Mar 14 '22 at 12:16
1

You need a clock to transmit data, and you need a clock to receive data from another transmitter.

Because each device transmits with the clock it generates, you can't use your own transmit clock for receiving data which has because the clocks are different.

So the data reception works with the clock sent from the other transmitter.

Justme
  • 127,425
  • 3
  • 97
  • 261
  • Oh, thank you. so, there's Clock data recovery mechanism present ? –  Mar 11 '22 at 10:36
  • That would be a new question perhaps, but again, did you read the Wikipedia article you linked to? It has the answer. – Justme Mar 11 '22 at 10:47
  • OK. One question. In MII tranmission, TX is from MAC to PHY. Since MAC is transmitting the data, the tx clock should also be from MAC to PHY right? But why is the tx clock from PHY to MAC? Unable to understand the logic behind this? –  Mar 14 '22 at 09:02
  • That's again a new question. What is confusing about it and what research have you done about that subject? The MAC needs a transmit clock from somewhere to be able to transmit data. If the original question is answered you can accept an answer. – Justme Mar 14 '22 at 09:39
  • Actually I am stuck in this question and the other question for sometime now to understand the basics of the Ethernet interface. In my original question, I was asking on the purpose of the 2 clock sources and this follows up with this question on why there is a tx clock from PHY to MAC when the MAC is transmitting the data? –  Mar 14 '22 at 09:57
  • Counter question: If the MAC does not get clock from PHY, how else would the MAC know when to send and at what speed? Where would the MAC get a clock for transmitting data then, if not from the PHY? So the MAC needs a clock at which to transmit data. It gets it from PHY. – Justme Mar 14 '22 at 10:09
  • you have told that "You need a clock to transmit data, and you need a clock to receive data from another transmitter. Because each device transmits with the clock it generates, you can't use your own transmit clock for receiving data which has because the clocks are different."...So, I have understood it like, if one is transmitting, the transmitter should send the clock right? MAC can have its own clock ? –  Mar 14 '22 at 10:13
  • Since MAC is transmitting, why should it get a clock from PHY to transmit its data? Since, MAC is the transmitter, it should use its own clock right? –  Mar 14 '22 at 10:15
  • 1
    I only said that each (ethernet) device (as a whole) transmits with its own clocks to another ethernet device. I never said which specific part is responsible for generating the clock inside the device, and told many times already that MAC needs a clock from somewhere to transmit data at correct speed and the MAC does not know if the link is 10M or 100M as long as it receives the correct clocks from somewhere which knows the link speed. It is even explained on the Wikipedia page about MII interface. – Justme Mar 14 '22 at 10:23
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/134754/discussion-between-newbie-and-justme). –  Mar 14 '22 at 10:44