Connecting an Ethernet PHY to Arduino Due

Hello,

I want to clarify that the emac class files (emac.c, emac.h) ARE NOT contained in the current Arduino IDE version 1.5.2.
For those interested to get these files, please refer to the following link:

For the emac.h ----> https://github.com/cmaglie/Arduino/tree/ide-1.5.x/hardware/arduino/sam/system/libsam/include
For the emac.c ----> https://github.com/cmaglie/Arduino/tree/ide-1.5.x/hardware/arduino/sam/system/libsam/source

Regards,
Wilfredo

I agree that we will end up having a number of different Phy drivers to incorporate within an overall "Due Ethernet" library. The SAM3X-EK example that I modified has ARM(CMSIS), ATMEL(ASF) and LwIP code. It might be better to look at a LwIP or another stack without all the rest and see if its possible to add Due support, we would then benefit from further developments of the LwIP stack, rather than a Arduino specific library that once working may not be further developed.

Thoughts?

I have been lurking, watching this thread from the start, now its time for me to try with due-ethernet! I have been working on a custom diy board which has onboard micrel 8051 phy and magjack. Finally got one built up and it passed the blink test. Now on to try and follow the leader with the lwip example.

Hello komby,

Wow, I am amazed with what you have pulled off. Nice work!

This is getting really good. So far, you are the fourth developer with a Due DIY board-oriented that includes the Ethernet phy interface (floating or embedded).

Here the list (with no order of preference but chronological for me):

1- as-kit.ru new AS-SAM3X board (also includes the CAN bus embedded interface)

2- elechouse.com new Taijiuino R2 version.

3- Graynomad's Black Diamond (also includes CAN bus and other communication interfaces).

4- komby (web site?)

I am happy that this initiative has already gained a great deal of software/hardware support.

Thank you,
Wilfredo

Palliser:
Hello komby,

Wow, I am amazed with what you have pulled off. Nice work!

This is getting really good. So far, you are the fourth developer with a Due DIY board-oriented that includes the Ethernet phy interface (floating or embedded).

Here the list (with no order of preference but chronological for me):

1- as-kit.ru new AS-SAM3X board (also includes the CAN bus embedded interface)

2- elechouse.com new Taijiuino R2 version.

3- Graynomad's Black Diamond (also includes CAN bus and other communication interfaces).

4- komby (web site?)

I am happy that this initiative has already gained a great deal of software/hardware support.

Thank you,
Wilfredo

Thanks Wilfredo. To be fair I'm still unsure if its pulled off yet!...I just soldered the first one together yesterday :)... That said I am working on making sure it does work. I do have a little bit of information about it on komby.com but I was planning on verifying the board is working before publishing the eagle files. If any of the people on the thread who are working on the Ethernet Library and are interested in one of the prototype boards PM me. I made a lot of sacrifices on the board to get the ethernet onboard as well as some nRF24L01 headers so it may be a bit specialized for common use...

Please allow me to tell everybody who might be interested in Due-Ethernet. You could find a hardware kit for developing this libaray here:
On ebay click here
On official web click here
We hope this kits could help those software guys who are less patient and sick of handing wires.

Took a look at it. This hardware kit can't be used simultaneously with your CTE LCD shields. Bummer. Split decision... lots of wires for the LCD or lots of wires for the Ethernet. Oh well. The DUE platform will get there eventually.

We know it is not perfect. While designing it, we didn't consider its compatibility with other modules in hardware. The best choice would be a Due shield which contains PHY chips. But we think we should do that later. As this library is not finished yet, a small and cheap PHY module would be better. That's how it comes. Sure later there will be a shield for Due to have all on it.

Yes, you are correct, I didn't mean it as a criticism. DUE is such a work in progress... I appreciate you providing this module which eliminates all of the wiring for folks trying to develop the Ethernet libraries.

Somewhere down the road, we will all figure out how to make the UI, Comms, and I/O portions all play nice together on DUE. Which will give us feature parity with UNO, but higher performance and greater capabilities.

I've looking forward to seeing what the folks down under will have when they release Black Diamond.

I've looking forward to seeing what the folks down under will have when they release Black Diamond.

Me to :slight_smile:

The project is alive and well, there has been a lot of changes in the last 2-3 weeks, often due to input from interested parties. We froze the design about 3 days ago then had another bright idea, oh well better to try and get it as right as possible.

When implementing various comms, EMAC, SD, and external memory interfaces there are not many pins left for GPIO so don't expect a huge IO pin count. That said what we do have should be quite robust, not just raw pins connected to the big bad world.

I'll post more details on the Black Diamond thread soon.


Rob

New thread started about the successor to the Black Diamond.

http://forum.arduino.cc/index.php?topic=170901.new#new


Rob

ODwyerPW:
Took a look at it. This hardware kit can't be used simultaneously with your CTE LCD shields. Bummer. Split decision... lots of wires for the LCD or lots of wires for the Ethernet. Oh well. The DUE platform will get there eventually.

Ehm.. What does this mean? Arduino Due cannot have SD+TFT+Touch+ethernet - or does this just mean that shields are incompatible if they are not being wired? I am interested in a project that has a tft with touch.. And Sd.. And would be connected with ethernet.. Currently I have a shield from aqualed source for 5.0" tft - and was thinking I could use a ribbon cable to take ethernet connection "outside" - but does this then work or not?

Small web server example using Taijiuino.

As some of the followers of this thread know, I have been working porting the EMAC library and example from AS6 ASF SAM3X-EK to the Arduino Due environment. Even though I tried to put the Due in action, it is very hard under its actual design. Thus, I migrated to Taijiunio and AS-Sam3x (third parties Due based boards). So far, we have a very raw workable library but also we have been very busy to finish it. We have some plan to continue next month (Paul, Thibaut and me).
In the meantime of our EMAC library development and taking advantage that the raw EMAC library is working decently, I have decided to explore, what is, our next frontier: to use the potential EMAC cababilities of Arduino Due (now available in the Taijiuino board) an convert it in a small web server. Thus, I made a raw porting of the AS6 ASF lwIP Atmel example. This example features a basic HTTP web server using lwIP TCP/IP stack and the EMAC driver of the Taijiuino in mode standalone (without OS).

Plugging directly the Ethernet cable into the Taijiuino EMAC kit to my laptop and configuring the network to local mode setting up a 'point-to-point' network, now I can launch my Google Chrome web browser and typing the IP address assigned automatically to the Taijiuno (DHCP mode) and see an index.html page that comes with the example (converted into a static C struct, with HEX codes, with the help of a small Perl script).

Here attached a couple of pictures of the Taijiuino in action and the serial output. I have planned (of course) to polish and finish this raw code of the web server (it is messy and big now) into the Arduino IDE environment and create some input/output functions like turn on/off digital outputs using buttons in the web page, or change analog signals using a painted potentiometer or show status of some parameters in the board (temperature, voltage, etc.) but...that will take some weeks. Regards!

Missed out on this thread while it was active but read through it all. Nice work all.

What is the status on the demo code? I do see that the emac.h and emac.c files are in as of 1.5.3 now.

Tnx,
Greg

Hello Greg,

Thank you for asking about the EMAC code. Here a brief dossier about its status:

EMAC demo sample code is running OK using Arduino IDE 1.5.2 and a third-party Due-based board, enabling it to respond to a ping command sent by a computer. See reply #67:
http://forum.arduino.cc/index.php?PHPSESSID=5i6p7elee9gv585u7626tb7mn7&topic=142908.60

So far, I have a ported EMAC library (from AS6 ASF) with the Media Independent Interface (mii), mini IP structure (mini_ip) and the phy driver (conf_eth) files. I also had to modify the emac files (.c, .h) that you mentioned, and the variant files (.c, .h) from the IDE152. Notice that IDEs 1.53 and 1.54 do not have the emac pin definition/configuration. The next step is to create the EMAC class and overload some functions under the Arduino style. Regards!

Palliser:
Hello Greg,

Thank you for asking about the EMAC code. Here a brief dossier about its status:

EMAC demo sample code is running OK using Arduino IDE 1.5.2 and a third-party Due-based board, enabling it to respond to a ping command sent by a computer. See reply #67:
Connecting an Ethernet PHY to Arduino Due - Arduino Due - Arduino Forum

So far, I have a ported EMAC library (from AS6 ASF) with the Media Independent Interface (mii), mini IP structure (mini_ip) and the phy driver (conf_eth) files. I also had to modify the emac files (.c, .h) that you mentioned, and the variant files (.c, .h) from the IDE152. Notice that IDEs 1.53 and 1.54 do not have the emac pin definition/configuration. The next step is to create the EMAC class and overload some functions under the Arduino style. Regards!

Impressiv as usually what you did, cool stuff

Hi Palliser and all the rest interested in utilising the EMAC built in to the SAM3X8E

Let me introduce the Duet:

Its a 3D Printer (or other stepper driven robot) controller board that uses the SAM3X8E, along with its onboard EMAC, HSMCI SD 2.0 interface and other peripherals. Alot more info is available on this blog post:

It uses the KSZ8051RNL PHY, I wrote about this initial work back in post #72: (Connecting an Ethernet PHY to Arduino Due - #73 by system - Arduino Due - Arduino Forum). The firmware is linked from the blog and runs a web server to control the 3D Printer. Thanks for all the work by Pallister and all the other contributors to this forum - it was useful to see the other implementations.

Nice-looking board.


Rob

Cheers! your pin out diagrams feature on my wall art!

:), thanks, I do like that diagram.


Rob