2
\$\begingroup\$

I am working with this Ethernet PHY and little bit confused on the topic of MAC address.

This is the - MAC Controller IC. I'm using RMII interface.

One thing I want to understand is that what should I do on the MAC Address?

I understand that MAC address is a layer 2 topic and the PHY device has nothing to do with it.

So, the MAC Controller has the MAC Address.

My question is, should I set the MAC address from the PHY to the controller? Or does the Controller has a MAC address on its own?

How can I find the MAC address using the registers of the PHY? Is it possible that I can detect some information regarding the MAC Address through the PHY (somehow through the register dump)?

PHY Register dump:

PHY Register 0 = 0x1100 PHY Register 1 = 0x782D

Can someone help me with this MAC address topic.

EDIT:

I have checked. Below is my observation : When the Renesas send the DHCP request, I have the feeling (not 100% sure, I will try to find it out) that no response comes from the LAN8700. Do you have a good hint how to find it out (I'm trying to measure it with an oscilloscope, but decoding could be a problem..)? Will add this in the above question under the edit section.

\$\endgroup\$
14
  • 1
    \$\begingroup\$ The MAC address is something you as the user/programmer of the device must provide -It's not built into the PHY. \$\endgroup\$
    – brhans
    Commented Jul 13, 2022 at 12:20
  • 3
    \$\begingroup\$ But you said it yourself already, a PHY has nothing to do with MAC addresses. \$\endgroup\$
    – Justme
    Commented Jul 13, 2022 at 12:21
  • 2
    \$\begingroup\$ Why do you say the PHY has nothing to do with the MAC address and then you want to use the PHY to find out the MAC address...? \$\endgroup\$ Commented Jul 13, 2022 at 12:25
  • 2
    \$\begingroup\$ I think this question is beyond electronics already. You can simply buy MAC addresses in order to manufacture Ethernet devices with a MAC address. \$\endgroup\$
    – Justme
    Commented Jul 13, 2022 at 13:50
  • 1
    \$\begingroup\$ So, the MAC address is entirely inside the MAC Controller right? @Justme. It has nothing to do with PHY right? \$\endgroup\$
    – user220456
    Commented Jul 13, 2022 at 14:46

1 Answer 1

7
\$\begingroup\$

You, as the designer, determine your device's MAC address. You have options:

  • Buy a support chip that your uC talks to in order to retrieve an unique MAC address that the support chip already has in ROM (for my low-quantity products, this is what I do).
  • Get yourself a list of legitimate MAC addresses (requires $money$ Google it). Pick an address from that list, apply it to your device from your firmware. (Unique address, not to be used again).
  • Tell everyone 'Good luck!' and make up your own address (note: If I recall correctly, there is a block of MACs that are designated to be lawlessly used, assuming the device remains only on your isolated subnet). See next item below.
  • Make up a locally unique MAC, and set the "locally Administered Addresses" (LAA) bit in the MAC address. (See Wikipedia "MAC Address" : "Universal vs. local (U/L bit)". " ...setting (assigning the value of 1 to) the second-least-significant bit of the first octet of the address." I'm not familiar with this method or the ramifications on your LAN.

For the RA6M4 family, it appears that you set the MAC in the MAHR & MALR registers (RA6M4 Group User’s Manual: Hardware 26.2.15, 26.2.16).

(https://www.renesas.com/us/en/document/man/ra6m4-group-user-s-manual-hardware?language=en&r=1333976)

Good luck!

\$\endgroup\$
6
  • 1
    \$\begingroup\$ I had a buddy who did electronics as a hobby and worked at an electronics recycler. He had a side passion of harvesting MAC addresses from equipment that was going to scrap. All the equipment was made irrevocably non-functional during recycling so the MACs truly were “freed”. I don’t know what he did with the list – it was many thousands MACs long. He had a little PIC+ENC battery powered dongle to plug into a port, power the device up, and spit out any source MACs on the little 2-line LCD. \$\endgroup\$ Commented Jul 13, 2022 at 18:27
  • 1
    \$\begingroup\$ Personally, if I need some MACs for projects, I go to a thrift store and buy whatever cheap stuff has ethernet ports on it. $2.50 consumer cable modems/routers are great – you get two MACs at least. One for the Ethernet side, another for the cable side. \$\endgroup\$ Commented Jul 13, 2022 at 18:28
  • \$\begingroup\$ @Kubahasn'tforgottenMonica why bother, if you can just set up locally administered ones? \$\endgroup\$
    – jaskij
    Commented Jul 13, 2022 at 23:15
  • \$\begingroup\$ Thank you, I have checked. Below is my observation : When the Renesas send the DHCP request, I have the feeling (not 100% sure, I will try to find it out) that no response comes from the LAN8700. Do you have a good hint how to find it out (I'm trying to measure it with an oscilloscope, but decoding could be a problem..)? Will add this in the above question under the edit section. \$\endgroup\$
    – user220456
    Commented Jul 14, 2022 at 5:55
  • \$\begingroup\$ @Newbie Use Wireshark ( wireshark.org )on your dhcp server to monitor transactions on your network segment. Your LAN 8700 does not care about, nor does anything with, dhcp requests. It just tickles the transformer, and provides a bit of intelligence to the interface. DHCP is handled by an external server on your network (that you set up). You can tell if the 8700 is working with Wireshark. You can tell if your uC is working with your debugger. If I were you, I'd start simple, and confirm the system works with a fixed IP on your uC, then try enabling DHCP once it's all good. \$\endgroup\$ Commented Jul 14, 2022 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.