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
You need to log in to post a comment
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