Connecting an Ethernet PHY to Arduino Due

Hello Wallaby and GreyNomad,

I just stopped 'Round Midnight in my cassette player. Sometimes the Monk helps to put some ideas in order! I am glad to know that you and Rob are taking seriously the challenge of building your own Due-oriented system. Godspeed.
Thank you very much also for your words regarding this initiative to exploit the full potential inside SAM3X8E. That is the minimum we can do in favor of Arduino in return for their amazing contribution.

Here my answers:

Post#1:
What is working: If you test the EMAC sample sketch with Arduino IDE 1.5.2 using the EMAC library, it compiles OK (No errors. No warnings).

What is not working: When you test it on real hardware (DM9161 phy/Taijiuino), it doesn't work. There is no way to get any communication between them. I have double-checked the wiring, pull-up/down resistors, and I even ran a simple code that blinked all the Ethernet pins in the SAM3X8E. Furthermore, I connected the DM9161 to the SAM3X-EK and I got communication between them. Thus, all the hardware is OK but the something in the software is wrong.

Post#10:
This EMAC library is the result of the same porting approach I did to the CAN library (which is workable and available here in the forum). Let me just recap that: I took the Atmel ASF EMAC library that actually permits, through a couple of samples, the perfect communication between the SAM3X8H and DM9161 embedded in the SAM3X-EK board. Thus, SAM3X8H and PHY DM9161 work OK. That’s why I decided to ‘port’ the library to the Arduino environment. To achieve this, I had to get rid of a lot (and I mean ‘a lot’) of unneeded references that ASF uses. Of course, CAN was easier because involved only two pins unlike Ethernet that uses ten pins. I can post later the details of how to port ASF libraries but I have a warning, it is not very Arduino-style, lot of pointers, structures, and low-level stuff, written for engineers, not for beginners.

Post#13:
I don't know if the new DM-9162 is better or not. I need to read about it. Because of SAM3X8E, all my design consideration are derived from Atmel's literature, I know from them that the DM9161 was the best option (you can read other phy suggestions of Atmel in their document 11153) but recently I knew that Atmel just turned to Micrel for the reasons I mentioned in my reply #22.

Post#22:
I was making reference to some phy boards based on KSZ80 series (KSZ8001,KSZ80
51MNL) I did read after Google it. I believe (may be I am wrong), most people in the forum does not build stuff from scratch, like you, but get/purchase parts ready to go. $1 for a KSZ8081RNA sounds like a good deal.

Post#27:
I don't know how old is KSZ8051RNL but Atmel recommended it in their doc 11153.
I can ask Atmel about Micrel and let you guys know.

Post#46:
I am prompted to test again DP83848 but with SAM3X-EK. In the past, I made some mistakes synchronizing the reset pin of the phy. PHY reset pin should be disable for few milliseconds before start handshake. The good of the EMAC library is that lets SAM3X8E to take control over this.

Reply#48:
First quote: The log excerpt that I did read in the serial monitor it means to me that I have good communication.
Second quote: The problem should be in the actual implementation of Ethernet communication.
(Working on it with Atmel technical support. Nothing clear yet).
Both statements make reference to the same library. With my last quote, I wanted to point the user to where (in the files/lines) the attention has to be focused.

I hope I have enlightened you a bit more with my answers. Please, feel free to ask more questions if needed. Regards!

-Wilfredo