MPLAB® Harmony - TCP/IP MAC Address Location

You can obtain the media access control address (MAC address) of the device once it has been connected to the network.

One useful tool is the TCP/IP Discoverer, which can be found in C:\microchip\harmony\ \utilities\tcpip_discoverer. The TCP/IP feature, Announce, should be enabled. The workstation and the device need to be connected to the same LAN segment. Make sure the workstation is only connected to this LAN segment, meaning only one of its network interfaces is active.

In MPLAB® Harmony TCP/IP, the const uint8_t* TCPIP_STACK_NetAddressMac(TCPIP_NET_HANDLE netH) function returns the network interface physical MAC address. The interface should be enabled for this function to work. The TCP/IP stack is initialized by TCPIP_STACK_Initialize and TCPIP_STACK_Status returned SYS_STATUS_READY. The network interface is now up and running.

Each PIC32MX including an Ethernet Controller has a unique address, which is loaded into the MAC registers on power-up. This value can be used as is or the registers may be reconfigured with a different address at runtime by modifying the EMAC1SA0, EMAC1SA1, and EMAC1SA2 registers. See the PIC32 Family Reference Manual regarding Ethernet Controller for details.

  • Go to > Design Support > Documentation > Reference Manuals. Search by document title for "PIC32 Family Reference Manual, Sect. 35 Ethernet Controller".

  • External MAC and PHYs, like ENC28J60, have registers as well for their MAC address. Explore the datasheet available on the ENC28J60 product page.

  • Microchip offers EEPROMs with pre-programmed MAC addresses. Visit the "Pre-Programmed EEPROMs" webpage for more information.
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.