Connecting an Ethernet PHY to Arduino Due

I too have the Taijuino on order (2 of them). I asked them to include the smaller pins as well.

I have the Taijuino board with it's extra header here. What difference is there in using this "PHY module" over using one of the already available modules that don't rely on the built it interface? Speed? Cost? ??

ODwyerPW / cowasaki

I am pleased to know you are interested on this project.
In reference to the PHY module, I made a quick review on the phy driver component and class' functions and I believe that 'any' Ethernet PHY module should work with the EMAC. Indeed, I am considering to use a couple of other PHYs different from DM9161. Remember, I chose DM9161 trying to build this interface as close as possible to the original from Atmel.

To support the Ethernet PHY DP83848 (in addition to the AS-DM9161), I ordered one and just got it today. I also built a breadboard adapter for better access of the pins.

My wedge is having false contacts, so I've decided to start tests using the Taijiuino which should arrive this week. Also waiting for the AS-DM9161.

Pin interconnection between Taijiuino and Ethernet PHY DP83848C

Since last weekend, I have a compiling (OK) Ethernet MAC API for Arduino Due. It contains the following files:

  • emac sample sketch
  • emac.h
  • emac.cpp
  • ethernet_phy.h
  • ethernet_phy.c
  • mii.h
  • mini_ip.h
  • conf_eth.h

All these files come from Atmel and are the only necessary to run the sample. I did rid off the rest (about 40 files) from the original ASF library.

I have planned to start tests tonight with a Taijiuino and a DP83848 PHY module. (I still waiting for the Russian AS_DM9161. The last snowstorm have caused mail delays). I hope to show tomorrow results of the tests and some pictures.

I am conscious that some people are eager to get the library but it doesn't make much sense to publish it without previous basic tests. Thus, thank you for your patience!

I connected Taijiuino with EPHY DP83848 but no communication. I will be revising the phy files, pin configuration and wires. I hope to bring good news soon. Here a picture of my mess!.

This is one thread I am really interested in. Ethernet on the DUE without sacrificing so many i/o pins or fitting a shield.

Hi Palliser

I'm also interested in this, I'll likely go and make my own board (not a shield )to add onto a TAIJIUINO so I can pick up the additional pads, I'll design this board with 802.3af POE hence why I'll design my board around components that have been proved to work 1st :wink:
I wish you luck... I did wonder if the breadboard wiring may be causing an issue with its failure; have you tried to shorten the wiring at all ??

BR
Graham

Hello Graham,

I am happy you are interested in this project. I still working on the modified Ethernet MAC library. As you mentioned, I had to get rid off the breadboard to avoid wiring issues. Here a picture of what I have so far with less connections between the external Ethernet PHY DP83848 and a Taijiuino, although I am planning to use a DM9161 Phy when coming in from Russia next week. It could be also great to see your POE one of these days. One of my future goals is the implementation of a Webserver example, but for that, I have to wait a little longer. Regards!

Hello Palliser

My; that looks a lot neater, and hopefully stop any gremlins with wire lengths.
It will be interesting when you receive the DM9161, is this mounted on a carrier with the jack/magnetic's similar to the DP83848 board ?

The POE is very easy to achieve with suitable Jack socket, as similar to the Arduino Ethernet, and a ready built POE module can then be soldered in
these can range in voltage from 3.3V upwards so can be selected to give the voltage that's required and additional Voltage regulators used for lower voltages if needed.
some such as the silverline range can have there outputs modified, the usual 12V from the 9012-S POE module is reprogrammed with a shorting link to only supply 9V so not to overheat the fixed 5V regulator on most of the Arduino boards.

I'll keep and eye open for developments and wish you success

BR
Graham

Hello Graham,

Yes. The DM9161 board is similar to the DP83848. I chose it as my first option, given that the hardware (pull-up, pull-down PHY address resistors, filter/noise capacitors, Crystal, timing, etc.) is more than proven by Atmel for the most of their development kits. Thank you for the good wishes.

here a picture of AS-DM9161

Regards!

After a long wait, I just received yesterday my AS-DM9161 board. I really hope to have better luck with it. I have been trying to modify the EMAC library to make the DP83848 work with the Taijiuino but only communication errors. I will keep you posted once I start getting communication between Taijiuino EMAC and Ethernet PHY DM9161. regards!
Here a picture of the Russian board!

Hey Palliser, how are you getting on with interfacing your phy to the Due? I don't mean to chase you but I am keen to see the library/ethernet files as I would like to add support for a different PHY.

Hello TonyT3P3,

Following is a summary of my progress with the EMAC/PHY interface.

Firstly, I got good Ethernet communication between my new Russian PHY board (AS-DM9161) with the SAM3X-EK board. I performed this with the purpouse of verify the functionality of this PHY board because is slightly different from the one embedded in the SAM3X-EK.

Here a log excerpt of the EMAC/external EPHY communication between SAM3X-EK board and AS-DM9161 Ethernet PHY board:

-- MAC 0:4:25:1c:a0:2
-- IP  192.168.0.2
Link detected.
-- IP  255.255.255.255
-- IP  20.254.181.156
======= IP   60 bytes, HEADER ==========
 IP Version        = v.4
 Header Length     = 5
 Type of service   = 0x0
 Total IP Length   = 0x22
 ID                = 0x4B8E
 Header Checksum   = 0x2E92  Protocol          =
UDP

 IP Src Address    = 192:168:0:3
 IP Dest Address   = 255:255:255:255
----------------------------------------
-- IP  255.255.255.255
-- IP  20.254.181.156
======= IP   60 bytes, HEADER ==========
 IP Version        = v.4
 Header Length     = 5
 Type of service   = 0x0
 Total IP Length   = 0x2C
 ID                = 0x4B91
 Header Checksum   = 0xAF94  Protocol          =
ICMP

 IP Src Address    = 192:168:0:3
 IP Dest Address   = 255:255:255:255
----------------------------------------
...

So far so good.

Then, I started tests between the Taijiuino board and the AS-DM9161,but hitherto, I have not managed to get communication between them. The EMAC sample sketch compiles OK in the Arduino IDE but I believe
I am overlooking something, specially in the Pio/pin configuration (in the variant files).

Here a log excerpt of the Taijiuino DUE EMAC/external EPHY:

-- MAC 0:4:25:1c:a0:2
-- IP  192.168.0.2
Link detected.

I can see leds activity (FD/100/LINK) in the DM9161 but I am getting the same log even with the Taijiuino disconnected from the PHY.

Thus and unlike my CAN project, I have decided to publish and keep updates of the EMAC library files here (see my very first post in this thread). This files are the ones I am using now. The purpose of this is to obtain help from you guys.

Because the sketch compiles OK, I think that the only way to help testing the code, is to do it with the Taijiuino board and a DM9161 based board. Anyway, any comment/revision of the code is very welcome.

Other exercise I am going to do this week, is to run the same test SAM3X-EK/DM9161 but with the DP83848 to confirm that it works also, thus, using this second PHY as another option.

For your information, I am also trying to get direct support from Atmel. Thank you.

Whoever ventures to help me with the Ethernet MAC library, here what I have done regarding the EMAC pin configuration:

-I added in the variant.cpp the EMAC pin definition (lines 291 to 301) and the initialization of the EMAC Pio configuration (lines 431 to 485).
-I added in the variant.h the defines of the EMAC pins (lines 187 to 202).

Here a picture of my test of the DM9161 board. My test with the DP83848 still pending. I also still trying to get help from Atmel technical support team.
But don't worry, I will solve it.

Regards!

Hi Palliser,

I'm currently designing a SAM3X8E Arduino "work-alike" system and was planning to use a W5200 but this thread has convinced me to at least break out all the EMAC signals so I can add the PHY at a later date.

Thanks for you work in this (and other) areas, I also have both CAN interfaces on my backplane so will presumably be looking to your work there as well.


Rob

Hello Graynomad,

I am delighted to know about your Due-oriented system! Please, remember to include also the pin 69 (NRST) which adds the capability of the SAM to reset external components. Keep us posted about your progress and count on me if you need any assistance.

Palliser

remember to include also the pin 69 (NRST)

Already done.

I'm trying to provide full access to all peripherals like HSMCI, SSC, SMC, EMAC etc. Unfortunately the chip MUXs many signals and provides no optional pins so there will always be trade-offs of the "If you use X you can't use Y" type.

Do you know what frequencies I can expect on the EMAC signals? The full 100MHz or only 50 because there are two data lines. I plan to run these signals across a backplane to an Ethernet card and am a bit worried about the speeds.


Rob

Unfortunately the chip MUXs many signals and provides no optional pins

Yep. Multiplexing scheme (to reduce I/O) is our eternal karma with micro-controllers.

Do you know what frequencies I can expect on the EMAC signals?

The frequency depends on the interface supported by the external PHY. Most PHYs support both.

-25 MHz for MII
-50 MHz for RMII.

I am using RMII (higher speed and saves me 4 pins).

-Palliser