Main Site Documentation

G30 Prototype PCB Troubleshooting


#1

Alright so as I expected, I made a shit ton of mistakes on my PCB >.< I have corrected everything so far and have my power circuit running good, no shorts as far as I can tell. However, haven’t had any luck getting code deployed on the G30. I plugged in the my PC to USB Debug port and opened FEZ Config. My computer made a “ding” when I plugged in the board but am unable to ping the G30 or detect what chip it is.

Where should I begin troubleshooting? My USB Debug traces are run as differential pairs with the trace impedance matched (approximately) to the impedance of the USB cable (estimated to be 90 ohms from Google).

I have 100 nF capacitors near every power pin and made sure to add the needed pull ups/downs listed in the datasheet. Before somebody asks, I am not permitted to share the schematic or PCB layout. Please just give me things to check and I will go look on the board myself.


#2

If it dings then there will be some indication in Device Manager of what windows thinks it is. What do you see there?


#3

@jwizard93 I see “GHI Bootloader Interface” under Ports in Device Manager.

I am getting a bit of odd behavior, my current drawn starts at like 140 mA then keeps increasing 1 mA at a time, could this just be because the G30 isn’t programmed?


#4

Where is the guide/instructions on how to do this part? Datasheet is pretty vague. About to leave work for the day so I will continue whatever instructions you give me when I come in tomorrow morning. They want me to have this board fully working by the end of tomorrow :o that is going to be quite the feat.


#5

Something is not right. Not necessarily current that is running through your G30 but somewhere in the board or in a damaged component there is a problem. As it gets hotter resistance is lowering causing the current to go up. Maybe not even a problem, but if you weren’t expecting this behavior then it is probably like I said.

Your G30 isn’t programmed fully. It’s an ST Micro with the GHI Bootloader on it. Use FEZ Config to flash it with netmf


#6

Every G30 I ever bricked is practically a dead short. I have also seen behavior just like what you are describing but I can’t remember the exact cause.

Woah. I really hope everything works out for you.

FEZ Config -> Advanced (The one at the top next to About) -> G30 -> select a port -> select a version ( you gotta have the file of course) -> I think you can take it from here. I can’t remember if you have to mess with the LDR pins or not. I dont think so. I think you only have to do that if netmf is already installed.

You will occasionally get a G30 without netmf. I get that at about 5% rate and I’ve maybe bought like 50 or so. I’m about to buy a ton of these and I’m not looking forward to checking on that. Know this is the case if you are going to mass produce.

Your electrical issue: that’s gonna be tough to offer help if you can’t share. If I’m able I will try to help, though.


G30 prototype
#7

@jwizard93 where do I find the netmf file to flash to the G30? I am on the GHI NETMF start up page but am not sure if its the file from step 2 or step 4 from here


#8

I can get it to say Connected to COM3 in the bottom right. In the Advanced tab it will let me select the G30 and serial port but the box for selecting the version is greyed out and below it says device not ready for update…thing is, my MODE pin is pulled high (as is LRDR0 and RESET) so it should be communicating through USB not a COM port (or is that talking about my PC’s COM port?).


#9

XTAL IN pin has a solid 12 MHz signal. I just need to figure out how to flash the FW…


#10

If I go Advanced—>FW Update–>G30—>COM3 (shown in Device manager to be the GHI Bootloader)—>Select 4.3---->Click Next

After clicking next, I get an error saying the device cannot be updated over serial (which makes sense since Mode is pulled high so USB debug should be selected) but there is no option to select USB on this part. After clicking “Ok” on the serial port error, I also get a second error popping up that says if there is more than one device plugged in the update cannot be completed - except the G30 is the ONLY device plugged into my laptop.

@Gus_Issa Do you have any suggestions? Need to get this sorted out right away


#11

Ok on the ~20th try of updating the firmware it finally went through…I think one of the LD pins has a bad connection…it was showing 300 mV on one pin and 2V on another when they should have been at 3.3V like mode and reset were


#12

Of course none of my components are working yet…I2C transactions keep failing for the display. I tested this code with just the display on the I2C lines…now I have multiple devices so I am not sure if that is changing the behavior or what…both I2C lines are pulled up to 3.3V and I verified continuity


#13

then it sounds like you have a circuit problem, most likely you screwed up the lines or the display isn’t powered. Multiple devices does NOT change anything - concept of the I2C bus is that there’s many devices listening but only responding when their address is sent. Either you have the wrong address (did you alter the state of the display’s address lines in any way?) or the device isn’t electrically connected to the required signals.


#14

@Brett Thank you, got it all working, the display got fried when my regulator blew, it was the only part I didn’t replace


#15

cool news!


#16

Alright so actually I got just about everything working except the display (still need to mess with my FT232 later), I tried replacing it on a fresh board and keep getting failed transactions. There isn’t a specific address line to it just a reset pin which is Active low. Address is 0x078. Traces look good so far…could it be a timing issue? EEPROM works on the same lines as well and its connected further down the line.


#18

Ok I think I found the problem why my display wasn’t working (at least one of them) I was pulling up the wrong pin on the G30 so the reset pin on the display was always low. Now my transactions are going through but the character I am trying to write isn’t appearing.

How can I write text to the display without having to type the binary of every letter out?


#19

Can someone please tell me how to properly write strings with a new haven i2c display?

Here is the class for the display, first couple transactions are configuration commands, trying to get Write() working…

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.Threading;

namespace DisplayTest
{

public class Display
{
    public  I2CDevice.Configuration I2CConfig;
    public I2CDevice I2C;
    public OutputPort reset;
    /// <summary>
    /// Initializes a new instance of the <see cref="Display"/> class.
    /// </summary>
    public Display()
    {
        reset = new OutputPort(GHI.Pins.G30.Gpio.PB9, true);
        Thread.Sleep(100);
        reset.Write(true);
        Thread.Sleep(100);
        I2CConfig = new I2CDevice.Configuration(0x3C, 100);  // 400 KHz, A0-A2 shorted to ground (by design) = 0x50
        I2C = new I2CDevice(I2CConfig);
        Thread.Sleep(100);
        I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[1];
        transaction[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x00, 0x34});
        Thread.Sleep(10);
        if (I2C.Execute(transaction, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }            
      Thread.Sleep(10);

        transaction[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x00, 0x1 });
        Thread.Sleep(10);
        if (I2C.Execute(transaction, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }
        transaction[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x00, 0x14 });
        Thread.Sleep(10);
        if (I2C.Execute(transaction, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }
        
      
        transaction[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x00, 0x0C });
        Thread.Sleep(10);
        if (I2C.Execute(transaction, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }

        transaction[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x40, 0x8F });
        Thread.Sleep(10);
        if (I2C.Execute(transaction, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }
        Thread.Sleep(10000);
        
    }
  

    public void Write(int Address, byte[] data)
    {
        byte[] byte1 = new byte[2];
        byte1 = new byte[] { (byte)(Address >> 8), (byte)(Address & 0xFF) };
        int length = byte1.Length + data.Length;
        byte[] payload = new byte[length];
        byte1.CopyTo(payload, 0);
        data.CopyTo(payload, byte1.Length);
        var xActions = new I2CDevice.I2CTransaction[1];
        //    byte1=[(byte)(Address>>8),(byte)(Address&0xFF)];
        xActions[0] = I2CDevice.CreateWriteTransaction(payload);
        Thread.Sleep(5);
        if (I2C.Execute(xActions, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }


    }

    /// <summary>
    /// Writes the string Text at the specified address.
    /// </summary>
    /// <param name="Address">The starting address to write to</param>
    /// <param name="Text">The text to write to EEprom</param>
    public void Write(int Address, string Text)
    {
        var xActions = new I2CDevice.I2CTransaction[1];
        byte[] buffer = System.Text.Encoding.UTF8.GetBytes("00" + Text);  // the "00" string reserves the room for the 2 bytes address that follows
        buffer[0] = (byte)(Address >> 8);
        buffer[1] = (byte)(Address & 0xFF);
        xActions[0] = I2CDevice.CreateWriteTransaction(buffer);
        Thread.Sleep(5);
        if (I2C.Execute(xActions, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }

    }
    /// <summary>
    /// Reads the specified address.
    /// </summary>
    /// <param name="Address">The address to be read</param>
    /// <returns>One byte from the EEprom</returns>
    public byte Read(int Address)
    {
        var Data = new byte[1];
        var xActions = new I2CDevice.I2CTransaction[1];
        xActions[0] = I2CDevice.CreateWriteTransaction(new byte[] { (byte)(Address >> 8), (byte)(Address & 0xFF) });
        Thread.Sleep(5);
        if (I2C.Execute(xActions, 1000) == 0)
        {
            Debug.Print("Failed to perform I2C transaction");
        }
        else
        {
            xActions[0] = I2CDevice.CreateReadTransaction(Data);
            Thread.Sleep(5);   // Mandatory after each Write transaction !!!
            if (I2C.Execute(xActions, 1000) == 0)
            {
                Debug.Print("Failed to perform I2C transaction");
            }
            else
            {
                Debug.Print("Register value: " + Data[0].ToString());
                return Data[0];
            }

        }
        return 0;
    }

}
}

Not sure what the buffer should look like in this part, tried sending binary of 1 of the characters given in the table but I am thinking this is the wrong way to go about it?

  using System;
 using Microsoft.SPOT;
 using Microsoft.SPOT.Hardware;

 namespace DisplayTest
{
public class Program
{
  
    public static void Main()
    {
      
        Display disp = new Display();

     byte[] buffer = new byte[]{00000001};
        disp.Write(0x40, buffer);
    }
    
}
 }

#20

here is a thread that has some code that should help you - it may not be the same display or the same chip but the concept should help. I2C driver for New Haven LCD display oh wait, seems we’ve been here, done this… dig out your old code…

But if you want yet another example, Dealextreme LCD i2c 20*4 really isn’t the same display but can help you structure code sensibly.

Why not pick a problem and keep your discussion ordered and in that thread?


G30 USB Debug Inconsistent connection
#21

I have dug out my old code, posted above. I figured it’d be better to post in my current thread than dig up an old one. I have solved every problem on my Prototype PCB so far, this is the last one I have discovered, so in my mind it is ordered :smiley:

In that old thread, I got the same display to show up some random characters on the screen but not the ones I wanted. Think I was getting noise in the wires. Now on the PCB, all transactions are going through but nothing is showing up on the screen