This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problems writing a C#.NET application for MSP-FETU430IFusing MSP430.dll

Other Parts Discussed in Thread: MSP430FR5729

Hello,

 

I am trying to write a visual studio 2008 application (C#) to function as a programmer and automated test equipment for a new product. When I try and add a reference to the MSP430.dll to the VS C# project I get an error saying : 'A reference to MSP430.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component'.

 

Does anyone have any experience in successfully adding the MSP430.dll to a VS C# project?

Alternatively I guess I can program a part using the MSP Flasher application.... This would be fine for programming the entire part but can this also be used to write bytes to just the INFO memory of a part [MSP430FR5729] (so I can put some product specific settings on a case by case basis depending on the customers order/requirements)?

 

Cheers,

Mike

  • Mike,

    I received the same error when I tried to add the dll as a reference.  I don't have all function calls working yet in a C# project, but I do have many working.  I put the MSP430.dll and HIL.dll in the same directory as my C# exe.  

    Then I used calls such as the following (C#):

    [DllImport("MSP430.dll")]
    static extern STATUS_CODE MSP430_GetNumberOfUsbIfs(IntPtr Number);

    [DllImport("MSP430.dll")]
    static extern STATUS_CODE MSP430_GetExtVoltage(ref Int32 voltage, ref Int32 State);

    I am having some trouble getting certain calls such as "MSP430_Memory" to work, so I wouldn't say that I have successfully added the MSP430.dll to a VS C# project, but I do have a good start, and hopefully this helps give you a jump start (if I am not too late in this reply...if so, perhaps it will help someone else).

    Best of luck to you,

    Nathan

  • Please Nathan,

    Help me whith this code.

    [DllImport("MSP430FPA.dll", EntryPoint = "F_Initialization", CallingConvention = CallingConvention.Cdecl)]
    public static extern int F_Initialization();

    public Form1()
    {
    string[] myPort = SerialPort.GetPortNames();

    InitializeComponent();

    serialPort1.PortName = "COM17";
    serialPort1.BaudRate = 9600;

    //Other Serial Port Property
    serialPort1.Parity = Parity.None;
    serialPort1.StopBits = StopBits.One;
    serialPort1.DataBits = 8; //Open our serial port
    serialPort1.Open();

    int i = F_Initialization();

    }


    Don't work.


    Please.

**Attention** This is a public forum