Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MII - PHY bit order for Ethernet data transmission

Status
Not open for further replies.

ybfridly

Technical User
Jul 28, 2011
1
US
Hi All have a quick question, if I am trying to send data to a PHY 100 mbits/sec

I send first the preamble a nibble a time, start of frame, MAC address, and then frame length. And hence my question is regarding the frame length

so the order of nibbles to be sent to the PHY is
AAAAAAAB<MAC_ADDR>0192<PAY_LOAD> so the frame length is 0x0192

broken into binary this is
0000 0001 1001 0010
that data is stored in bytes so it would be
00000001 10010010
to transmit this I would first reverse the byte:
10000000 01001001
and send like this:
mii_tx <= "1000" at time t
mii_tx <= "0000" t+1
mii_tx <= "0100" t+2
mii_tx <= "1001" t+3

this way the data is going into the PHY as 0x1029 instead of 0x0192... is this correct or do I also need to switch the nibble placement? i.e.
00001000 10010100
and then send a nibble at a time?

Thank you for your help!






my understanding is that the
 
Can't say that I've ever seen a nibble flip in transmission or data storage. I've seen an MSB/LSB flip, which would yield a 0x4980 in your example. I've also seen a big endian/little endian reversal (for processors that have differing endianess, which would yield a 0x9201 in your example.

Either way, this is programming at a level that hasn't been necessary for a lot of years. It is possible to generate packets and do socket programming with libraries that can make these calculations for you.


pansophic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top