G400-D Ethernet: J11D or ENC28?

Hi all,

I have to use the ethernet connection with the G400-D.
From the user guide, it seems that the use of ENC28 (via SPI) is preferred, but, since I have also the SPI Pulse Counter connected to the SPI, I would like to avoid the SPI communication for using the Ethernet.

Thus, I would like to know to which pins of G400D I have to connect the pins of J11D…

I thought that the right pins to be used should be the ones listed in the picture, but I’m confused because of the sentence “The G400-D board has an external Ethernet PHY, be sure to leave the pins unconnected to avoid potential damage”…

Could someone help me in this doubt?

Thank you in advance!

If you a want eth, using the built in eth, just plug an RJ45 socket. These pins are directly connected to the Eth Phy. The J11D can be used

Ok, we have designed our own pcb, where we connect the RJ45pins to the G400-pins in the previous screenshot.

Is it correct?

This sounds good!

Do you have same sample code for this application?

???

what application? :think:

Here’s how I initialize eth in my app.


    public void Initialize()
        {
            eth = new EthernetBuiltIn();
            if (IsDhcp)
            {
                if (!eth.IsDhcpEnabled)
                    eth.NetworkInterface.EnableDhcp();
            }
            else eth.EnableStaticIP(Ip, Subnetmask, GatewayAddress);
            NetworkChange.NetworkAddressChanged += NetworkChangeNetworkAddressChanged;
            NetworkChange.NetworkAvailabilityChanged += NetworkChangeNetworkAvailabilityChanged;
            if (!eth.Opened)
            {
                eth.Open();
            }
        }

Hi,

thank you for your code, but in the meanwhile I managed to run both ethernet and internet connection! Here’s my code:

using GHI.Premium.Net;
using Microsoft.SPOT;
using System;
using System.Net;
using System.Threading;


namespace HCROTA_TEST_Ethernet_J11D
{
    public class Program
    {
        static public bool ethernet_event = false;
        static public bool ethernet_last_status = false;
        static public bool network_is_ready = false;
        static public ManualResetEvent NetworkAvailablityBlocking = null;
        static public EthernetBuiltIn ethernet = new EthernetBuiltIn();

        public static void Main()
        {
            ethernet.Open();
            NetworkInterfaceExtension.AssignNetworkingStackTo(ethernet);
            ethernet.CableConnectivityChanged += ethernet_CableConnectivityChanged;
            ethernet.NetworkAddressChanged += new NetworkInterfaceExtension.NetworkAddressChangedEventHandler(ethernet_NetworkAddressChanged);    
        
            //Dynamic Configuration
            ethernet.NetworkInterface.EnableDhcp();
            ethernet.NetworkInterface.EnableDynamicDns();

            //Static Configuration
            //ethernet.NetworkInterface.EnableStaticIP("10.0.2.160", "255.255.255.0","10.0.2.254");
            //ethernet.NetworkInterface.EnableStaticDns(new string[] { "8.8.8.8" });

            while (!network_is_ready)
            {
                Thread.Sleep(250);
            }
            Debug.Print("Test Request");
            
            try
            {
                using (HttpWebRequest request = HttpWebRequest.Create("http://www.google.com") as HttpWebRequest)
                {
                    HttpWebResponse response;
                    try
                    {
                        response = request.GetResponse() as HttpWebResponse;
                        Debug.Print("Status code: " + response.StatusCode + "  Status description: " + response.StatusDescription);
                        Debug.Print("Content type: " + response.ContentType + "  Content length: " + response.ContentLength);
                        response.Close();
                    }
                    catch (Exception ex)
                    {
                        string exception = ex.Message + " Inner:" + ex.InnerException;
                        Debug.Print(exception);
                    }
                }
            }
            catch
            {
                Debug.Print("Faild to Get the host entry of the FQN from DNS server!");
            }
            Thread.Sleep(Timeout.Infinite);
        }

        static void ethernet_NetworkAddressChanged(object sender, EventArgs e)
        {

            Debug.Print("Network settings:");
            Debug.Print("IP Address: " + ethernet.NetworkInterface.IPAddress);
            Debug.Print("Subnet Mask: " + ethernet.NetworkInterface.SubnetMask);
            Debug.Print("Default Getway: " + ethernet.NetworkInterface.GatewayAddress);
            Debug.Print("DNS Server: " + ethernet.NetworkInterface.DnsAddresses[0]);
            network_is_ready = true;
        }

        static void ethernet_CableConnectivityChanged(object sender, EthernetBuiltIn.CableConnectivityEventArgs e)
        {

            if (e.IsConnected)
            {
                Debug.Print("Cable CONNECTED");
            }
            else
            {
                Debug.Print("Cable DISCONNECTED");
            }
        }


    }
}

;D

Hi All :slight_smile:
It was year ago but think this is good place to ask my question.

Currently we use Raptor + ENC module and we are quite happy with stability - we had a lot of issues with ethernet btw. :smiley:
However we consider using G400-D and builtin ethernet in the final design.

The question is which is more stable/reliable in the long term, do you have any experience you can share?