Ethernet RJ45

Table of Contents

  1. Hardware

Hardware

This is the standard RJ45 pinout for Ethernet MDI Jack. To make it easier, Sparkfun offers a RJ45 Breakout Board. the following is for a specific magjack but for all straight through jacks see next section.

Example Bel Stewart MagJack SI-60002-F (no LEDs) and SI-50196-F (has LEDs)

            |   |   |   |         
          --||--||--||--||-----   Socket mbed
        /  8 | 6 | 4 | 2 |    /|       1 TD+
       /    7   5   3   1    / |       2 3.3V
      /                     /  |       3 TD-
     /    Bel Stewart      /   |       4 RD+
    /      MagJack        /    |       5 3.3V
   /     SI-60002-F      /     |       6 RD-
  /___________________  /      |       7 N.C.                                                      
 |      --------       |       |       8 GND                                                      
 |    --        --     |       |                                                               
 | --- |          ---- |      /                                                                
 ||    /--/-/-/-/-/-/-||     /                                 ___                   ________   
 ||   /  8 7 6 5 4 3 2||    /              ________________  -/   \-        ____    |   ____ |  
 ||  /  / / / / / / / ||   /      ,= ,++, /,  ,  ,  ,  ,  ,\|,  ,  ,| ,  , /,  ,| , |,  ,  ,_|  
 || /  / / / / / / / /||  /      ============================================================  
 ||/  ' ' ' ' ' ' ' ' || /        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
 | ------------------- |/         |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
  ---------------------                                               ^  ^  ^  ^                
  Ethernet Socket Front           mbed Board                         TD+TD-RD+RD-               

Straight jacks (No Built-In Magnetics) MDI interface:

            |   |   |   |         
          --||--||--||--||-----   Socket mbed
        /  8 | 6 | 4 | 2 |    /|       1 TD+
       /    7   5   3   1    / |       2 TD-
      /                     /  |       3 RD+
     /                     /   |       4 
    /                     /    |       5
   /                     /     |       6 RD-
  /___________________  /      |       7                                                       
 |      --------       |       |       8                                                       
 |    --        --     |       |                                                               
 | --- |          ---- |      /                                                                
 ||    /--/-/-/-/-/-/-||     /                                 ___                   ________   
 ||   /  8 7 6 5 4 3 2||    /              ________________  -/   \-        ____    |   ____ |  
 ||  /  / / / / / / / ||   /      ,= ,++, /,  ,  ,  ,  ,  ,\|,  ,  ,| ,  , /,  ,| , |,  ,  ,_|  
 || /  / / / / / / / /||  /      ============================================================  
 ||/  ' ' ' ' ' ' ' ' || /        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
 | ------------------- |/         |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
  ---------------------                                               ^  ^  ^  ^                
  Ethernet Socket Front           mbed Board                         TD+TD-RD+RD-               

Please note that other brands and references might not match the above, as is the case with Han Run HY911103A

            |   |   |   |         
          --||--||--||--||-----   Socket mbed
        /  8 | 6 | 4 | 2 |    /|       1 TD+
       /    7   5   3   1    / |       2 TD-
      /                     /  |       3 3.3V
     /     Han Run         /   |       4 GND
    /      MagJack        /    |       5 GND
   /      HY911103A      /     |       6 3.3V
  /____________________ /      |       7 RD+                                
 |      --------       |       |       8 RD-
 |    --        --     |       |
 | --- |          ---- |      / 
 ||    /--/-/-/-/-/-/-||     /                                 ___                   ________   
 ||   /  8 7 6 5 4 3 2||    /              ________________  -/   \-        ____    |   ____ |  
 ||  /  / / / / / / / ||   /      ,= ,++, /,  ,  ,  ,  ,  ,\|,  ,  ,| ,  , /,  ,| , |,  ,  ,_|  
 || /  / / / / / / / /||  /      ============================================================  
 ||/  ' ' ' ' ' ' ' ' || /        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
 | ------------------- |/         |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
  ---------------------                                               ^  ^  ^  ^                
  Ethernet Socket Front           mbed Board                         TD+TD-RD+RD-               

Please note that other brands and references might not match the above, as is the case with Han Run HR911105A and ERNI 203198 (has LEDs)

            |   |   |   |         
          --||--||--||--||-----   Socket mbed
        /  8 | 6 | 4 | 2 |    /|       1 TD+
       /    7   5   3   1    / |       2 TD-
      /                     /  |       3 RD+
     /     Han Run         /   |       4 3.3V
    /      MagJack        /    |       5 3.3V
   /      HR911105A      /     |       6 RD-
  /____________________ /      |       7 N.C.                                
 |      --------       |       |       8 GND
 |    --        --     |       |
 | --- |          ---- |      / 
 ||    /--/-/-/-/-/-/-||     /                                 ___                   ________   
 ||   /  8 7 6 5 4 3 2||    /              ________________  -/   \-        ____    |   ____ |  
 ||  /  / / / / / / / ||   /      ,= ,++, /,  ,  ,  ,  ,  ,\|,  ,  ,| ,  , /,  ,| , |,  ,  ,_|  
 || /  / / / / / / / /||  /      ============================================================  
 ||/  ' ' ' ' ' ' ' ' || /        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
 | ------------------- |/         |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
  ---------------------                                               ^  ^  ^  ^                
  Ethernet Socket Front           mbed Board                         TD+TD-RD+RD-               

Please note that other brands and references might not match the above, as is the case with Sparkfun PRT-08534

            |   |   |   |         
          --||--||--||--||-----   Socket mbed
        /  8 | 6 | 4 | 2 |    /|       1 TD+
       /    7   5   3   1    / |       2 TD-
      /                     /  |       3 3.3V
     /     Sparkfun        /   |       4 N.C.
    /      MagJack        /    |       5 N.C.
   /      PRT-08534      /     |       6 3.3V
  /____________________ /      |       7 RD+                                
 |      --------       |       |       8 RD-
 |    --        --     |       |  NOTE: GND is done through the shield pins
 | --- |          ---- |      / 
 ||    /--/-/-/-/-/-/-||     /                                 ___                   ________   
 ||   /  8 7 6 5 4 3 2||    /              ________________  -/   \-        ____    |   ____ |  
 ||  /  / / / / / / / ||   /      ,= ,++, /,  ,  ,  ,  ,  ,\|,  ,  ,| ,  , /,  ,| , |,  ,  ,_|  
 || /  / / / / / / / /||  /      ============================================================  
 ||/  ' ' ' ' ' ' ' ' || /        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
 | ------------------- |/         |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |    
  ---------------------                                               ^  ^  ^  ^                
  Ethernet Socket Front           mbed Board                         TD+TD-RD+RD-               




45 comments:

07 Aug 2010

Wow, this is some *beautiful* ascii art!!

09 Aug 2010

HI, does the RJ-45 need to have integrated coils (like MagJack have) or can it be a simple direct connection to the network ? thanks !

09 Aug 2010

Yes you need magnetics - do not connect mbed direct to a LAN

09 Aug 2010

thanks for your answer !

10 Aug 2010

From what I remember being posted before, you actually can connect the cable directly to pins - as long as you're sure you won't get high voltages in it (e.g. if you're using PoE).

10 Aug 2010

Yes, to be clear: It will (probably, most of the time) work fine without magnetics, but won't be either standards-compliant or safe. For hobby/experimentation stuff it's probably fine to use no magnetics.

06 Oct 2010

When wiring in the magnetics, do you tie all 4 center-tap transformer pins together? Or isolate the Ethernet side from the Microcontroller side? Are any other discrete capacitors, etc needed on the Ethernet side? I'm using a 20F001NG, not much info on the datasheet here-> http://sklep.avt.pl/photo/_pdf/20F001NG.pdf?sess_id=be904928a621d2463191349b2681f6ad

07 Oct 2010

It will be easier to make the connections if you have a baseboard (see baseboard section in Cookbook) or a breakout board with an Ethernet connector.

The Mbed Workshop breakout board shows the other connections in a nice schematic

Different magjacks use different pin outs, so find the schematics for your magjack to double check.

22 Oct 2010

Here is the ethernet portion of the Mbed Workshop board schematic that shows the other magjack connections.

/media/uploads/4180_1/_scaled_mbedworkshopnet.png

From posts elsewhere in the Forums, it seems that it will work in most cases with only the basic four wire connections (i.e., TX+,TX-,RX+,RX-), but the signal amplitudes are a bit off without the additional RXC and TXC connections and it might not work if you have a very long (i.e., worst case) cable run. We have setup about 20 systems in our lab here with only the basic four wire connections on the Sparkfun magjack breakout board and did not see any problems. Once again, keep in mind that different magjacks from different companies have different pinouts even through they look the same.

The Sparkfun magjack breakout board is seen below. The schematic for the magjack connector you solder on it must be checked to figure out the pinout connections. The PCB only shows the Px numbers for the connector.

RJ45

The only thing that is a little strange on the Sparkfun magjack breakout board is that you have to run the wires under the board on one side on most protoboards because it is a bit too wide. The basic problem behind it is the width of the magjack connectors.

The one below from Cool components is a bit different, but with it you can't make the TXC, RXC and shield connections (on the side) easily on a protoboard unless it can be setup to hang over into a power bus.

MJ

21 Nov 2010

Found this board, looks useful for connecting rj45. http://www.winfordeng.com/products/brk8p8c.php

08 Dec 2010

I hope this helps clarify why some people may not be getting their signals detected on the HUB end of their cables.

If the MBED is to emulate a PC, workstation, of game type device (known as a MDI device) then the wiring should be such that pins 1 and 2 on the network side of the jack be TX+ and TX- respectively. Pins 3 and 6 on the network side of the jack should be RD+ and RD- respectively.

The jacks on the PC (network) side of a dumb HUB or SWITCH are MDIX interfaces where pin 1 and 2 is the RD+ and RD- respectively. Pins 3 and 6 are TX+ and TX- respectively.

The examples connections in the first picture on this page make the MBED look like it is a MDIX device like a HUB or SWITCH.

The reason the above examples work in most cases is that most modern HUBS and SWITCHES have AUTO MDIX capability where they can automatically detect and swap the TX and RX lines to get correct signals. Some can even deal with polarity errors such as having the RD+ and RD- swapped as in the first picture on this page.

However, if the MBED is connected with the above wiring to an OLD, not so smart, HUB then it will generally not work. It might work if the MBED is configured to do the AUTO MDIX function itself and I believe it's default is to do AUTO MDIX. But this auto MDIX feature usually requires AUTO CONFIGURE to be active for the SPEED and DUPLEX modes as well. If it is set to MANUAL 10BASET HALF DUPLEX mode, the AUTO MDIX mode may not work and the connection will be broken.

To guarantee compatibility with legacy HUBS a MBED baseboard or any product that expect to behave or be seen by a HUB or SWITCH as a PC, workstation, or game box, needs to look like a MDI device having pin 1 set to TX+, etc.

The pin outs for the MBED side of a MagJack device it is a matter of following the schematic of the specific MagJack design to see what pins on the network side coincide with the pins on the mbed side. For the case of the Bel Steward SI-60002-F pins 1 and 3 are TX+ and TX- respectively. Pins 4 and 6 should be RD+ and RD- respectively.

The center taps of the MagJack should each be tied to 3.3V and have a 0.1uf ceramic capacitor connected to ground as close as possible to the MagJack pins. On the SI-60002-F the center taps are pin 2 and 5. Pin 7 of the SI-60002-F is not connected and pin 8 should be tied to ground.

http://en.wikipedia.org/wiki/Ethernet_over_twisted_pair

http://en.wikipedia.org/wiki/Medium_dependent_interface

08 Dec 2010

I've corrected the pictures and added missing pin outs as well as a few more example MagJacks.

14 Dec 2010

hi, Is it possible to connect Mbed directly via cable to laptop without using RJ45 jack ?..I have one LAN cable and if i cut it and connect one RJ45 pin to computer and open wires to MBED..thank you.

14 Dec 2010

Vatsal Shah wrote:

hi, Is it possible to connect Mbed directly via cable to laptop without using RJ45 jack ?..I have one LAN cable and if i cut it and connect one RJ45 pin to computer and open wires to MBED..thank you.

Yep, not a problem. been doing that for months without a problem. (though, for the record, you do lose some emi/static protection when doing that. You have been warned) Look at your connector from the top with the tab down and cable away from you. What color are the two right-most wires? orange: connect green to TD+,green/white to TD- orange to RD-,orange/white to RD+

orange: connect orange to TD+,orange/white to TD- green to RD-,green/white to RD+

Note: this may not quite be correct/optimal, but it is working for me. edit: If the PC you are connecting to is old enough, you may not be able to connect, in which case, swap orange/green. I suspect though that this won't be a problem.

15 Dec 2010

Daniel De Jager wrote:

Vatsal Shah wrote:

hi, Is it possible to connect Mbed directly via cable to laptop without using RJ45 jack ?..I have one LAN cable and if i cut it and connect one RJ45 pin to computer and open wires to MBED..thank you.

Yep, not a problem. been doing that for months without a problem. (though, for the record, you do lose some emi/static protection when doing that. You have been warned) Look at your connector from the top with the tab down and cable away from you. What color are the two right-most wires? orange: connect green to TD+,green/white to TD- orange to RD-,orange/white to RD+

orange: connect orange to TD+,orange/white to TD- green to RD-,green/white to RD+

Note: this may not quite be correct/optimal, but it is working for me. edit: If the PC you are connecting to is old enough, you may not be able to connect, in which case, swap orange/green. I suspect though that this won't be a problem.

Vatsal,

Technically, with the orientation Daniel described the far right pin is pin1 and the color should be white/orange, next to the left is pin2 and should be orange, then white/green, blue, white/blue, green, white/brown, brown. By standards, the white/color stripes are the TIP signals and the solid colors are RING signals. (It is terminology left over from the phone plugs used on ancient telephone operator equipment.) The TIPs are + and the RINGs are -.

EIA-568B cables start with the Orange Pair, while EIA-568A cables start with the Green pair. The important thing isn't the colors, but what pin each color is connected to in the connector. We are describing the 568B cables.

In the configuration where you connect directly to another computer, the MBED is then a MDIX device (like a hub). The pin assignments are thus...

Pin1 - White/Orange = RD+

Pin2 - Orange = RD-

Pin3 - White/Green = TX+

Pin6 - GREEN TX-

If you later want to connect to a HUB or switch then the MBED should be wired as a MDI device. The color arrangement would then be.

Pin1 - White/Orange = TX+

Pin2 - Orange = TX-

Pin3 - White/Green = RD+

Pin4 - GREEN = RD-

It seems like a lot of people are swapping the polarity on the pin3 and pin6. And a lot of people are even swapping the pairs. I don't know how that got propagated, but it is technically incorrect. It works, though, because many modern hubs, routers, and PCs use controller chips that can automatically detect the mis-wire and correct it internally. (It is a requirement of GigaLAN routers and devices. 100 BaseT devices might do it. Old 10BaseT only devices most typically do not.)

So to be on the safe side if/when you might be connecting to legacy equipment, which can't detect or correct swapped pairs or swapped polarities, you need to wire it as I described.

15 Dec 2010

Thomas Olson wrote:

If you later want to connect to a HUB or switch then the MBED should be wired as a MDI device. The color arrangement would then be.

Pin1 - White/Orange = TX+

Pin2 - Orange = TX-

Pin3 - White/Green = RD+

Pin4 - GREEN = RD-

Sorry, not Pin4... Pin6

Pin1 - White/Orange = TX+

Pin2 - Orange = TX-

Pin3 - White/Green = RD+

Pin6 - GREEN = RD-

For some reason I can't edit my entry.

16 Dec 2010

Dear Danial and Thomas,

I tried the wiring and it is working perfectly..Thank you very much for quick support..

06 Jan 2011

Hi, I have some questions about the ethernet connection and the mbed, i recive internet from USB connector and i can share internet by the etherneth port in my laptop with other computer using dirct cable (works perfectly), could i connect the mbed with Magjack connector, direct cable and sharing internet with my lap? or is needed the crossover cable because according other comments is more safe when use Magjack but if i invert the TX and RX, i dont knwo if it´s safe. I hope for your help, thank you.

11 Feb 2011

I am kind of novice to the microcontroller world, therefor, please forgive if I ask a silly q:

On this page, you refer to MagJacks with and without magnetics (which I assume to be the coiled tranducers?).

Are these "optional" or does it mean when I use a Jack without them, I need to have tham as additional elements on the board or are they really optional elements? If so, what is the difference in usage with / without?

Thanks so much! Juergen

18 Feb 2011

Hello, I'm new to all this also...what does GND is done through the shield pins mean? what are the shield pins? I have the RJ45 from sparkFun and the breakout board with it. Also...what does N.C mean?

Thanks for any help...