Ethernet Phy Pcb Layout

Posted on
Ethernet Phy Pcb Layout Average ratng: 4,4/5 5358 reviews

Has anyone managed to get Ethernet working on custom PCB ?

I have just populated a DP83848CVV (Farnell # 128-6816)with a 50MHz Osc.

We are designing in a new product that should be using an Ethernet interface. We are trying to choose a PHY device. A simple one with RMII interface. We are worried about the design of the PCB. We had been told that we should have DISTANCES between the PHY and the magnetics of AT LEAST 1 inch. LEARN PCB DESIGN by practicing on iMX6 Rex design files. You will learn everything important about routing PCB Layout including layout for high speed interfaces such DDR3. I would like someone to help me choose the best strategy to route this gigabit PHY ethernet. The problem is that the differential pairs MDI0 (MDI0p & MDI0N), MDI1, MDI2.

forced MAC address, using the program i published yesterday,which DOES allow me to change MAC Address.

but nothing happens at all :(

I have put LED = 1, as first line of code,but it stays off.

Please help.

Cheers

Ceri.

Has anyone managed to get Ethernet working on custom PCB ? I have just populated a DP83848CVV (Farnell # 128-6816) with a 50MHz Osc. forced MAC address, using the program i published yesterday, which DOES allow me to change MAC Address. but nothing happens at all :( I have put LED = 1, as first line of code, but it stays off. Please help. Cheers **Ceri.
Sep01

Tags

Related Posts

Share This

Recent Posts

A what? If you’ve never crossed paths with ethernet technologies before then you may not know what an ethernet PHY is. Well, it’s the physical transceiver that converts a well-known>Decoupling of the power lines follows the advice in the application note and the datasheet, and we add 47µF of bulk capacitance to the board. Ferrite beads are used to suppress interference.
33Ω resistors are used on the MII signal lines to limit reflections. This design feature is also present in the Micrel reference design. The termination resistors that are commonly found between the differential TX/RX pairs and the PHY are not required in this design because they are integrated into the PHY itself.

The RJ45 connector

Ethernet design guidelines state that there must be a 1:1 isolation transformer between the cable and the PHY. These are known as the magnetics.


The TE Mag45 connector

Ethernet transformers are surprisingly expensive in small quantities so in my design I’ve chosen the TE 6605424-1 connector that integrates the magnetics and an ESD protection circuit into the connector.


The TE Mag45 schematic

RJ45 connectors that integrate the magnetics are commonly known as magjacks and are better value than buying the transformer and connector separately. Even so, this is the most expensive part in the design.

The clock

10/100 ethernet systems require a 25Mhz clock that runs at full speed for 100Mb/s operation and is internally divided down to 2.5Mhz when the link is set to 10Mb/s.


The 25Mhz crystal

The design allows for the 25Mhz clock to be sourced from an onboard crystal or from an external clock. In the former case R8 and R9 are solder bridges (or 0Ω resistors). In the latter case the clock should be applied to the XI pin and R8 and R9 are not connected.

I have chosen an Abracon ABLS-25.000MHZ-B2F-T crystal with an 18pF load capacitance requirement. The formula for choosing the values of the two load capacitors is well documented on the internet. It is:

Where CP is the parasitic capacitance of the board and CI is the input capacitance of the PHY. For my Abracon crystal with its CL of 18pF this works out at C1 = C2 = 30pF, assuming the commonly quoted CP + CI = 6pF.

I’m a little concerned at the additional capacitance introduced by the presence of the XO and XI header pins. If the capacitance is too far from the ideal level then the crystal frequency will be off target or it may not even start oscillating.

I’ll be using my 1Ghz Ant18e logic analyser to check that the crystal’s output frequency is correct. I can measure the frequency at one of the PHY clock pins. Any attempt to measure it at the XI and XO pins will fail due to the the capacitance of the probes being added to the load capacitance seen by the crystal.

Here’s the full list of parts that I selected for this project. All of them are available from Farnell Electronics and I have included direct links to each part’s page at Farnell.

IdentifiersDescriptionMftr. & Part No.
C13CAPACITOR, CASE D, 47µF, 16VPANASONIC – EEEFC1C470P
C2,C3,C6,C8,C9,C11,C12MLCC, 0603, Y5V, 50V, 100NFMULTICOMP – MCCA000256
C4,C5CAPACITOR, NP0, 0603, 50V, 30PFKEMET – C0603C300J5GACTU
C10MLCC, 0603, X5R, 6.3V, 2.2µFMULTICOMP – MCCA000516
FB1,FB2FERRITE BEAD, 0603 CASE, 220ΩMURATA BLM18PG221SN1D
P1,P2,P3HEADER, VERTICAL, 1ROW, 36WAYTE CONNECTIVITY / AMP – 8-146274-6
R3RESISTOR, ANTI SULPHUR, 0603, 10KWELWYN – ASC0603-10KFT5
R4RESISTOR, 0603, 6K49, 1%VISHAY DRALORIC – CRCW06036K49FKEA
R5RESISTOR, 0603, 4K7 5%, 0.1WPANASONIC – ERJ3GEYJ472V
R6RESISTOR, 0603, 1K 5%, 0.1WPANASONIC – ERJ3GEYJ102V
U1TXRX, PHY, 10/100, MII, 3.3V, 48LQFPMICREL SEMICONDUCTOR – KSZ8051MLL
R8,R9RESISTOR, 0Ω, 0R 0.1WPANASONIC – ERJ3GEY0R00V
RJ45JACK, MAG45, THRU HOLETE CONNECTIVITY – 6605424-1
Y1CRYSTAL, 25M, 18PF CL, HC49/4HSMXABRACON – ABLS-25.000MHZ-B2F-T
D1LED, YELLOW, 0603, SMDKINGBRIGHT – KPT-1608YC
D2LED, GREEN, 0603, SMDKINGBRIGHT – KPT-1608SGC
C1,C7CAPACITOR, X5R, 0805, 6.3V, 22µFAVX – 08056D226MAT2A
R1,R2,R7RESISTOR, 0603, 220R 5%, 0.1WPANASONIC – ERJ3GEYJ221V
D5LED, RED, 0603, SMDKINGBRIGHT – KPT-1608SURCK
R10..R19RESISTOR, 0603, 33R 5%, 0.1WPANASONIC – ERJ3GEYJ330V

The CAD for the board didn’t take too long. A few component footprints had to be created from scratch and I always route by hand these days.


The board CAD layout with layers merged

I only wish I’d had space on the top layer where the header pins are to label each pin with its function. Doing so would have exceeded the 50mm square limit that I was working to.

After designing the CAD I exported the Gerber CAM files and uploaded them to ITead Studio for manufacturing. A couple of weeks later they arrived.


The front of the board, looks great in red!

The differential TX/RX pairs are clearly visible snaking from the PHY to the RJ45 connector. The +/- lines are kept close to each other and have their lengths equalised as much as possible. Other signals, including the top ground pour are kept well away from these traces to help minimise interference.

I don’t do ground pours as a matter of course, only if the design calls for it and in this case the Micrel notes recommend it. I have seen reports on the internet of issues with prototype board manufacturing and ground pours that come into close proximity with other signals so I set a conservative 15 mil pour-to-trace clearance and removed ‘islands’ (areas of the pour that are not connected to a signal).


The back of the board

The back of the board contains the chassis and signal ground planes. Chassis ground from the RJ45 socket is isolated from the large central signal ground plane by an isolation moat. The break in the moat over on the right is to prevent a loop antenna being created.


The fully built PCB

The build process was fairly straightforward. I followed my usual procedure of reflowing on a hot-plate for the IC and any parts that have concealed pins. That meant the 47µF capacitor and the crystal in this case. Both of those do have enough of their pins protruding to hand-solder them but the majority of the pins are underneath so reflow is preferred. Also, their bases are plastic and would easily melt if they came into contact with an iron or an over-enthusiastic hot-air gun.

After reflow the remaining discrete components were simply hot-air’d into place with a pair of fine tweezers. The majority are 0603 size which is the smallest size I can work with both quickly and accurately. I can (and do) work accurately with 0402, but not quickly! The last steps are to use an iron to solder the headers and finally the RJ45.

I decided that the first stage of testing would be to simply verify that the thing is alive. By alive, that means that the clock is active and the PHY is responding to commands. So, I powered it up and wrote a small STM32 program that exercised the built-in NAND tree self-test mode.

This test involves first setting all pins high then pulling each one low in sequence and checking another pin to ensure it toggles from low to high or high to low. The result of the test was…

Fail!

Nothing happened. The PHY appeared to be completely ignoring me. After much head-scratching I decided that the clock cannot have started so I got my multimeter out, set it to continuity testing mode and meticulously tested the pads on a blank board for continuity where it should be and none where it should not be.

Found it! On close inspection there is an unwanted connection between R9 and the ground pour. Furthermore as bad luck would have it the connection is very hard to see because it’s under the silkscreen label. It’s visible under the microscope though.


Bad Gerber!

At first I thought it was a manufacturing defect until, that is I checked everything in the chain and found that the Gerbers had been badly generated by the Camtastic Gerber generator. This is rather annoying since I followed the online guide for producing the Gerbers and it had all seemed fine.

I spent some time investigating the issue and it turned out to be an option in the Camtastic ‘Export Gerber’ dialog that was selected by default and should be deselected to avoid the bug:


Deselect this checkbox

Deselecting the highlighted option results in Gerbers that appear to be correct, at least as far as I can tell by inspecting them in the Viewplot preview program.

Anyway, the fix for the boards that have already been manufactured involves the surgical application of a sharp knife to break the unwanted trace and I’m back in testing mode.

That did the trick. This time the NAND test passed with flying colours and I can move on to measure the clocks.

The PHY outputs a clock on TXC and RXC when in MII mode and the line is disconnected. At 100Mb/s (the default) this clock will be the full 25Mhz. I set my logic analyser to its maximum asynchronous sampling rate of 1GHz and measured both pins. As you can see from the image above they are both spot on 25Mhz. Perfect.

What is pcb layout

Software driver

ST publish sample code that is designed to operate with their ST802RT1 PHY. It demonstrates a point-to-point web-server using the lwIP TCP stack.

The project is laid out in the same structural form as every other ST sample that I’ve seen. As much as I dislike flat, procedural ‘C’ code, there’s a lot to be said for the predictable format that ST uses. Once you’ve seen one then you’ll know exactly where to look in all the others.

The key changes that I needed to make to the sample were to change some preprocessor definitions for the status register and speed and duplex masks. Around about line 354 of stm32_eth.h I added:

And slightly further on I added:

With these in place all I needed to do was comment out the stuff related to flashing LEDs via the HTTP server because I’m only interested in testing the link and the data transfer. The sample code compiled OK and I uploaded it to the MCU.

It works! The link with the netbook is auto-negotiated at 100Mb/s full duplex. The embedded lwIP protocol stack, hardcoded to IPv4 address 192.168.0.8, is configured to respond to ICMP ping requests which you can see in the command prompt window. More impressively you can see Google Chrome successfully downloading a web page from the embedded http server.

Final testing

I decided to do a final round of testing to ensure that the design is robust. The aim was to verify all the possible link modes and ensure that there were no errors received on the line – too many framing errors could indicate a signal integrity problem due to interference.

I hooked up my logic analyser to the RXDV, RXER, RXC and RXD[0..3] lines and took some samples triggered on the rising edge of RXDV (data valid) line. The results are shown in the image above. I also left it running for about 10 minutes with a trigger on the RXER line (receive error) while flooding the local network with broadcast UDP packets. It was never triggered, indicating that the signal integrity was perfect.

I tested the following configurations and all performed as expected:

  • Auto-negotiation of speed and duplex
  • 100Mb/s full and half-duplex
  • 10Mb/s full and half-duplex
  • Straight-through and crossover cables (auto MDI/MDI-X).

It’s here! I’m happy to say that the KSZ8051MLL is one of the supported PHYs in the all-new TCP/IP stack included with stm32plus 3.0.0. Click here to read all about it.

Want to have a go at assembling one of these boards yourself but don’t have a home etching kit? No problem, just download the Gerbers from my downloads page and use a service such as that offered by ITead Studio, Seeed Studio or Elecrow.

What Is Pcb Layout

I have produced a new version of this development board that uses the popular Hanrun HR911105A connector and has a few other incremental improvements. See this article for a complete write-up.