G80 stopped debugging

My new G80 TH stopped debuging on the following code. I have tried to update firmware, install a new program, erase program.

Code:
using System;
using Microsoft.SPOT;
using GHI.Networking;
using GHI.Pins;

using Microsoft.SPOT.Hardware;

using Microsoft.SPOT.Net.NetworkInformation;
using System.Net;
using System.Threading;

namespace G80EthernetTest1
{
public class Program
{
private static EthernetENC28J60 netif;

    public static void Main()
    {
        Debug.Print(Resources.GetString(Resources.StringResources.String1));
                   

        netif = new GHI.Networking.EthernetENC28J60(SPI.SPI_module.SPI2, GHI.Pins.G80.Gpio.PB7, GHI.Pins.G80.Gpio.PB6); 
        netif.Open();
        netif.EnableDhcp();
        netif.EnableDynamicDns();
        Thread.Sleep(2000);
        Debug.Print("IPAddress" + netif.IPAddress);
        while (netif.IPAddress == "0.0.0.0")
        {
            Debug.Print("Waiting for DHCP");
            Thread.Sleep(250);
        }
        Debug.Print("IPAddress " + netif.IPAddress);
        //The network is now ready to use.
    }
}

}

Thanks for your help,

David Weaver

Is there an Ethernet chip connected? And worked before?

You need to force the loader and reload the firmware.

I had an ethernet board connected but it had not connected before the debugger failed. It is not connected now how do I force a firmware reload to the G89 TH

Thanks for your help David Weaver

Enabling Ethernet without having an Ethernet chip connected may cause the device to freeze.

You need the loader pin to force the loader and then use FEZ config.

https://www.ghielectronics.com/downloads/man/G30_Datasheet.pdf

Got it working by loading a new program after many attempts. Tomorrow I am going to try to get the Ethernet board to work on SPI1. The board I am using is the ENC28J60-H from Mouser electronics I hope it is compatible. I was not able to find anything in the G30 data sheet about a “Loader Pin”.

Thanks again for the help

you might see I posted a documentation request to help clarify all this.

“Loader” = LDR pins, in particular LDR0 and LDR1. (this should be in the docs :slight_smile: )

Can you confirm though, that you are using G80? In one post you said G89 (which I assume is just a typo) and Gus mentioned G30 - I’m assuming G80 was the one you want.

Brett,

I think I found the reference, on the G80 LDR0 is the PE3 pin. I assume to force the board to wait for the bootloader PE3 would be connected to GRD at start up? I will be using SPI1 to connect the ENC28J60-H. I’am not sure which pin to use for CS. I was using PB7? The wiring I plan to use is.

G80TH ENC28J60-H
PB7 CS
PB3 SCK
PB4 MISO
PB5 MOSI
3.3V VCC
GRD GRD

Thanks for helping with the LDR0 clarification. If my bootloader explanation above is correct I will probably be connecting PE3 to GRD today.

1 Like

See section 6 in the G80 manual https://www.ghielectronics.com/downloads/man/G80_Datasheet.pdf for the detail on how to initiate the bootloader, and the pin map earlier for pin loctions; yes, PE3 is LDR0 and hold it to GND to go into loader mode.

As far as selectng a CS pin, that’s an arbitrary selection, totally up to you :slight_smile: Given the issue you had, you may be able to avoid that somewhat by adding a wait before you initialise the ethernet module so the debugger can connect if there’s a comms issue with the ethernet module. You can do that with a wait of an appropriate length of time, or wait until an IO pin state changes (a button press fo example), prior to your code kicking in.

Good luck. Let us know how you go!

I have solved the mystery! All of my Ethernet issues and others were caused by a malfunctioning stacking header. I set the pins to high with and some pins registering 0 volts from the stacking headers. I then took a voltage measurement from the bottom of the board where to pins were connected the the voltage measured about 3.2 volts. I don’t know if the stacking header was defective or if I melted it when soldering it to the board. I assume I melted it. Therefore I have a new soldering iron that I can control the temperature. :wall:

1 Like