Ethernet

Setup the ethernet with an mbed is basicly an easy thing. The PHY is onboard. What is needed is then just a plug and magnetics.

Q'n D

1. Cut a perfectly good working CAT5 cable in half.

2. Refer to the pinout/wiring spec for CAT5 cables, or some useful webpage like :

3. Strip back the relevent cores (Green = RD+, Green/White + RD-, Orange = TD+, Orange/White + TD-) and connect them to the mbed. Best way to do might be a solder less breadboard.

SUGGESTION: keep the length of CAT5 cable form your mbed to you hub/switch/router short, 1m or under.

WARNING: Do not plug into a Power Over Ethernet enable Hub/switch/router, as you now have no magnetics to protect you. Failure to observe this will destroy your mbed. Remember: I will tell you I told you so.

 

rj45 Plugs

            |   |   |   |         
          --||--||--||--||----- 
        /    |   |   |   |    /|
       /                     / |
      /                     /  |
     /                     /   |
    /                     /    |
   /                     /     |
  /___________________  /      |
 |      --------       |       |
 |    --        --     |       |
 | --- |          ---- |      /
 ||    /--/-/-/-/-/-/-||     /
 ||   /  / / / / / / /||    /
 ||  /  / / / / / / / ||   /
 || /  / / / / / / / /||  /
 ||/  ' ' ' ' ' ' ' ' || /
 | ------------------- |/
  --------------------- 

 

 

A more secure way is to use a plug with magnetics. There are several out there. Unfortunately they have all a different pinout. Here is a collection of some I know: (If you have more let me know)

 

MagJack SI-60002-F Datasheet:

                Bottom view
RD+ 	= 1     +----------+
RD0 	= 2     | 8 6 4 2  |
RD- 	= 3     |  7 5 3 1 |
TD- 	= 4     |+        +|
TD0     = 5     |          |
TD+     = 6     | Front    |
                | vvvvvvvv |
 

 

SparkFun PRT-08534 link:

                Bottom view
RD+ 	= 1     +----------+
RD- 	= 2     |  2 4 6 8 |
RD0 	= 3     | 1 3 5 7  |
TD0 	= 6     |+        +|
TD-     = 7     |          |
TD+     = 8     | Front    | 
                | vvvvvvvv |
 

 

tyco 1-6605834-1 link:

                Bottom view
TD-     = 1     +----------+
TD+     = 2     | 9  5 3 1 |
TD0     = 3     |10 6 4 2  |
RD0 	= 4     |+        +|
RD+ 	= 5     |:        :|
RD- 	= 6     | Front    | 
                | vvvvvvvv |
 

 

Connect the RD+/-, TD+/- pins to your mbed and ethernet should work.

To make the connection better over long distances it might be worth to connect the RD0/TD0 pins as well:

 

RD0 -+---- Vout
     | 
     +-||- GND
       ^-- 100 nF
     
TD0 -+---- Vout
     | 
     +-||- GND
       ^-- 100 nF
     

 

 

To test if the ethernet is really working, if wrote these programms:

ethspam A Prorgamm which sends out a lot of ARP packages. You can see sem with a tool like Wireshark

ethsnif A Ethernet sniffer which will show you all the received packets on the stdout. (USB serial)


7 comments

19 Nov 2009

Hi Rolf,

A useful article, but you are missing a key point.

You need to connect the MagJack transformer primary centre-taps to +3.3V. These connections are pins 2 and 5 on the Stewart part and pins 3 and 6 on the Sparkfun one. Be sure to decouple each pin with a 100nF capacitor to GND located close to the pin. If you don't do this, the signal amplitudes will be wrong and it is unlikely the interface will work over the full range of cable lengths. This is described in the DP83848 datasheet, Section 5.1, Figure 11.

Regards,

Paul Griffith

20 Nov 2009

Good point, I've investigated it and your right. I didn't looked that deep into the electrical site of the PHY datasheet.

After weiring it up it gave no significant changes for me. But thats probably my setup. I'm sure this will help to reduce lots of problems.

I will make a better wireing diagram soon.

 

Thanks a lot

Rolf

20 Nov 2009

SparkFun PRT-08534 Pin Configuration:

 

                Bottom view
RD+ 	= 1     +----------+
RD- 	= 2     |  2 4 6 8 |
TD- 	= 7     | 1 3 5 7  |
TD+ 	= 8     |+        +|
                |          |
                | Front    |
                | vvvvvvvv |
 

 

10 Aug 2010 . Edited: 10 Aug 2010

 

user avatar Vlad Cazan wrote:

 

 

SparkFun PRT-08534 Pin Configuration:

 

                Bottom view
RD+ 	= 1     +----------+
RD- 	= 2     |  2 4 6 8 |
TD- 	= 7     | 1 3 5 7  |
TD+ 	= 8     |+        +|
                |          |
                | Front    |
                | vvvvvvvv |
 

 

 

 

Hello Vlad,

 

I picked up this sparkfun jack with the breakout board, but my pins seem to be reversed (like the MagJack SI-60002-F shown above). This is the one i have SparkFun PRT-08534 (link).

I am having trouble figuring out what GS1 and GS2 are used for on the Sparkfun Magjack breakout board. The data-sheet does not seem to say anything about each pin. Also, what are RD0 and TD0 used for?

25 Nov 2010

RDA 125BAG1A Pin configuration (manufacturer UDE)

Bottom view

RD+ 	= 1     +----------+
RD- 	= 2     | 8 6 4 2  |
                |  7 5 3 1 |
TD+ 	= 7     |+        +|
TD-     = 8     |          |
                | Front    |
                | vvvvvvvv |

 

18 May 2011

Hi Rolf,

I observed that the pinout of MagJack SI-60002-F is wrong.

In this page: http://mbed.org/cookbook/Ethernet-RJ45

the pinout is:

1 TD+
2 3.3V
3 TD-
4 RD+
5 3.3V
6 RD-
7 NC
8 GND

15 Dec 2012 . Edited: 15 Dec 2012

We'r new to mbed,  we need to communicate between 2 mbeds using ethernet to send some raw data in a simple manner, can someone help us with this, we need some sample code to test that, We'r communicating 2 mbeds near to each other. any idea?

 

Thanks!

Please log in to post a comment.