TWR-K60N512-KEIL Freescale Semiconductor, TWR-K60N512-KEIL Datasheet - Page 114

no-image

TWR-K60N512-KEIL

Manufacturer Part Number
TWR-K60N512-KEIL
Description
K60N512 Keil Tower Kit
Manufacturer
Freescale Semiconductor
Series
Kinetisr
Type
MCUr

Specifications of TWR-K60N512-KEIL

Rohs Compliant
YES
Contents
4 Boards, Documentation, DVD
Peak Reflow Compatible (260 C)
Yes
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
Freescale Tower System, K60N512
PHY management interface
12.3.1 Code example and explanation
The following example code starts the PHY management interface that starts the auto-
negotiation process from the PHY to the network.
Example code:
void
enet_start_mii(void)
{
/*FSL: start MII interface*/
}
void
mii_init(int ch, int sys_clk_mhz)
{
#ifdef TSIEVB/*TSI EVB requires a longer hold time than default 10 ns*/
#endif
}
int
mii_write(int ch, int phy_addr, int reg_addr, int data)
{
int timeout;
/* Clear the MII interrupt bit */
ENET_EIR/*(ch)*/ = ENET_EIR_MII_MASK;
/* Initiatate the MII Management write */
ENET_MMFR/*(ch)*/ = 0
| ENET_MMFR_ST(0x01)
| ENET_MMFR_OP(0x01)
| ENET_MMFR_PA(phy_addr)
| ENET_MMFR_RA(reg_addr)
| ENET_MMFR_TA(0x02)
| ENET_MMFR_DATA(data);
114
PORTB_PCR0
PORTB_PCR1
mii_init(0, periph_clk_khz/1000/*MHz*/);
/* Can we talk to the PHY? */
do
{
} while( usData == 0xffff );
/* Start auto negotiate. */
mii_write( 0, configPHY_ADDRESS, PHY_BMCR, ( PHY_BMCR_AN_RESTART | PHY_BMCR_AN_ENABLE ) );
• One clock generated from the ENET interface for the PHY. Clock cannot be greater
• One bidirectional signals which sends/receives data to/from the PHY.
vTaskDelay( netifLINK_DELAY );
usData = 0xffff;
mii_read( 0, configPHY_ADDRESS, PHY_PHYIDR1, &usData );
ENET_MSCR/*(ch)*/ = 0
than 2.5MHz and is controlled by register ENET_MSCR[MII_SPEED] divider
which uses peripheral clock as reference.
= PORT_PCR_MUX(4);//GPIO;//RMII0_MDIO/MII0_MDIO
= PORT_PCR_MUX(4);//GPIO;//RMII0_MDC/MII0_MDC
| ENET_MSCR_HOLDTIME(2)
| ENET_MSCR_MII_SPEED((2*sys_clk_mhz/5)+1)
;
Kinetis Quick Reference User Guide, Rev. 0, 11/2010
Freescale Semiconductor

Related parts for TWR-K60N512-KEIL