PIC32MZ Ethernet/PHY EREFCLK question
I am working on a cost sensitive controller which needs an Ethernet interface, and USB, using PIC32MZ1024EFE064 with a LAN8742 PHY chip.
I would like to use only one crystal oscillator to clock the PIC32MZ, at 24MHz, then generate the 50MHz required by both the PHY chip and the PIC32MZ MAC interface using one of the REFCLK outputs.
To me it would seem logical to use a single pin on the PIC for this, to both output the PIC-generated REFCLK for connection to the PHY chip, and have the PIC's built-in MAC "hear" the same 50MHz clock back.
Pin 63 of my PIC is the standard EREFCLK input for the MAC
It is also one of the possible output pins for REFCLK3O.
If I configure that pin for both uses, I see the 50MHz coming out of the PIC on a 'scope and the PHY works correctly in that the LAN activity light starts to flicker (it doesn't if the 50MHz is not present).
However, the MAC behaves as if it is un-clocked.
By contrast if I divert REFCLK3O to pin 52, and link pins 52 and 63 externally everything works.
It looks as if by configuring pin 63 as REFCLK is somehow decoupling the input buffer, which I find odd.
I can kinda live with this external loop, although I'd prefer to keep the pin free for other uses, (and it offends my sense of elegance having this connection!)
Has anyone else had success using just one pin for both REFCLKnO and EREFCLK
post edited by boatbodger - 2019/12/25 02:31:23