Using a Micrel Ethernet PHY and a Lattice ECP3 FPGA to Create an ...
Using a Micrel Ethernet PHY and a Lattice ECP3 FPGA to Create an ...
Using a Micrel Ethernet PHY and a Lattice ECP3 FPGA to Create an ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong><br />
Subsystem: A Step by Step Guide<br />
APPLICATION NOTE<br />
Introduction<br />
M<strong>an</strong>y modern applications use <strong>FPGA</strong>s <strong>to</strong> implement complex system level<br />
building blocks. These building blocks c<strong>an</strong> contain processors, DSPs, bus<br />
interface <strong><strong>an</strong>d</strong> even video <strong><strong>an</strong>d</strong> audio functions. Getting high-speed data<br />
on <strong><strong>an</strong>d</strong> off the <strong>FPGA</strong> c<strong>an</strong> be accomplished by using a st<strong><strong>an</strong>d</strong>ard <strong>Ethernet</strong><br />
interface <strong><strong>an</strong>d</strong> this leverages a wide r<strong>an</strong>ge of established pro<strong>to</strong>cols, software<br />
platforms <strong><strong>an</strong>d</strong> IP. <strong>FPGA</strong>’s usually requires <strong>an</strong> <strong>Ethernet</strong> Interface IP Core inside<br />
the <strong>FPGA</strong> <strong><strong>an</strong>d</strong> some external devices, typically <strong>an</strong> <strong>Ethernet</strong> Physical (<strong>PHY</strong>)<br />
layer device <strong><strong>an</strong>d</strong> a connec<strong>to</strong>r.<br />
Creating <strong>an</strong> <strong>Ethernet</strong> subsystem involves a variety of design considerations.<br />
This application note provides a step-by-step guide for a designer who<br />
needs <strong>to</strong> quickly <strong><strong>an</strong>d</strong> efficiently create <strong>an</strong> <strong>Ethernet</strong> subsystem using a <strong>Lattice</strong><br />
<strong>ECP3</strong> <strong>FPGA</strong>, <strong><strong>an</strong>d</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong>.<br />
Topics in this application note are org<strong>an</strong>ized by design task (Device<br />
Selection, <strong>FPGA</strong> Design, <strong><strong>an</strong>d</strong> Board Design) <strong><strong>an</strong>d</strong> each <strong>to</strong>pic is a st<strong><strong>an</strong>d</strong>-alone<br />
section, with a short introduction or overview, followed by the step-by-step<br />
design guidelines. The reader may skip over sections <strong><strong>an</strong>d</strong> go directly <strong>to</strong> the<br />
<strong>to</strong>pic of interest, or start at the beginning <strong><strong>an</strong>d</strong> follow each <strong>to</strong>pic in order<br />
<strong>to</strong> quickly go through the entire design process, step-by-step. The <strong>to</strong>pics<br />
covered in this application note include the following:<br />
1) Device Selection<br />
a. <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong><br />
i. <strong>Ethernet</strong> <strong>PHY</strong> Functional Overview<br />
ii. Pin Descriptions<br />
iii. MII Connectivity<br />
b. Midcom PMD <strong><strong>an</strong>d</strong> Connec<strong>to</strong>r<br />
i. Functional Overview<br />
ii. Connectivity <strong>to</strong> <strong>Ethernet</strong> <strong>PHY</strong><br />
iii. Available Devices<br />
c. <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong>s<br />
i. <strong>ECP3</strong> Functional Overview<br />
ii. Family Overview<br />
iii. Device Selection<br />
2) <strong>FPGA</strong> Design<br />
a. <strong>Using</strong> the <strong>Lattice</strong> <strong>Ethernet</strong> IP Core<br />
i. IP Core Overview<br />
ii. Functional Description<br />
iii. Pin Descriptions<br />
iv. Example Design- Step-by-Step<br />
b. Integration of the IP Core<br />
i. Integration Overview<br />
ii. Functional Description<br />
iii. Pin Descriptions<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
3) Board Design Considerations<br />
a. Pin Assignment Considerations<br />
b. Simult<strong>an</strong>eous Switching Output Considerations<br />
c. Power Supply <strong><strong>an</strong>d</strong> Decoupling Considerations<br />
d. Board Layout <strong><strong>an</strong>d</strong> Signal Routing Considerations<br />
A signific<strong>an</strong>t amount of supporting documentation is referenced in this<br />
application note <strong><strong>an</strong>d</strong> the reference section at the end of this application note<br />
provides links <strong>to</strong> on-line versions of each reference, making it easy <strong>to</strong> locate<br />
additional information.<br />
Device Selection<br />
The first phase of the design project is device selection, where the designer<br />
decides on the key components <strong>to</strong> be used in the design. As a target<br />
application example we will use a video inspection system used in <strong>an</strong><br />
assembly line application. This type of embedded video processor needs <strong>to</strong><br />
fit in<strong>to</strong> a very small form fac<strong>to</strong>r <strong><strong>an</strong>d</strong> will moni<strong>to</strong>r <strong><strong>an</strong>d</strong> control inspection of<br />
product produced by <strong>an</strong> assembly. <strong>Ethernet</strong> is being used <strong>to</strong> communicate <strong>to</strong><br />
the controller so that comm<strong><strong>an</strong>d</strong>s <strong><strong>an</strong>d</strong> data received by the controller c<strong>an</strong> be<br />
relayed <strong>to</strong> the central processing location. A large number of controllers will<br />
be distributed throughout the fac<strong>to</strong>ry at various stages of the m<strong>an</strong>ufacturing<br />
process. Because of the data tr<strong>an</strong>smission speed required high-speed<br />
<strong>Ethernet</strong> is needed, but backwards compatibility <strong>to</strong> st<strong><strong>an</strong>d</strong>ard <strong>Ethernet</strong> is <strong>an</strong><br />
adv<strong>an</strong>tage. Signific<strong>an</strong>t DSP functionality is desired so that video images<br />
may be processed quickly <strong><strong>an</strong>d</strong> <strong>an</strong>y product quality issues spotted quickly.<br />
Let’s assume that <strong>an</strong> initial review of possible suppliers has been conducted<br />
<strong><strong>an</strong>d</strong> that <strong>Micrel</strong> has been selected as the supplier for the <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong><br />
<strong>Lattice</strong> has been selected as the <strong>FPGA</strong> supplier.<br />
An <strong>FPGA</strong> was selected for the flexibility, small form fac<strong>to</strong>r <strong><strong>an</strong>d</strong> the ability <strong>to</strong><br />
provide a variety of I/O options required by the equipment. The <strong>Lattice</strong> <strong>ECP3</strong><br />
Family was selected because of its low cost, low power, high speed SERDES,<br />
DSP functionality <strong><strong>an</strong>d</strong> the availability of a robust Tri-Mode <strong>Ethernet</strong> MAC.<br />
The <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> was selected because of its small footprint, flexible<br />
interface, power m<strong>an</strong>agement capability <strong><strong>an</strong>d</strong> adv<strong>an</strong>ced features.<br />
In this section of the application note we will review the <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong>,<br />
<strong><strong>an</strong>d</strong> the <strong>Lattice</strong> <strong>ECP3</strong> Family. This combination of devices is excellent for a<br />
wide r<strong>an</strong>ge of applications in the consumer, industrial, communications <strong><strong>an</strong>d</strong><br />
networking industries- <strong><strong>an</strong>d</strong> in particular for our target application where low<br />
power, a small form fac<strong>to</strong>r, DSP processing power <strong><strong>an</strong>d</strong> future extendibility are<br />
import<strong>an</strong>t. The following sections provide a quick overview of each device<br />
family, identifies key features that make them good selections for our target<br />
application <strong><strong>an</strong>d</strong> determines the best device within the family for our specific<br />
application.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
<strong>Micrel</strong> <strong>Ethernet</strong> Devices<br />
<strong>Micrel</strong> offers a wide r<strong>an</strong>ge of <strong>Ethernet</strong> physical layer devices. All <strong>Micrel</strong> devices come with options for various voltages, Lead Free, Industrial or with HP Au<strong>to</strong>-<br />
MDIX crossover features. A summary list of the main <strong>Micrel</strong> <strong>PHY</strong> devices is given in Table 1 below. Depending on the feature options selected the part number<br />
is modified. For example, <strong>an</strong> “I” designa<strong>to</strong>r on the end of the part number indicates <strong>an</strong> Industrial temperature rating. A selec<strong>to</strong>r guide with all the specific part<br />
numbers is available at http://www.micrel.com/_PDF/<strong>Ethernet</strong>/ethernet.pdf.<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
Product Voltages Lead Free Industrial LinkMD<br />
KSZ8021 3.3V Yes Yes Yes<br />
KSZ8031 3.3V Yes Yes Yes<br />
KSZ8041 3.3V Yes Yes Yes or No<br />
KSZ8051 3.3V Yes Yes Yes<br />
KSZ8721 2.5V/3.3V Yes Yes Yes or No<br />
Table 1: <strong>Micrel</strong> <strong>Ethernet</strong> Controller Products Summary<br />
<strong>Micrel</strong> KSZ8051NL Overview<br />
With the core at 1.2 volts <strong>to</strong> meet low voltage <strong><strong>an</strong>d</strong> low-power requirements, the KSZ8051MLL is a 10BASE-T/100BASE-TX Physical Layer Tr<strong>an</strong>sceiver with<br />
Media Independent Interface (MII) <strong>to</strong> tr<strong>an</strong>smit <strong><strong>an</strong>d</strong> receive data. A unique mixed signal design extends signaling dist<strong>an</strong>ce while reducing power consumption. The<br />
KSZ8051MLL is a highly-integrated, compact solution. It reduces board cost <strong><strong>an</strong>d</strong> simplifies board layout by using on-chip termination resis<strong>to</strong>rs for the differential<br />
pairs <strong><strong>an</strong>d</strong> by integrating a low-noise regula<strong>to</strong>r <strong>to</strong> supply the 1.2V core.<br />
The KSZ8051MLL provides diagnostic features <strong>to</strong> facilitate system bring-up <strong><strong>an</strong>d</strong> debugging in production testing <strong><strong>an</strong>d</strong> in product development. Parametric NAND<br />
tree support enables fault detection between KSZ8051MLL I/Os <strong><strong>an</strong>d</strong> the board. <strong>Micrel</strong> LINKMD TDR-based cable diagnostics permit identification of faulty copper<br />
cabling. Remote <strong><strong>an</strong>d</strong> local loopback functions provide verification of <strong>an</strong>alog <strong><strong>an</strong>d</strong> digital data paths.<br />
The signal list for the KSZ8051MLL is shown in Table 2 below. The interface <strong>to</strong> the MAC c<strong>an</strong> use the MII st<strong><strong>an</strong>d</strong>ard.<br />
Name Type Description<br />
TXD0 I Tr<strong>an</strong>smit Data 0: Bit 0 of the 4 data bits that are accepted by the <strong>PHY</strong> for tr<strong>an</strong>smission.<br />
TXD1 I Tr<strong>an</strong>smit Data 1: Bit 0 of the 4 data bits that are accepted by the <strong>PHY</strong> for tr<strong>an</strong>smission.<br />
TXD2 I Tr<strong>an</strong>smit Data 2: Bit 0 of the 4 data bits that are accepted by the <strong>PHY</strong> for tr<strong>an</strong>smission.<br />
TXD3 I Tr<strong>an</strong>smit Data 3: Bit 0 of the 4 data bits that are accepted by the <strong>PHY</strong> for tr<strong>an</strong>smission.<br />
TXEN I Tr<strong>an</strong>smit Enable Input: Indicates that valid data is presented on the TXD[3:0] signals, for tr<strong>an</strong>smission.<br />
TXC O Tr<strong>an</strong>smit Clock Output: 25MHz in 100Base-TX mode, 2.5MHz in 10Base-T mode.<br />
RXD3/ <strong>PHY</strong>AD0 I/O Receive Data 3: Bit 3 of the 4 data bits that are sent by the <strong>PHY</strong> in the receiver path.<br />
<strong>PHY</strong> ADDR[0]: sets <strong>PHY</strong>ADDR[0] during initialization.<br />
RXD2/ <strong>PHY</strong>AD1 I/O Receive Data 2: Bit 2 of the 4 data bits that are sent by the <strong>PHY</strong> in the receiver path.<br />
<strong>PHY</strong> ADDR[1]: sets <strong>PHY</strong>ADDR[1] during initialization.<br />
RXD1/ <strong>PHY</strong>AD2 I/O Receive Data 1: Bit 1 of the 4 data bits that are sent by the <strong>PHY</strong> in the receiver path.<br />
<strong>PHY</strong> ADDR[2]: sets <strong>PHY</strong>ADDR[2] during initialization.<br />
RXD0/ DUPLEX I/O Receive Data 0: Bit 0 of the 4 data bits that are sent by the <strong>PHY</strong> in the receiver path.<br />
DUPLEX: sets DUPLEX during initialization.<br />
RXER/ ISO O Receive Error: Asserted <strong>to</strong> indicate that <strong>an</strong> error was detected somewhere in the frame presently being tr<strong>an</strong>sferred from the <strong>PHY</strong>.<br />
ISO: Sets ISO during initialization.<br />
RX_DV/ CONFIG2 O Receive Data Valid Output: Indicates that recovered <strong><strong>an</strong>d</strong> decoded data nibbles are being presented on RXD[3:0].<br />
CONFIG2: sets CONFIG2 during initialization.<br />
RXC/B-CAST_OFF O Receive Clock Output: 25MHz in 100Base-TX mode. 2.5MHz in 10Base-T mode.<br />
CONFIG Mode: B-CAST_OFF set during initialization.<br />
COL/CONFIG0 O Collision Detect: Asserted <strong>to</strong> indicate detection of collision condition.<br />
CONFIG MODE: CONFIG0 set during initialization.<br />
MDIO I/O M<strong>an</strong>agement Data Input/Output: Serial m<strong>an</strong>agement data input/output. External 1K Ohm pull-up.<br />
MDC I M<strong>an</strong>agement Clock: Serial m<strong>an</strong>agement clock.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
Name Type Description<br />
CRS/CONFIG1 O Carrier Sense Output. Indicates presence of Carrier on the media.<br />
CONFIG MODE: CONFIG1 set during initialization<br />
INTRP/ NAND_Tree# I/O Interrupt Output: Programmable interrupt indication.<br />
CONFIG MODE: NAND_Tree# set during initialization.<br />
RST# I External Reset- input of the system reset.<br />
XI I/O Clock Input- 25MHz external clock or crystal input.<br />
XO O Crystal Feedback.<br />
LED0/NWAYEN O Programmable LED Output<br />
CONFIG MODE: NWAYEN set during initialization<br />
LED1/SPEED O Programmable LED Output<br />
CONFIG MODE: SPEED set during initialization<br />
TXP AO Tr<strong>an</strong>smit Data Positive: 100Base-TX or 10Base-T differential tr<strong>an</strong>smit outputs <strong>to</strong> magnetic.<br />
TXM AO Tr<strong>an</strong>smit Data Negative: 100Base-TX or 10Base-T differential tr<strong>an</strong>smit outputs <strong>to</strong> magnetic.<br />
RXP AI Receive Data Positive: 100Base-TX or 10Base-T differential tr<strong>an</strong>smit inputs from magnetic.<br />
RXM AI Receive Data Negative: 100Base-TX or 10Base-T differential tr<strong>an</strong>smit inputs from magnetic.<br />
REXT IO Connects <strong>to</strong> reference resis<strong>to</strong>r of value 6.49K-Ohm <strong>to</strong> ground<br />
VDD_1.2 POWER 1.2V Core Voltage supplied by on-chip regula<strong>to</strong>r<br />
VDDIO POWER +3.3V, 2.5V or 1.8V Digital IO Voltage<br />
VDDA3.3 POWER +3.3V Analog Power<br />
GND POWER Ground<br />
Table 2: <strong>Micrel</strong> KSZ8051MLL Pin Descriptions<br />
KSZ8051MLL Functional Description<br />
The KSZ8051MLL is <strong>an</strong> integrated single 3.3V supply Fast <strong>Ethernet</strong><br />
tr<strong>an</strong>sceiver. It is fully compli<strong>an</strong>t with the IEEE 802.3 Specification, <strong><strong>an</strong>d</strong><br />
reduces board cost <strong><strong>an</strong>d</strong> simplifies board layout by using on-chip termination<br />
resis<strong>to</strong>rs for the two differential pairs <strong><strong>an</strong>d</strong> by integrating the regula<strong>to</strong>r <strong>to</strong><br />
supply the 1.2V core. On the copper media side, the KSZ8051MLL supports<br />
10Base-T <strong><strong>an</strong>d</strong> 100Base-TX for tr<strong>an</strong>smission <strong><strong>an</strong>d</strong> reception of data over a<br />
st<strong><strong>an</strong>d</strong>ard CAT-5 unshielded twisted pair (UTP) cable, <strong><strong>an</strong>d</strong> HP au<strong>to</strong> MDI/MDI-X<br />
for reliable detection of <strong><strong>an</strong>d</strong> correction for straight-through <strong><strong>an</strong>d</strong> crossover<br />
cables. On the MAC processor side, the KSZ8051MLL offers the Media<br />
Independent Interface (MII) for direct connection with MII compli<strong>an</strong>t <strong>Ethernet</strong><br />
MAC processors <strong><strong>an</strong>d</strong> switches. The MII m<strong>an</strong>agement bus option gives the<br />
MAC processor complete access <strong>to</strong> the KSZ8051MLL control <strong><strong>an</strong>d</strong> status<br />
registers. Additionally, <strong>an</strong> interrupt pin eliminates the need for the processor<br />
<strong>to</strong> poll for <strong>PHY</strong> status ch<strong>an</strong>ge.<br />
100Base-TX Tr<strong>an</strong>smit<br />
The 100Base-TX tr<strong>an</strong>smit function performs parallel-<strong>to</strong>-serial conversion,<br />
4B/5B encoding, scrambling, NRZ-<strong>to</strong>-NRZI conversion, <strong><strong>an</strong>d</strong> MLT3 encoding<br />
<strong><strong>an</strong>d</strong> tr<strong>an</strong>smission. The circuitry starts with a parallel-<strong>to</strong>-serial conversion,<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
which converts the MII data from the MAC in<strong>to</strong> a 125MHz serial bit stream.<br />
The data <strong><strong>an</strong>d</strong> control stream is then converted in<strong>to</strong> 4B/5B coding <strong><strong>an</strong>d</strong><br />
followed by a scrambler. The serialized data is further converted from NRZ<strong>to</strong>-NRZI<br />
format, <strong><strong>an</strong>d</strong> then tr<strong>an</strong>smitted in MLT3 current output. The output<br />
current is set by <strong>an</strong> external 6.49K Ohm 1% resis<strong>to</strong>r for the 1:1 tr<strong>an</strong>sformer<br />
ratio. The output signal has a typical rise/fall time of 4ns <strong><strong>an</strong>d</strong> complies with<br />
the ANSI TP-PMD st<strong><strong>an</strong>d</strong>ard regarding amplitude bal<strong>an</strong>ce, overshoot, <strong><strong>an</strong>d</strong><br />
timing jitter. The wave-shaped 10Base-T output is also incorporated in<strong>to</strong> the<br />
100Base-TX tr<strong>an</strong>smitter.<br />
100Base-TX Receive<br />
The 100Base-TX receiver function performs adaptive equalization, DC<br />
res<strong>to</strong>ration, MLT3-<strong>to</strong>-NRZI conversion, data <strong><strong>an</strong>d</strong> clock recovery, NRZI-<strong>to</strong>-<br />
NRZ conversion, de-scrambling, 4B/5B decoding, <strong><strong>an</strong>d</strong> serial-<strong>to</strong>-parallel<br />
conversion. The receiving side starts with the equalization filter <strong>to</strong><br />
compensate for inter-symbol interference (ISI) over the twisted pair cable.<br />
Since the amplitude loss <strong><strong>an</strong>d</strong> phase dis<strong>to</strong>rtion is a function of the cable<br />
length, the equalizer must adjust its characteristics <strong>to</strong> optimize perform<strong>an</strong>ce.<br />
In this design, the variable equalizer makes <strong>an</strong> initial estimation based<br />
on comparisons of incoming signal strength against some known
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
cable characteristics, <strong><strong>an</strong>d</strong> then tunes itself for optimization. This is <strong>an</strong><br />
ongoing process <strong><strong>an</strong>d</strong> self-adjusts against environmental ch<strong>an</strong>ges such<br />
as temperature variations. Next, the equalized signal goes through a DC<br />
res<strong>to</strong>ration <strong><strong>an</strong>d</strong> data conversion block. The DC res<strong>to</strong>ration circuit is used <strong>to</strong><br />
compensate for the effect of baseline w<strong><strong>an</strong>d</strong>er <strong><strong>an</strong>d</strong> <strong>to</strong> improve the dynamic<br />
r<strong>an</strong>ge. The differential data conversion circuit converts the MLT3 format back<br />
<strong>to</strong> NRZI. The slicing threshold is also adaptive. The clock recovery circuit<br />
extracts the 125MHz clock from the edges of the NRZI signal. This recovered<br />
clock is then used <strong>to</strong> convert the NRZI signal in<strong>to</strong> the NRZ format. This signal<br />
is sent through the de-scrambler followed by the 4B/5B decoder. Finally, the<br />
NRZ serial data is converted <strong>to</strong> the MII format <strong><strong>an</strong>d</strong> provided as the input data<br />
<strong>to</strong> the MAC.<br />
10Base-T Tr<strong>an</strong>smit<br />
The 10Base-T drivers are incorporated with the 100Base-TX drivers <strong>to</strong> allow<br />
for tr<strong>an</strong>smission using the same magnetic. The drivers perform internal<br />
wave-shaping <strong><strong>an</strong>d</strong> pre-emphasis, <strong><strong>an</strong>d</strong> output 10Base-T signals with typical<br />
amplitude of 2.5V peak. The 10Base-T signals have harmonic contents that<br />
are at least 27dB below the fundamental frequency when driven by <strong>an</strong> allones<br />
M<strong>an</strong>chester-encoded signal.<br />
10Base-T Receive<br />
On the receive side, input buffer <strong><strong>an</strong>d</strong> level detecting squelch circuits are<br />
employed. A differential input receiver circuit <strong><strong>an</strong>d</strong> a PLL performs the<br />
decoding function. The M<strong>an</strong>chester-encoded data stream is separated in<strong>to</strong><br />
clock signal <strong><strong>an</strong>d</strong> NRZ data. A squelch circuit rejects signals with levels less<br />
th<strong>an</strong> 400 mV or with short pulse widths <strong>to</strong> prevent noise at the RXP <strong><strong>an</strong>d</strong> RXM<br />
inputs from falsely trigger the decoder. When the input exceeds the squelch<br />
limit, the PLL locks on<strong>to</strong> the incoming signal <strong><strong>an</strong>d</strong> the KSZ8051MLL decodes<br />
a data frame. The receive clock is kept active during idle periods in between<br />
data reception.<br />
Scrambler/De-Scrambler (100Base-TX Only)<br />
The scrambler is used <strong>to</strong> spread the power spectrum of the tr<strong>an</strong>smitted<br />
signal <strong>to</strong> reduce EMI <strong><strong>an</strong>d</strong> baseline w<strong><strong>an</strong>d</strong>er, <strong><strong>an</strong>d</strong> the de-scrambler is needed<br />
<strong>to</strong> recover the scrambled signal. SQE <strong><strong>an</strong>d</strong> Jabber Function (10Base-T Only)<br />
In 10Base-T operation, a short pulse is put out on the COL pin after each<br />
frame is tr<strong>an</strong>smitted. This SQE Test is required as a test of the 10Base-T<br />
tr<strong>an</strong>smit/receive path. If tr<strong>an</strong>smit enable (TXEN) is high for more th<strong>an</strong> 20 ms<br />
(jabbering), the 10Base-T tr<strong>an</strong>smitter is disabled <strong><strong>an</strong>d</strong> COL is asserted high. If<br />
TXEN is then driven low for more th<strong>an</strong> 250 ms, the 10Base-T tr<strong>an</strong>smitter is<br />
re-enabled <strong><strong>an</strong>d</strong> COL is de-asserted (returns <strong>to</strong> low).<br />
PLL Clock Synthesizer<br />
The KSZ8051MLL generates all internal clocks <strong><strong>an</strong>d</strong> all external clocks for<br />
system timing from <strong>an</strong> external 25MHz crystal, oscilla<strong>to</strong>r, or reference clock.<br />
Au<strong>to</strong>-Negotiation<br />
The KSZ8051MLL conforms <strong>to</strong> the au<strong>to</strong>-negotiation pro<strong>to</strong>col, defined in<br />
Clause 28 of the IEEE 802.3 Specification. Au<strong>to</strong>-negotiation allows UTP<br />
(Unshielded Twisted Pair) link partners <strong>to</strong> select the highest common mode<br />
of operation. During au<strong>to</strong>-negotiation, link partners advertise capabilities<br />
across the UTP link <strong>to</strong> each other, <strong><strong>an</strong>d</strong> then compare their own capabilities<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
with those they received from their link partners. The highest speed <strong><strong>an</strong>d</strong><br />
duplex setting that is common <strong>to</strong> the two link partners is selected as the<br />
mode of operation.<br />
MII Data Interface<br />
The Media Independent Interface (MII) is compli<strong>an</strong>t with the IEEE 802.3<br />
Specification. It provides a common interface between MII <strong>PHY</strong>s <strong><strong>an</strong>d</strong> MACs,<br />
<strong><strong>an</strong>d</strong> has the following key characteristics:<br />
• Pin count is 15 pins (6 pins for data tr<strong>an</strong>smission, 7 pins for data<br />
reception, <strong><strong>an</strong>d</strong> 2 pins for carrier <strong><strong>an</strong>d</strong> collision indication).<br />
• 10Mbps <strong><strong>an</strong>d</strong> 100Mbps data rates are supported at both half <strong><strong>an</strong>d</strong> full<br />
duplex.<br />
• Data tr<strong>an</strong>smission <strong><strong>an</strong>d</strong> reception are independent <strong><strong>an</strong>d</strong> belong <strong>to</strong> separate<br />
signal groups.<br />
• Tr<strong>an</strong>smit data <strong><strong>an</strong>d</strong> receive data are each 4-bit wide, a nibble.<br />
By default, the KSZ8051MLL is configured <strong>to</strong> MII mode after it is powered up<br />
or hardware reset with the following:<br />
• A 25MHz crystal connected <strong>to</strong> XI, XO (pins 15, 14), or <strong>an</strong> external 25MHz<br />
clock source (oscilla<strong>to</strong>r) connected <strong>to</strong> XI.<br />
• The CONFIG[2:0] strapping pins (pins 27, 41, 40) set <strong>to</strong> ‘000’ (default<br />
setting).<br />
MII Signal Definition<br />
Tr<strong>an</strong>smit Clock (TXC)<br />
TXC is sourced by the <strong>PHY</strong>. It is a continuous clock that provides the timing<br />
reference for TXEN <strong><strong>an</strong>d</strong> TXD[3:0]. TXC is 2.5MHz for 10Mbps operation <strong><strong>an</strong>d</strong><br />
25MHz for 100Mbps operation.<br />
Tr<strong>an</strong>smit Enable (TXEN)<br />
TXEN indicates the MAC is presenting nibbles on TXD[3:0] for tr<strong>an</strong>smission. It<br />
is asserted synchronously with the first nibble of the preamble <strong><strong>an</strong>d</strong> remains<br />
asserted while all nibbles <strong>to</strong> be tr<strong>an</strong>smitted are presented on the MII, <strong><strong>an</strong>d</strong><br />
is negated prior <strong>to</strong> the first TXC following the final nibble of a frame. TXEN<br />
tr<strong>an</strong>sitions synchronously with respect <strong>to</strong> TXC.<br />
Tr<strong>an</strong>smit Data [3:0] (TXD[3:0])<br />
TXD[3:0] tr<strong>an</strong>sitions synchronously with respect <strong>to</strong> TXC. When TXEN is<br />
asserted, TXD[3:0] are accepted for tr<strong>an</strong>smission by the <strong>PHY</strong>. TXD[3:0] is<br />
”00” <strong>to</strong> indicate idle when TXEN is de-asserted. Values other th<strong>an</strong> “00” on<br />
TXD[3:0] while TXEN is de-asserted are ignored by the <strong>PHY</strong>.<br />
Receive Clock (RXC)<br />
RXC provides the timing reference for RXDV, RXD[3:0], <strong><strong>an</strong>d</strong> RXER. In 10Mbps<br />
mode, RXC is recovered from the line while carrier is active. RXC is derived<br />
from the <strong>PHY</strong>’s reference clock when the line is idle, or link is down. In<br />
100Mbps mode, RXC is continuously recovered from the line. If link is down,<br />
RXC is derived from the <strong>PHY</strong>’s reference clock. RXC is 2.5MHz for 10Mbps<br />
operation <strong><strong>an</strong>d</strong> 25MHz for 100Mbps operation.<br />
Receive Data Valid (RXDV) RXDV is driven by the <strong>PHY</strong> <strong>to</strong> indicate that the<br />
<strong>PHY</strong> is presenting recovered <strong><strong>an</strong>d</strong> decoded nibbles on RXD[3:0]. In 10Mbps
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
mode, RXDV is asserted with the first nibble of the SFD (Start of Frame<br />
Delimiter), “5D”, <strong><strong>an</strong>d</strong> remains asserted until the end of the frame. In<br />
100Mbps mode, RXDV is asserted from the first nibble of the preamble <strong>to</strong> the<br />
last nibble of the frame. RXDV tr<strong>an</strong>sitions synchronously with respect <strong>to</strong> RXC.<br />
Receive Data[3:0] (RXD[3:0])<br />
RXD[3:0] tr<strong>an</strong>sitions synchronously with respect <strong>to</strong> RXC. For each clock<br />
period in which RXDV is asserted, RXD[3:0] tr<strong>an</strong>sfers a nibble of recovered<br />
data from the <strong>PHY</strong>.<br />
Receive Error (RXER)<br />
RXER is asserted for one or more RXC periods <strong>to</strong> indicate that a Symbol<br />
Error (e.g. a coding error that a <strong>PHY</strong> is capable of detecting, <strong><strong>an</strong>d</strong> that may<br />
otherwise be undetectable by the MAC sub-layer) was detected somewhere<br />
in the frame presently being tr<strong>an</strong>sferred from the <strong>PHY</strong>. RXER tr<strong>an</strong>sitions<br />
synchronously with respect <strong>to</strong> RXC. While RXDV is de-asserted, RXER has no<br />
effect on the MAC.<br />
Carrier Sense (CRS)<br />
CRS is asserted <strong><strong>an</strong>d</strong> de-asserted as follows: In 10Mbps mode, CRS assertion<br />
is based on the reception of valid preambles. CRS de-assertion is based on<br />
the reception of <strong>an</strong> end-of-frame (EOF) marker. In 100Mbps mode, CRS is<br />
asserted when a start-of-stream delimiter, or /J/K symbol pair is detected.<br />
CRS is de-asserted when <strong>an</strong> end-of-stream delimiter, or /T/R symbol pair<br />
is detected. Additionally, the PMA layer de-asserts CRS if IDLE symbols are<br />
received without /T/R.<br />
Collision (COL)<br />
COL is asserted in half-duplex mode whenever the tr<strong>an</strong>smitter <strong><strong>an</strong>d</strong> receiver<br />
are simult<strong>an</strong>eously active on the line. This is used <strong>to</strong> inform the MAC that<br />
a collision has occurred during its tr<strong>an</strong>smission <strong>to</strong> the <strong>PHY</strong>. COL tr<strong>an</strong>sitions<br />
asynchronously with respect <strong>to</strong> TXC <strong><strong>an</strong>d</strong> RXC.<br />
Power M<strong>an</strong>agement<br />
The KSZ8051MLL offers the following power m<strong>an</strong>agement modes:<br />
Power Saving Mode: Power-Saving Mode is used <strong>to</strong> reduce the tr<strong>an</strong>sceiver<br />
power consumption when the cable is unplugged. It is enabled by writing a<br />
one <strong>to</strong> register 1Fh, bit 10, <strong><strong>an</strong>d</strong> is in effect when au<strong>to</strong>-negotiation mode is<br />
enabled <strong><strong>an</strong>d</strong> cable is disconnected (no link). In this mode, the KSZ8051MLL<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
Figure 1: Interconnection between <strong>Lattice</strong> <strong>FPGA</strong> <strong><strong>an</strong>d</strong> <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong><br />
shuts down all tr<strong>an</strong>sceiver blocks, except for tr<strong>an</strong>smitter, energy detect <strong><strong>an</strong>d</strong><br />
PLL circuits. By default, Power-Saving Mode is disabled after power-up.<br />
Energy Detect Power-Down Mode: Energy Detect Power-Down Mode is used<br />
<strong>to</strong> further reduce the tr<strong>an</strong>sceiver power consumption when the cable is unplugged.<br />
It is enabled by writing a zero <strong>to</strong> register 18h, bit 11, <strong><strong>an</strong>d</strong> is in effect<br />
when au<strong>to</strong>-negotiation mode is enabled <strong><strong>an</strong>d</strong> cable is disconnected (no link).<br />
In this mode, the KSZ8051MLL shuts down all tr<strong>an</strong>sceiver blocks, except<br />
for tr<strong>an</strong>smitter <strong><strong>an</strong>d</strong> energy detect circuits. Further power consumption is<br />
achieved by extending the time interval in between tr<strong>an</strong>smissions of link<br />
pulses <strong>to</strong> check for the presence of a link partner. The periodic tr<strong>an</strong>smission<br />
of link pulses is needed <strong>to</strong> ensure two link partners in the same low power<br />
state <strong><strong>an</strong>d</strong> with au<strong>to</strong> MDI/MDI-X disabled c<strong>an</strong> wake up when the cable is<br />
connected between them. By default, Energy Detect Power-Down Mode is<br />
disabled after power-up.<br />
Power-Down Mode: Power-Down Mode is used <strong>to</strong> power down the<br />
KSZ8051MLL device when it is not in use after power-up. It is enabled<br />
by writing a one <strong>to</strong> register 0h, bit 11. In this mode, the KSZ8051MLL<br />
disables all internal functions, except for the MII m<strong>an</strong>agement interface. The<br />
KSZ8051MLL exits (disables) Power-Down Mode after register 0h, bit 11 is<br />
set back <strong>to</strong> zero.<br />
Slow Oscilla<strong>to</strong>r Mode: Slow Oscilla<strong>to</strong>r Mode is used <strong>to</strong> disconnect the input<br />
reference crystal/clock on XI (pin 15) <strong><strong>an</strong>d</strong> select the on-chip slow oscilla<strong>to</strong>r<br />
when the KSZ8051MLL device is not in use after power-up. It is enabled<br />
by writing a one <strong>to</strong> register 11h, bit 5. Slow Oscilla<strong>to</strong>r Mode works in<br />
conjunction with Power-Down Mode <strong>to</strong> put the KSZ8051MLL device in the<br />
lowest power state with all internal functions disabled, except for the MII<br />
m<strong>an</strong>agement interface.<br />
KSZ8051MLL <strong>to</strong> <strong>FPGA</strong> Connectivity<br />
The Media Independent Interface (MII) is used <strong>to</strong> connect between the<br />
<strong>FPGA</strong> <strong><strong>an</strong>d</strong> the <strong>PHY</strong>. The MII st<strong><strong>an</strong>d</strong>ard requires 16 pins for each MAC <strong>to</strong> <strong>PHY</strong><br />
interface. A block diagram of the MII connectivity between the KSZ8051MLL<br />
<strong><strong>an</strong>d</strong> the <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> is shown in Figure 1 below. The signal<br />
assignments <strong><strong>an</strong>d</strong> constraints required for the <strong>FPGA</strong> will be discussed in more<br />
detail in the <strong>FPGA</strong> Design section of this document. Import<strong>an</strong>t board level<br />
considerations like grounding, layout <strong><strong>an</strong>d</strong> routing constraints will be covered<br />
in the Board Design section of this document.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
Midcom MIC24 Series of RJ-45 Connec<strong>to</strong>rs with Integrated Magnetics<br />
Midcom offers a family of devices with the <strong>Ethernet</strong> line isolation magnetics<br />
combined in the required RJ45 cable jack. This combined single device helps<br />
<strong>to</strong> reduce board space, improves signal integrity, increases reliability <strong><strong>an</strong>d</strong><br />
also simplifies board layout. The wide r<strong>an</strong>ge of available devices provides a<br />
perfect match for just about <strong>an</strong>y application: routers <strong><strong>an</strong>d</strong> switches benefit<br />
from the high density provided by stackable configurations with integrated<br />
status LEDs, consumer applications c<strong>an</strong> use <strong>an</strong> option without <strong>an</strong> LED when<br />
status isn’t required, different pin-out options, optional EMI tabs help in noise<br />
sensitive applications, <strong><strong>an</strong>d</strong> support for both tab up <strong><strong>an</strong>d</strong> tab down orientation<br />
simplifies the mech<strong>an</strong>ical aspects of the cable interface.<br />
These devices come compli<strong>an</strong>t <strong>to</strong> <strong>Ethernet</strong> 10, 10/100 or gigabit st<strong><strong>an</strong>d</strong>ards<br />
<strong><strong>an</strong>d</strong> are available in single port <strong><strong>an</strong>d</strong> multi-port form fac<strong>to</strong>rs as well as in thru<br />
hole or surface mount formats. Power Over <strong>Ethernet</strong> (PoE) is also available<br />
for the 10/100 st<strong><strong>an</strong>d</strong>ard. For our application we will focus on the single port,<br />
<strong>Ethernet</strong> 10/100 st<strong><strong>an</strong>d</strong>ard in the thru hole format. This still provides us with<br />
a very wide r<strong>an</strong>ge of options <strong>to</strong> select from. A subset of all the available<br />
devices is shown in Table 3 below <strong>to</strong> illustrate the wide r<strong>an</strong>ge of options<br />
available <strong>to</strong> us. (Additional differences between some devices are pin-out<br />
related <strong><strong>an</strong>d</strong> are not illustrated in this table for simplicity. You c<strong>an</strong> refer <strong>to</strong> the<br />
Midcom product selec<strong>to</strong>r guide listed in the reference section of this app<br />
note for additional details.)<br />
Part Number LED Tabs<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
EMI<br />
Fingers<br />
Au<strong>to</strong><br />
MDIX<br />
Temp RoHS<br />
MIC24010-0107T NONE DOWN YES YES ETR NO<br />
MIC24010-0107T-LF3 NONE DOWN YES YES ETR YES<br />
MIC24010-5101T-LF3 NONE DOWN YES YES STR YES<br />
MIC24010-5104T-LF3 NONE DOWN YES YES STR YES<br />
MIC24011-0101T L-Y R-G DOWN YES STR STR NO<br />
MIC24011-0101T-LF3 L-Y R-G DOWN YES YES STR YES<br />
MIC24011-0101W-LF3 L-Y R-G DOWN YES YES STR YES<br />
MIC24011-0104T L-Y R-G DOWN YES STR STR NO<br />
MIC24011-0104T-LF3 L-Y R-G DOWN YES YES STR YES<br />
MIC24011-5108T-LF3 L-Y R-G DOWN YES YES ETR YES<br />
MIC24012-5101T-LF3 L-G R-G DOWN YES YES STR YES<br />
MIC24012-5117T-LF3 L-G R-G DOWN YES YES ETR YES<br />
MIC24012-5204T-LF3 L-G R-G DOWN YES YES STR YES<br />
MIC24013-0102T L-G R-Y DOWN YES STR STR NO<br />
MIC24013-5104T-LF3 L-G R-Y DOWN YES YES STR YES<br />
MIC24013-5204T-LF3 L-G R-Y DOWN YES YES STR YES<br />
MIC24018-5101T-LF3 L-R R-G DOWN YES YES STR YES<br />
MIC24019-0101T L-G R-R DOWN YES STR NO NO<br />
MIC2401D-5217T-LF3 L-GY R-GY DOWN YES YES ETR YES<br />
Table 3: Selected Midcom RJ45 <strong>Ethernet</strong> MIC24 Series Devices<br />
Device Selection<br />
In our application status indication is import<strong>an</strong>t as is keeping board space<br />
small. Noise is also a consideration <strong><strong>an</strong>d</strong> should be reduced where possible.<br />
To simplify installation au<strong>to</strong> MDIX (the ability <strong>to</strong> sense <strong><strong>an</strong>d</strong> correct for cable<br />
‘twists’) is also desirable.<br />
For our application we will also w<strong>an</strong>t a device with <strong>an</strong> LED configuration<br />
of a yellow LED on the left <strong><strong>an</strong>d</strong> a green LED on the right (L-Y R-G). We also<br />
w<strong>an</strong>t RoHS compli<strong>an</strong>ce <strong><strong>an</strong>d</strong> the ability <strong>to</strong> use either <strong>an</strong> extended or st<strong><strong>an</strong>d</strong>ard<br />
temperature r<strong>an</strong>ge.<br />
The Midcom MIC24011-0101T-LF3 is through hole mounted, has Yellow <strong><strong>an</strong>d</strong><br />
Red LEDs, a tab down orientation, EMI fl<strong>an</strong>ges, Au<strong>to</strong> MDIX support, <strong><strong>an</strong>d</strong> is<br />
RoHS compli<strong>an</strong>t. It is also compatible with both 10Base-T <strong><strong>an</strong>d</strong> 100Base-T<br />
<strong>Ethernet</strong> st<strong><strong>an</strong>d</strong>ards.<br />
MIC24011-0101T-LF3 Connectivity<br />
The connections between the <strong>Micrel</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> the MIC24011-0101T-LF3 are<br />
the tr<strong>an</strong>smit <strong><strong>an</strong>d</strong> receive signals <strong><strong>an</strong>d</strong> the LED control signals. A summary of<br />
the detailed connections are given below with <strong>PHY</strong> being the <strong>Micrel</strong> <strong>PHY</strong> pin<br />
<strong><strong>an</strong>d</strong> PMD being the MIC24011-0101T-LF3 pin:<br />
1) <strong>PHY</strong> TXP <strong>to</strong> PMD T+ <strong><strong>an</strong>d</strong> thru a 50Ohm resis<strong>to</strong>r <strong>to</strong> VCCO<br />
2) <strong>PHY</strong> TXN <strong>to</strong> PMD T- <strong><strong>an</strong>d</strong> thru a 50Ohm resis<strong>to</strong>r <strong>to</strong> VCCO<br />
3) PMD T center tap thru a 10Ohm resis<strong>to</strong>r <strong>to</strong> VCCO (Shared with PMD R)<br />
4) <strong>PHY</strong> RXP <strong>to</strong> PMD R+ <strong><strong>an</strong>d</strong> thru a 50Ohm resis<strong>to</strong>r <strong>to</strong> VCCO<br />
5) <strong>PHY</strong> RXN <strong>to</strong> PMD R- <strong><strong>an</strong>d</strong> thru a 50Ohm resis<strong>to</strong>r <strong>to</strong> VCCO<br />
6) PMD R center tap thru a 10Ohm resis<strong>to</strong>r <strong>to</strong> VCCO (Shared with PMD T)<br />
7) PMD T <strong><strong>an</strong>d</strong> R center taps thru a 22NF capaci<strong>to</strong>r <strong>to</strong> GND<br />
8) <strong>FPGA</strong> LED 1 thru a 330Ohm resis<strong>to</strong>r <strong>to</strong> LED1+ on the PHD<br />
9) <strong>FPGA</strong> LED 2 thru a 330Ohm resis<strong>to</strong>r <strong>to</strong> LED1+ on the PHD<br />
10) LED 1- <strong><strong>an</strong>d</strong> LED 2- on the PMD <strong>to</strong> GND<br />
<strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong>s<br />
The <strong>Lattice</strong><strong>ECP3</strong> (EConomy Plus Third generation) family of <strong>FPGA</strong> devices<br />
is optimized <strong>to</strong> deliver high perform<strong>an</strong>ce features such as <strong>an</strong> enh<strong>an</strong>ced<br />
DSP architecture, high speed SERDES <strong><strong>an</strong>d</strong> high speed source synchronous<br />
interfaces in <strong>an</strong> economical <strong>FPGA</strong> fabric. This combination is achieved<br />
through adv<strong>an</strong>ces in device architecture <strong><strong>an</strong>d</strong> the use of 65nm technology<br />
making the devices suitable for high-volume, high-speed, low-cost<br />
applications. The <strong>Lattice</strong><strong>ECP3</strong> device family exp<strong><strong>an</strong>d</strong>s look-up-table (LUT)<br />
capacity <strong>to</strong> 149K logic elements <strong><strong>an</strong>d</strong> supports up <strong>to</strong> 486 user I/Os. The<br />
<strong>Lattice</strong><strong>ECP3</strong> device family also offers up <strong>to</strong> 320 18x18 multipliers <strong><strong>an</strong>d</strong> a wide<br />
r<strong>an</strong>ge of parallel I/O st<strong><strong>an</strong>d</strong>ards.<br />
The <strong>Lattice</strong><strong>ECP3</strong> <strong>FPGA</strong> fabric is optimized with high perform<strong>an</strong>ce <strong><strong>an</strong>d</strong> low<br />
cost in mind. The <strong>Lattice</strong><strong>ECP3</strong> devices utilize reconfigurable SRAM logic<br />
technology <strong><strong>an</strong>d</strong> provide popular building blocks such as LUT-based logic,<br />
distributed <strong><strong>an</strong>d</strong> embedded memory, Phase Locked Loops (PLLs), Delay<br />
Locked Loops (DLLs), pre-engineered source synchronous I/O support,<br />
enh<strong>an</strong>ced sysDSP slices <strong><strong>an</strong>d</strong> adv<strong>an</strong>ced configuration support, including<br />
encryption <strong><strong>an</strong>d</strong> dual-boot capabilities.<br />
The pre-engineered source synchronous logic implemented in the<br />
<strong>Lattice</strong><strong>ECP3</strong> device family supports a broad r<strong>an</strong>ge of interface st<strong><strong>an</strong>d</strong>ards,<br />
including DDR3, XGMII <strong><strong>an</strong>d</strong> 7:1 LVDS. The <strong>Lattice</strong><strong>ECP3</strong> device family also<br />
features high speed SERDES with dedicated PCS functions. High jitter<br />
<strong>to</strong>ler<strong>an</strong>ce <strong><strong>an</strong>d</strong> low tr<strong>an</strong>smit jitter allow the SERDES plus PCS blocks <strong>to</strong><br />
be configured <strong>to</strong> support <strong>an</strong> array of popular data pro<strong>to</strong>cols including PCI<br />
Express, SMPTE, <strong>Ethernet</strong> (XAUI, GbE, <strong><strong>an</strong>d</strong> SGMII) <strong><strong>an</strong>d</strong> CPRI. Tr<strong>an</strong>smit Pre-
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
emphasis <strong><strong>an</strong>d</strong> Receive Equalization settings make the SERDES suitable for<br />
tr<strong>an</strong>smission <strong><strong>an</strong>d</strong> reception over various forms of media.<br />
The <strong>Lattice</strong><strong>ECP3</strong> devices also provide flexible, reliable <strong><strong>an</strong>d</strong> secure<br />
configuration options, such as dual-boot capability, bit-stream encryption,<br />
<strong><strong>an</strong>d</strong> Tr<strong>an</strong>sFR field upgrade features.<br />
The <strong>Lattice</strong> Diamond Design Software allows large complex designs <strong>to</strong> be<br />
efficiently implemented using the <strong>Lattice</strong><strong>ECP3</strong> <strong>FPGA</strong> family. Synthesis library<br />
support for <strong>Lattice</strong><strong>ECP3</strong> is available for popular logic synthesis <strong>to</strong>ols. The<br />
<strong>Lattice</strong> Diamond Design Software uses the synthesis <strong>to</strong>ol output along with<br />
the constraints from its floor pl<strong>an</strong>ning <strong>to</strong>ols <strong>to</strong> place <strong><strong>an</strong>d</strong> route the design<br />
in the <strong>Lattice</strong><strong>ECP3</strong> device. The Diamond Software <strong>to</strong>ol extracts the timing<br />
from the routing <strong><strong>an</strong>d</strong> back-<strong>an</strong>notates it in<strong>to</strong> the design for timing verification.<br />
<strong>Lattice</strong> provides m<strong>an</strong>y pre-engineered IP (Intellectual Property) modules for<br />
the <strong>Lattice</strong><strong>ECP3</strong> family. By using these configurable IP cores as st<strong><strong>an</strong>d</strong>ardized<br />
Table 4: <strong>Lattice</strong> <strong>ECP3</strong> Family Logic Function <strong><strong>an</strong>d</strong> IO Capabilities<br />
Device Selection Summary<br />
We have decided on the key components from which <strong>to</strong> construct our<br />
<strong>Ethernet</strong> subsystem. We chose the <strong>Micrel</strong> KSZ8051MLLL <strong>Ethernet</strong> <strong>PHY</strong> for<br />
its low cost, flexibility, adv<strong>an</strong>ced features, power saving capabilities <strong><strong>an</strong>d</strong><br />
small footprint. We selected the <strong>Lattice</strong> <strong>ECP3</strong>-70 for low power, high speed<br />
SERDES, adv<strong>an</strong>ced DSP capabilities, abund<strong>an</strong>t IO resources <strong><strong>an</strong>d</strong> low cost. We<br />
chose the Midcom RJ45 <strong>Ethernet</strong> connec<strong>to</strong>r for its high level of integration<br />
<strong><strong>an</strong>d</strong> excellent perform<strong>an</strong>ce characteristics.<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
blocks, designers are free <strong>to</strong> concentrate on the unique aspects of their<br />
design, increasing their productivity.<br />
Selecting the <strong>Lattice</strong> <strong>ECP3</strong> Device<br />
The selection of the target <strong>ECP3</strong> device depends on both the IO requirements<br />
<strong><strong>an</strong>d</strong> the logic requirements. For our target application let’s assume we<br />
need over 350 IOs <strong><strong>an</strong>d</strong> over 40K LUTs. Let’s also assume that our 18x18<br />
multiplier requirements are around 64, based on a quick review of the DSP<br />
oriented functions we need <strong>to</strong> implement. Table 4 below shows the r<strong>an</strong>ge of<br />
capabilities of the <strong>Lattice</strong> <strong>ECP3</strong> devices. The <strong>ECP3</strong>-70 device is the smallest<br />
that meets all of our key requirements. (During the design process we will<br />
have the option <strong>to</strong> design the interface in such a way that we c<strong>an</strong> migrate <strong>to</strong><br />
<strong>an</strong>other device with the same package footprint, with a different amount of<br />
logic capacity. This c<strong>an</strong> be useful if the design requirements might ch<strong>an</strong>ge<br />
late in the design process.)<br />
Now that we have selected our target devices we c<strong>an</strong> begin the design of<br />
the <strong>FPGA</strong> portion of the subsystem. This involves configuring the <strong>Ethernet</strong><br />
Controller that resides in the <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong>. This process is described in<br />
detail in the next section of this document.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
<strong>FPGA</strong> Design<br />
Once the key devices have been selected the <strong>FPGA</strong> stage of the design c<strong>an</strong><br />
be started. During this phase the designer will need <strong>to</strong> create <strong>an</strong> <strong>Ethernet</strong><br />
interface subsystem, inside the <strong>FPGA</strong>, <strong>to</strong> control the external <strong>PHY</strong>. There<br />
are a few choices available from <strong>Lattice</strong> <strong>to</strong> implement this function in <strong>an</strong><br />
<strong>ECP3</strong> Family device. There is a 10Gb+ <strong>Ethernet</strong> MAC, 2.5Gb <strong>Ethernet</strong> MAC,<br />
HiGig <strong>Ethernet</strong> MAC, <strong><strong>an</strong>d</strong> Tri-Speed <strong>Ethernet</strong> MAC. The Tri-Speed <strong>Ethernet</strong><br />
Controller IP Core supports Gigabit mode (1000Mbits/sec data rate) or the<br />
Fast <strong>Ethernet</strong> mode (10/100 Mbits/sec data rate). For our application, where<br />
backwards compatibility <strong>to</strong> the older pro<strong>to</strong>cols is import<strong>an</strong>t, the Tri-Speed IP<br />
Core is a good choice. A block diagram of which is shown in Figure 2, below.<br />
The Tri-Speed <strong>Ethernet</strong> MAC tr<strong>an</strong>smits <strong><strong>an</strong>d</strong> receives data between a host<br />
processor <strong><strong>an</strong>d</strong> <strong>an</strong> <strong>Ethernet</strong> network. The main function of the <strong>Ethernet</strong> MAC<br />
is <strong>to</strong> ensure that the Media Access rules specified in the 802.3 IEEE st<strong><strong>an</strong>d</strong>ard<br />
are met while tr<strong>an</strong>smitting a frame of data over <strong>Ethernet</strong>. On the receiving<br />
side, the <strong>Ethernet</strong> MAC extracts the different components of a frame <strong><strong>an</strong>d</strong><br />
tr<strong>an</strong>sfers them <strong>to</strong> higher applications through the FIFO interface.<br />
Figure2: <strong>Ethernet</strong> MAC IP Core Block Diagram<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
The data received from the G/MII interface is first buffered until sufficient<br />
data is available <strong>to</strong> be processed by the Receive MAC (Rx MAC). The<br />
Preamble <strong><strong>an</strong>d</strong> the Start of Frame Delimiter (SFD) information are then<br />
extracted from the incoming frame <strong>to</strong> determine the start of a valid frame.<br />
The Receive MAC checks the address of the received packet <strong><strong>an</strong>d</strong> validates<br />
whether the frame c<strong>an</strong> be received before tr<strong>an</strong>sferring it in<strong>to</strong> the FIFO. Only<br />
valid frames are tr<strong>an</strong>sferred in<strong>to</strong> the FIFO. This feature has the following two<br />
benefits: the systems need not re-calculate the Frame Check Sequence (FCS)<br />
again when the frame is being tr<strong>an</strong>smitted, <strong><strong>an</strong>d</strong> it also keeps the receive<br />
MAC relatively simple. The Tri-Speed MAC, however, always calculates CRC<br />
<strong>to</strong> check whether the frame was received error-free.<br />
On the tr<strong>an</strong>smit side, the Tx MAC is responsible for controlling access <strong>to</strong> the<br />
physical medium. The Tx MAC reads data from <strong>an</strong> external client Tx FIFO,<br />
formats this data in<strong>to</strong> <strong>an</strong> <strong>Ethernet</strong> packet <strong><strong>an</strong>d</strong> passes it <strong>to</strong> the G/MII module.<br />
The Tx MAC reads data from the Tx Client FIFO when the client indicates a<br />
packet is available, <strong><strong>an</strong>d</strong> the Tx MAC is in its appropriate state. The Tx MAC<br />
pre-fixes the Preamble <strong><strong>an</strong>d</strong> the Start-of-Frame Delimiter information <strong>to</strong><br />
the data <strong><strong>an</strong>d</strong> appends the Frame Check Sequence at the end of the data.<br />
In half-duplex operation, the Tx MAC s<strong>to</strong>res the first 64 bytes of data from
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
the external FIFO in <strong>an</strong> internal buffer, <strong>to</strong> be used in re-tr<strong>an</strong>smitting data on<br />
collisions. The SGMII Easy Connect configuration option adds pins <strong><strong>an</strong>d</strong> logic<br />
for seamless connection <strong>to</strong> the <strong>Lattice</strong>’s Gigabit <strong>Ethernet</strong> PCS IP core.<br />
<strong>Using</strong> the <strong>Lattice</strong> <strong>Ethernet</strong> Controller IP Core<br />
The TSMAC IP core is available for download from the <strong>Lattice</strong> IP Server using<br />
the IPexpress <strong>to</strong>ol. The IP files are au<strong>to</strong>matically installed using ispUPDATE<br />
technology in <strong>an</strong>y cus<strong>to</strong>mer-specified direc<strong>to</strong>ry. After the IP core has been<br />
installed, the IP core will be available in the IPexpress GUI dialog box shown<br />
in Figure 3.<br />
Figure 3: IPexpress GUI Dialog Box<br />
Once the IP Core is opened the user c<strong>an</strong> configure the various core<br />
parameters. The user specifies the following:<br />
• Project Path – Path <strong>to</strong> the direc<strong>to</strong>ry where the generated IP files will be<br />
located.<br />
• File Name – “username” designation given <strong>to</strong> the generated IP core <strong><strong>an</strong>d</strong><br />
corresponding folders <strong><strong>an</strong>d</strong> files.<br />
• (Diamond) Module Output – Verilog or VHDL.<br />
• (ispLEVER) Design Entry Type – Verilog HDL or VHDL.<br />
• Device Family – Device family <strong>to</strong> which IP is <strong>to</strong> be targeted (e.g.<br />
<strong>Lattice</strong>SCM, <strong>Lattice</strong> ECP2M, <strong>Lattice</strong><strong>ECP3</strong>, etc.). Only families that support the<br />
particular IP core are listed.<br />
• Part Name – Specific targeted part within the selected device family.<br />
Note that if the IPexpress <strong>to</strong>ol is called from within <strong>an</strong> existing project,<br />
Project Path, Module Output (Design Entry in ispLEVER), Device Family <strong><strong>an</strong>d</strong><br />
Part Name default <strong>to</strong> the specified project parameters. Refer <strong>to</strong> the IPexpress<br />
<strong>to</strong>ol online help for further information.<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
The resources required for selected configurations of the core are shown in<br />
Figure 4, below.<br />
Figure 4: Resources Required for IP Core<br />
Once the <strong>Ethernet</strong> MAC has been successfully configured <strong><strong>an</strong>d</strong> integrated in<br />
<strong>to</strong> the users design it is time <strong>to</strong> move on <strong>to</strong> the Board Design portion of the<br />
project. The key Board Design considerations are given in the next section of<br />
this application note.<br />
Board Design<br />
During the board design portion of the <strong>Ethernet</strong> subsystem design process<br />
there are several key design considerations that need <strong>to</strong> be addressed.<br />
These considerations c<strong>an</strong> be grouped as follows: Pin Assignment<br />
considerations, Power Supply/Decoupling Considerations <strong><strong>an</strong>d</strong> Board Layout/<br />
Component Placement Considerations.<br />
<strong>FPGA</strong> Pin Assignment Considerations<br />
The during the configuration portion of the IP core design the <strong>Lattice</strong><br />
software c<strong>an</strong> use pin assignments supplied by the user, making it easy <strong>to</strong><br />
simplify the board layout process. If board layout isn’t a concern the pin<br />
assignment c<strong>an</strong> be left up <strong>to</strong> the <strong>Lattice</strong> software <strong><strong>an</strong>d</strong> the assignment will<br />
be made based on the design requirements of the logic <strong><strong>an</strong>d</strong> interconnect<br />
inside the <strong>FPGA</strong>. It is a fairly simple process <strong>to</strong> make pin assignments for<br />
the import<strong>an</strong>t MII signals between the <strong>FPGA</strong> <strong><strong>an</strong>d</strong> the <strong>Micrel</strong> <strong>PHY</strong>. Simply<br />
select pins of the side of the <strong>FPGA</strong> that is closest <strong>to</strong> the <strong>Micrel</strong> <strong>PHY</strong> device as<br />
determined by your board layout.<br />
Power Supply/Decoupling Capaci<strong>to</strong>r Considerations<br />
Power supply design <strong><strong>an</strong>d</strong> the selection of decoupling components c<strong>an</strong> be<br />
of critical import<strong>an</strong>ce <strong>to</strong> <strong>an</strong>y subsystem with a combination of <strong>an</strong>alog <strong><strong>an</strong>d</strong><br />
digital functions like <strong>Ethernet</strong>. The key considerations c<strong>an</strong> be grouped in<strong>to</strong><br />
these categories: Power Supply, PCB Decoupling Capaci<strong>to</strong>rs, PCB Bypass<br />
Capaci<strong>to</strong>rs <strong><strong>an</strong>d</strong> PCB Bulk Capaci<strong>to</strong>rs.<br />
Power Supply<br />
• Ensure adequate power supply ratings. Verify that all power supplies <strong><strong>an</strong>d</strong><br />
voltage regula<strong>to</strong>rs c<strong>an</strong> supply the amount of current required.<br />
• Power supply output ripple should be limited <strong>to</strong> less th<strong>an</strong> 50 mV.<br />
• Noise levels on all power pl<strong>an</strong>es <strong><strong>an</strong>d</strong> ground pl<strong>an</strong>es should be limited <strong>to</strong><br />
less th<strong>an</strong> 50 mV.<br />
• Ferrite beads should be rated for 4 – 6 times the amount of current they<br />
are expected <strong>to</strong> supply. Any de-rating over temperature should also be<br />
accounted for.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
PCB Decoupling Capaci<strong>to</strong>rs<br />
• Every high-speed semiconduc<strong>to</strong>r device on the PCB assembly requires<br />
decoupling capaci<strong>to</strong>rs. One decoupling cap for every power pin is<br />
necessary.<br />
• Decoupling capaci<strong>to</strong>r value is application dependent. Typical decoupling<br />
capaci<strong>to</strong>r values may r<strong>an</strong>ge from 0.1 μF <strong>to</strong> 0.001 μF.<br />
• The <strong>to</strong>tal decoupling capacit<strong>an</strong>ce should be greater th<strong>an</strong> the load<br />
capacit<strong>an</strong>ce presented <strong>to</strong> the digital output buffers.<br />
• Typically, Class II dielectric capaci<strong>to</strong>rs are chosen for decoupling<br />
purposes. The first choice would be <strong>an</strong> X7R dielectric ceramic<br />
capaci<strong>to</strong>r for its excellent stability <strong><strong>an</strong>d</strong> good package size vs. capacit<strong>an</strong>ce<br />
characteristics. Low induct<strong>an</strong>ce is of the utmost import<strong>an</strong>ce when<br />
considering decoupling capaci<strong>to</strong>r characteristics.<br />
• Each decoupling capaci<strong>to</strong>r should be located as close as possible <strong>to</strong> the<br />
power pin that it is decoupling.<br />
• All decoupling capaci<strong>to</strong>r leads should be as short as possible. The best<br />
solutions are pl<strong>an</strong>e connection vias inside the surface mount pads. When<br />
using vias outside the surface mount pads, pad-<strong>to</strong>-via connections should<br />
be less th<strong>an</strong> 5 – 10 mils in length.<br />
• Trace connections should be as wide as possible <strong>to</strong> lower induct<strong>an</strong>ce.<br />
PCB Bypass Capaci<strong>to</strong>rs<br />
• Bypass capaci<strong>to</strong>rs should be placed near all power entry points on the<br />
PCB. These caps will allow unw<strong>an</strong>ted high-frequency noise from entering<br />
the design; the noise will simply be shunted <strong>to</strong> ground.<br />
• Bypass capaci<strong>to</strong>rs should be utilized on all power supply connections <strong><strong>an</strong>d</strong><br />
all voltage regula<strong>to</strong>rs in the design.<br />
• Bypass capaci<strong>to</strong>r values are application dependent <strong><strong>an</strong>d</strong> will be dictated by<br />
the frequencies present in the power supplies.<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
• All bypass capaci<strong>to</strong>r leads should be as short as possible. The best<br />
solutions are pl<strong>an</strong>e connection vias inside the surface mount pads. When<br />
using vias outside the surface mount pads, pad-<strong>to</strong>-via connections should<br />
be less th<strong>an</strong> 5 – 10 mils in length. Trace connections should be as wide as<br />
possible <strong>to</strong> lower induct<strong>an</strong>ce.<br />
PCB Bilk Capaci<strong>to</strong>rs<br />
• Bulk capaci<strong>to</strong>rs must be properly utilized in order <strong>to</strong> minimize switching<br />
noise. Bulk capacit<strong>an</strong>ce helps maintain const<strong>an</strong>t DC voltage <strong><strong>an</strong>d</strong> current<br />
levels.<br />
• Bulk capaci<strong>to</strong>rs should be utilized on all power pl<strong>an</strong>es <strong><strong>an</strong>d</strong> all voltage<br />
regula<strong>to</strong>rs in the design.<br />
• All bulk capaci<strong>to</strong>r leads should be as short as possible. The best solutions<br />
are pl<strong>an</strong>e connection vias inside the surface mount pads. When using vias<br />
outside the surface mount pads, pad-<strong>to</strong>-via connections should be less<br />
th<strong>an</strong> 5 – 10 mils in length. Trace connections should be as wide as<br />
possible <strong>to</strong> lower induct<strong>an</strong>ce.<br />
• Whenever a ferrite bead is implemented, bulk capacit<strong>an</strong>ce must be used<br />
on each side of the ferrite bead.<br />
Board Layout <strong><strong>an</strong>d</strong> Component Placement Considerations<br />
Proper board layout <strong><strong>an</strong>d</strong> component placement considerations are import<strong>an</strong>t<br />
<strong>to</strong> <strong>an</strong>y high-speed mixed <strong>an</strong>alog/digital design. The requirements for the<br />
layout of the signals connecting the <strong>Lattice</strong> <strong>FPGA</strong> <strong><strong>an</strong>d</strong> the <strong>Micrel</strong> <strong>PHY</strong> are<br />
shown in Figure 5 below. These requirements are used <strong>to</strong> drive the layout<br />
of specific signals <strong><strong>an</strong>d</strong> must be checked against actual board signal routing<br />
results.<br />
Notes:<br />
1. Provide solid ground reference<br />
2. Match tr<strong>an</strong>smit data with respect <strong>to</strong> tr<strong>an</strong>smit clock <strong><strong>an</strong>d</strong> receive data with respect <strong>to</strong> receive clock with in 100 mils<br />
3. A single ground pl<strong>an</strong>e is recommended. Do not split ground pl<strong>an</strong>e in<strong>to</strong> separate pl<strong>an</strong>es for <strong>an</strong>alog, digital <strong><strong>an</strong>d</strong> power pins.<br />
4. Route high speed signals above a continuous unbroken ground pl<strong>an</strong>e.<br />
5. Route differential pair on the same PCB layer<br />
Figure 5: Layout Recommendations for <strong>Ethernet</strong> <strong>PHY</strong> <strong>to</strong> <strong>Lattice</strong> <strong>ECP3</strong> Connections
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
<strong>Micrel</strong> has published <strong>an</strong> excellent application note on General PCB Design<br />
<strong><strong>an</strong>d</strong> Layout Guidelines, listed in the reference section of this document.<br />
These guidelines c<strong>an</strong> be used <strong>to</strong> drive the PCB layout strategy.<br />
PCB Layer Strategy<br />
The following PCB layer guidelines when used as part of a comprehensive<br />
PCB layout strategy will help insure that high-speed signal integrity is<br />
preserved. These are not the only guidelines that should be used, since<br />
other considerations (cost, time <strong>to</strong> market, fabrication capabilities, etc) could<br />
dominate in <strong>an</strong>y specific application. These are good examples however<br />
of general guidelines which could be a starting point for a comprehensive<br />
strategy.<br />
General Rules<br />
• Place components so as <strong>to</strong> avoid long loop traces.<br />
• Choose a metal box <strong>to</strong> shield the printed circuit board.<br />
• Use a ferrite core on the DC power cord <strong>to</strong> reduce EMI.<br />
• Follow the guidelines <strong>to</strong> layout differential pairs, the ground pl<strong>an</strong>e, <strong><strong>an</strong>d</strong><br />
high-speed signals.<br />
• Provide controlled imped<strong>an</strong>ce on all clock lines <strong><strong>an</strong>d</strong> high-speed digital<br />
signals traces with right termination schemes <strong>to</strong> prevent reflection <strong><strong>an</strong>d</strong><br />
ringing.<br />
• Ensure that the power supply is rated for the application <strong><strong>an</strong>d</strong> optimized<br />
with decoupling capaci<strong>to</strong>rs.<br />
• Keep power <strong><strong>an</strong>d</strong> ground noise under 50mV peak<strong>to</strong>-peak.<br />
• Ensure that the switching DC-DC converter is filtered <strong><strong>an</strong>d</strong> properly<br />
shielded as the DC-DC power converter c<strong>an</strong> produce a great deal of EMI<br />
noise.<br />
• Avoid via <strong><strong>an</strong>d</strong> pad in the path on <strong>an</strong>y critical signal as via <strong><strong>an</strong>d</strong> pad will<br />
induce unw<strong>an</strong>ted capacit<strong>an</strong>ce <strong><strong>an</strong>d</strong> induct<strong>an</strong>ce which c<strong>an</strong> cause reflection<br />
<strong><strong>an</strong>d</strong> dis<strong>to</strong>rtion.<br />
Power Ground Rules<br />
• Do not split the ground pl<strong>an</strong>e in<strong>to</strong> separate pl<strong>an</strong>es for <strong>an</strong>alog, digital,<br />
power pins. A single <strong><strong>an</strong>d</strong> contiguous ground pl<strong>an</strong>e is recommended.<br />
• Route high-speed signals above a solid <strong><strong>an</strong>d</strong> unbroken ground pl<strong>an</strong>e.<br />
• Fill copper in the unused area of signal pl<strong>an</strong>es <strong><strong>an</strong>d</strong> connect these coppers<br />
<strong>to</strong> the ground pl<strong>an</strong>e through vias.<br />
• Stagger the placement of vias <strong>to</strong> avoid creating long gap in the pl<strong>an</strong>e due<br />
<strong>to</strong> via voids.<br />
Figure 6: MDI Signal Layout Requirements<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)<br />
Analog VCC Pl<strong>an</strong>e<br />
• Place <strong><strong>an</strong>d</strong> route <strong>an</strong>alog components within the Analog VCC pl<strong>an</strong>e.<br />
Digital VCC pl<strong>an</strong>e<br />
• Place <strong><strong>an</strong>d</strong> route digital components within the Digital VCC pl<strong>an</strong>e.<br />
Signal Ground<br />
• The signal ground region should be one continuous <strong><strong>an</strong>d</strong> unbroken pl<strong>an</strong>e.<br />
• Both <strong>an</strong>alog (AGND) <strong><strong>an</strong>d</strong> digital (DGND) grounds should be directly<br />
connected <strong>to</strong> the signal ground pl<strong>an</strong>e.<br />
Chassis Ground<br />
The chassis ground <strong><strong>an</strong>d</strong> magnetics serve two purposes: they help <strong>to</strong> reduce<br />
EMI noise emissions from the signal ground pl<strong>an</strong>e <strong>to</strong> the PCB’s external<br />
environment <strong><strong>an</strong>d</strong> also act as a shield <strong>to</strong> protect the PCB components from<br />
ESD.<br />
• Place the chassis ground on all PCB layers <strong><strong>an</strong>d</strong> use connection mounting<br />
holes <strong>to</strong> join the chassis ground on different PCB layers.<br />
• If the chassis ground on the PCB is directly connected <strong>to</strong> the metal shield<br />
of equipment through the connection mounting holes, use a trench/moat<br />
<strong>to</strong> isolate the chassis ground pl<strong>an</strong>e from the signal ground pl<strong>an</strong>e.<br />
• The chassis ground region should extend from the front edge of the PCB<br />
board (RJ45 connec<strong>to</strong>rs) <strong>to</strong> the magnetics <strong><strong>an</strong>d</strong> around the edge of the<br />
board.<br />
Magnetic Noise Zone<br />
• Void both power <strong><strong>an</strong>d</strong> ground pl<strong>an</strong>es on all PCB layers directly under the<br />
magnetics.<br />
• Chassis ground should extend from the magnetics <strong>to</strong> the RJ45 connec<strong>to</strong>r.<br />
• Do not route <strong>an</strong>y digital signals between the <strong>PHY</strong> <strong><strong>an</strong>d</strong> RJ45 connec<strong>to</strong>r.<br />
Differential Signal Layout<br />
• Differential pair (TX+/- or RX+/-) should be routed away from all other<br />
signals <strong><strong>an</strong>d</strong> close <strong>to</strong>gether <strong>to</strong> use 5-mil trace width <strong><strong>an</strong>d</strong> 5-mil trace space<br />
in same length as possible with 100 ohms controlled trace.<br />
• Keep both traces of each differential pair as identical <strong>to</strong> each other as<br />
possible.<br />
• Route each differential pair on the same PCB layer.<br />
• Route both TX+/- <strong><strong>an</strong>d</strong> RX+/- pairs as far as away from each other at least<br />
four times of 5-mil trace space as shown in Figure 6.
<strong>Using</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> <strong><strong>an</strong>d</strong> a <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong> <strong>to</strong> <strong>Create</strong> <strong>an</strong> <strong>Ethernet</strong> Subsystem: A Step-By-Step Guide<br />
Additional PCB <strong><strong>an</strong>d</strong> layout guidelines are given in the <strong>Micrel</strong> application note. Refer <strong>to</strong> that note for additional suggestions that include PCB stacking, clock layout<br />
<strong><strong>an</strong>d</strong> ESD protection.<br />
<strong>Micrel</strong> has published a detailed Design Kit for the KSZ8051MLL that includes a board design with schematic <strong><strong>an</strong>d</strong> IBIS models. The location for this kit is given in<br />
the Reference section of this application note.<br />
Conclusion<br />
This application note has provided a step-by-step guide <strong>to</strong> designing <strong>an</strong> <strong>Ethernet</strong> subsystem using <strong>Lattice</strong> <strong>ECP3</strong> <strong>FPGA</strong>s, <strong><strong>an</strong>d</strong> a <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong>. The reader<br />
should be able <strong>to</strong> more easily implement these types of interfaces <strong><strong>an</strong>d</strong> better underst<strong><strong>an</strong>d</strong> the major design considerations <strong><strong>an</strong>d</strong> concerns present in these types of<br />
designs. It is hoped that the reader c<strong>an</strong> also extending the concepts presented in this app note <strong>to</strong> other <strong>Lattice</strong> <strong>FPGA</strong>s <strong><strong>an</strong>d</strong> <strong>Micrel</strong> <strong>PHY</strong> devices <strong><strong>an</strong>d</strong> simplify those<br />
designs as well.<br />
For the reader who w<strong>an</strong>ts additional levels of detail on the <strong>Lattice</strong>, <strong><strong>an</strong>d</strong> <strong>Micrel</strong> products used in this app note a list of valuable documents is given in the Reference<br />
section at the end of this document.<br />
References<br />
1) <strong>Lattice</strong> <strong>ECP3</strong> Data sheet<br />
http://www.latticesemi.com/products/fpga/ecp3/index.cfm<br />
2) <strong>Lattice</strong> Tri-Speed <strong>Ethernet</strong> MAC Data Sheet<br />
http://www.latticesemi.com/products/intellectualproperty/ipcores/trispeedethernetmediaacce/index.cfm<br />
3) <strong>Micrel</strong> <strong>Ethernet</strong> <strong>PHY</strong> Data Sheet (April 2007, Rev 1.1)<br />
http://www.micrel.com/page.do?page=product-info/fastether_tr<strong>an</strong>s.jsp<br />
4) <strong>Micrel</strong> General PCB Design <strong><strong>an</strong>d</strong> Layout Guidelines (AN-111, Feb 2007)<br />
http://www.micrel.com/_PDF/<strong>Ethernet</strong>/app-notes/<strong>an</strong>-111.pdf<br />
5) <strong>Micrel</strong> Design Kit for KSZ8051MLL<br />
http://www.micrel.com/page.do?page=product-info/fastether_tr<strong>an</strong>s.jsp<br />
6) Midcom RJ 45 Selec<strong>to</strong>r guide<br />
http://www.midcom-inc.com/Products/L<strong>an</strong>/R_1X1_100_MIC24_TH.asp<br />
Notice Of Disclaimer<br />
Nu Horizons is disclosing this Application Note <strong>to</strong> you “AS-IS” with no warr<strong>an</strong>ty of <strong>an</strong>y kind. This Application Note is one possible implementation of this feature,<br />
application, or st<strong><strong>an</strong>d</strong>ard, <strong><strong>an</strong>d</strong> is subject <strong>to</strong> ch<strong>an</strong>ge without further notice from Nu Horizons. You are responsible for obtaining <strong>an</strong>y rights you may require in<br />
connection with your use or implementation of this Application Note. NU HORIZONS MAKES NO REPRESENTATIONS OR WARRANTIES, WHETHER EXPRESS<br />
OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS<br />
FOR A PARTICULAR PURPOSE. IN NO EVENT WILL NU HORIZONS BE LIABLE FOR ANY LOSS OF DATA, LOST PROFITS, OR FOR ANY SPECIAL, INCIDENTAL,<br />
CONSEQUENTIAL, OR INDIRECT DAMAGES ARISING FROM YOUR USE OF THIS APPLICATION NOTE.<br />
AN094 Oc<strong>to</strong>ber 7, 2010 (Version 1.0)