SMSC LAN91C111 User Manual

Page of 60
SMSC LAN91C111 32/16/8-Bit Three-In-One Fast Ethernet Controller
SMSC AN 9.6
53
Revision 1.0 (08-14-08)
APPLICATION NOTE
 
9.7   EPH Loopback Test
The following steps will transmit a packet and loop it back through the EPH (Ethernet Protocol Handler)
block and back to the MAC.
Set the transmitter (EPH LOOP, TXENA)
Write 0x2001 to the TRANSMIT CONTROL register (bank 0, offset 0)
Set the receiver (RXEN)
Write 0x0100 to the RECEIVE CONTROL register (bank 0, offset 4)
Set the CONTROL register to receive bad packets
Set the RCV_BAD bit (bit 14) in the CONTROL register (bank 1, offset C) 
Transmit a packet (perform Section ý9.3 - Transmitting A Packet, page 59, but omit “Turn on transmitter”)
Receive the packet (perform Section ý9.5 - Receiving A Packet, page 60, but omit “Turn on receiver”)
If the packet is not received within 100ms after transmission or the packet is received with errors, the
EPH loopback failed.
9.8   PHY Loopback Test
The following steps will transmit a packet out of the MAC, into the PHY, looped through the PHY and
back to the MAC (it does not leave the PHY or go out on the wire).
Set the transmitter (FDUPLX, TXENA)
Write 0x0801 to the TRANSMIT CONTROL register (bank 0, offset 0)
Set the receiver (RXEN)
Write 0x0100 to the RECEIVE CONTROL register (bank 0, offset 4)
Set the CONTROL register to receive bad packets
Set the RCV_BAD bit (bit 14) in the CONTROL register (bank 1, offset C) 
Set the internal PHY
Set the LPBK bit (bit 14) in the PHY CONTROL register (offset 0)
Transmit a packet (perform Section ý9.3 - Transmitting A Packet, page 59, but omit “Turn on transmitter”)
Receive the packet (perform Section ý9.5 - Receiving A Packet, page 60, but omit “Turn on receiver”)
If the packet is not received within 100ms after transmission or the packet is received with errors, the PHY
loopback failed.
9.9   External Loopback Test
This test transmits a packet out the MAC, through the PHY, out on the wire, looped back through the
PHY and MAC.
Create a loopback plug by wiring a RJ45 plug as follows:
„
Pin 1 to pin 3
„
Pin 2 to pin 6
„
Pin 3 to pin 1
„
Pin 6 to pin 2
Insert the RJ45 loopback plug onto the board under test (if equipped). Repeat Section 
ý
9.8 - PHY
Loopback Test, page 62, but omit “Set the internal PHY.”