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 microchip.com > 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.