Hi David
The formula for the value to set is
MSCR = (((ETHERNET_CONTROLLER_CLOCK/(2 * MII_MANAGEMENT_CLOCK_SPEED)) - 1) << 1);
where ETHERNET_CONTROLLER_CLOCK is the system clock (not bus clock) and MII_MANAGEMENT_CLOCK_SPEED is the speed you want (2.5MHz is typically).
With 120MHz system clock this gives MSCR = 0x2e (MII_SPEED is 0x17, which gives a divide by (0x18 x 2) or 48)
120/28 = 2.5MHz
If you use the system clock instead of bus clock you will also get the correct speed.
Possibly your difficulty with the phy is that the clock speed is too high, but could you explain your FLL engaged external mode (which reference input)? Since the 50MHz oscillator is needed for RMII why do you not use the PLL mode?
Attached is a FRDM-K64F binary which runs at 120MHz system clock with 60MHz bus clock which shows exact 2.5MHz MDIO clock. It has a default IP of 192.168.0.5 (configurable in the LAN menu on the OpenSDA VCOm connection at 115200 Baud).
In the MQTT menu you can connect to MQTT brokers and subscribe to topics and publish messages (and see message reception from other broker IoTs).
As you see, I am also playing with the FRDM-K64F today and will be demonstrating a turn-key secure socket (TLSv2) solution for MQTT on the K64 shortly that is fully compatible with Amazon AWS with client certification authentication....
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
Kinetis K64:
- http://www.utasker.com/kinetis/FRDM-K64F.html
- http://www.utasker.com/kinetis/TWR-K64F120M.html
- http://www.utasker.com/kinetis/TEENSY_3.5.html
- http://www.utasker.com/kinetis/Hexiwear-K64F.html
Networking: http://www.utasker.com/docs/uTasker/uTaskerNetworking.pdf
Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M
Professional Kinetis support, one-on-one training and complete fast-track project solutions: http://www.utasker.com/support.html