SMSC LAN91C111 32/16/8-Bit Three-In-One Fast Ethernet Controller

outport(0x300, 0xA0B1); //Make sure the internal phy is selected

//Now read the first register of the PHY BankSelect(3);

for (int i=0; i<=5; i++)

{

printf("\nPHY Reg %d = 0x%04x", i, ReadFromPhyReg(i));

}

//Write and read back different values.. to a PHY register...

//We chose to R/W the ANEG advertisement register.. almost all the //bits are R/W

WriteToPhyReg(4, 0X000F);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0X00F0);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0X0F00);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0Xb000);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0XBF00);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0X00FF);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

WriteToPhyReg(4, 0XBFFF);

printf("\nPHY Reg = 0x%04x", ReadFromPhyReg(4));

}

7.4Multiple Register Access

If the MI serial port needs to be constantly polled in order to monitor changes in status output bits, or if it is desired that all registers be read or written in a single serial port access cycle, multiple register access mode can be used.

Multiple register access allows access to all registers in a single MI serial port access cycle. When multiple register access is enabled, all the registers are read or written when the register address REGAD[4:0] = 0b11111. This eliminates the need to read or write registers individually. Multiple register access modes is normally disabled. To enable it, set the Multiple Register Access Enable (MREG) bit in the MI serial port Configuration 2 register.

SMSC AN 9.6

49

Revision 1.0 (08-14-08)

APPLICATION NOTE