Main Site Documentation

G120HDR and ENC28 Freeze


#1

Hi All,

I have a G120HDR (v1.1) and a ENC28 (v1.1) powered by USB Client DP (v1.3) connected to a 12v lab power supply.

I wired up the GND-3.3 volt-5 Volt - CS - SPI - CS and INT to the correct pin’s and copy pasted this simple code to test:


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

namespace MFConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            EthernetENC28J60 Eth1 = new EthernetENC28J60(SPI.SPI_module.SPI2, GHI.Hardware.G120.Pin.P1_9, GHI.Hardware.G120.Pin.P0_10, GHI.Hardware.G120.Pin.P1_28, 4000);
            Eth1.Open();
            NetworkInterfaceExtension.AssignNetworkingStackTo(Eth1);
            Eth1.CableConnectivityChanged += Eth1_CableConnectivityChanged;
            Eth1.NetworkAddressChanged += Eth1_NetworkAddressChanged;
            Eth1.NetworkInterface.EnableStaticIP("192.168.1.226", "255.255.255.0", "192.168.1.1");
        }

        static void Eth1_NetworkAddressChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        static void Eth1_CableConnectivityChanged(object sender, EthernetENC28J60.CableConnectivityEventArgs e)
        {
            throw new NotImplementedException();
        }

    }
}

And this code just freezes, no errors, no timeout’s nothing…
If i put a breakpoint on Eth1.Open(); and step in to the code i see it freezes here:

Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.EthernetENC28J60’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.NetworkInterfaceExtension’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.NetworkInterfaceExtension’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces’
Step into: Stepping over non-user code 'Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.NetworkInterfaceExtension’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkChangeExtension.NetworkAddressChanged.add’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkChangeExtension.NetworkAddressChanged.add’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.NetworkInterfaceExtension’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.EthernetENC28J60’
Step into: Stepping over non-user code 'Microsoft.SPOT.Hardware.OutputPort.OutputPort’
Step into: Stepping over non-user code 'Microsoft.SPOT.Hardware.OutputPort.OutputPort’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.EthernetENC28J60’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.EthernetENC28J60’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkChangeExtension.NetworkAvailabilityChanged.add’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkChangeExtension.NetworkAvailabilityChanged.add’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.EthernetENC28J60’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Open’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.IsOpen.get’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Open’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Reset’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Reset’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Reset’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Reset’
Step into: Stepping over non-user code 'GHI.Premium.Net.EthernetENC28J60.Open’
Step into: Stepping over non-user code 'GHI.Premium.Net.NetworkInterfaceExtension.Open’
Step into: Stepping over non-user code ‘GHI.Premium.Net.NetworkInterfaceExtension.OpenDriver’

Anny Ideas?

Thanks


#2

Not by accident swapped MISO & MOSI ?


#3

@ RobvanSchelven - I checked gain but nope. also changed the reset from 1_28 to 0_0 because 1_28 is LCD but no change.

Also, i’m unable to stop this code and deploy again, i have to flash the device first before i can deploy again.


#4

Clock connected to the wrong pin :whistle: