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.

MSP430F247: MSP430F247

Part Number: MSP430F247
Other Parts Discussed in Thread: MSP-GANG

I have to use ‘Get Label Command’ from MSP Gang Programmer user guide,which retrieves all hardware and software information. This information also has a ‘Programmers serial number YYMMnnnn’ field. I want to fetch value for serial number field.I am facing problem to understand how this command should be executed and how to get serial number from the obtained response? can you please help us to find the solution for this problem.

  • Hello Shradha,

    From the MSP-GANg User Guide, section 3.5.2.9, the Get Label command elicits a response that has an 140 character array of data. Characters D109-D116 give the serial number for the MSP-GANG being used. You would need to traverse the Data array received to get this serial number. Keep in mind, this is not a specific serial number for the device being programmed, but hte tool doing the programming.
  • I am using following code in my implementation.

    unsafe

    {
    var memHandle = MccService.WinBufAlloc32Ex(140);
    var details = MSPGANG_GetLabel(memHandle);
    var memBytePtr = (byte*)memHandle.ToPointer();
    var readStream = new UnmanagedMemoryStream(memBytePtr, 140, 140, FileAccess.ReadWrite);
    var byteArray = new byte[140];
    readStream.Read(byteArray, 0, 140);
    }

    and imported MSPGANG_GetLabel() method from MSP-Gang.dll like given below:

    [DllImport("MSP-Gang.dll")]
    internal static extern uint MSPGANG_GetLabel(IntPtr dataBuffer);

    As per your suggestion, I have created memory buffer with 140 points which returns intptr memory handle.

    and then I called method MSPGANG_GetLabel()  from MSP_Gang.dll by passing this memory handle as a parameter to this mehod.

    but in response its giving me an response 306, and as per the MSP Gang programmer guide that I am referring, this issue is COM port selection issue. But I am confused about this response of GetLabel method.

    It should return following data

    Am I using wrong parameter to 'MSPGang_GetLabel' method or am I using wrong method to get serial number?

    Can you please share any link  or any c# code snippet where I can see the actual implementation of this command with correct parameters , all the details about what to pass, how to implement

    this command and how to get serial number from the obtained response in C#? I am stucked with this from long time. It will be thankful if you can share any link for this implementation.

  • Hello Shrada,

    It seems you are getting error code 306 which is a timeout error. The most common source is the wrong COM port is selected for talking with the MSP-GANG. Double check the COM port the MSP-GANG is associated with and make sure you initialize the communication with the MSP-GANG with that COM Port using the MSPGANG_InitCom command before using the Get Label command.
  • Hi,

     

    Thank you for your valuable feedback. We have resolved that issue. But I am stuck at an another implementation.

    I am using ‘GangMainProcess()’ function imported from Gang430.dll. Its executing successfully.

    Post this I am executing following code snippet for ‘GangGetResult()’ from the same Gang430.dll.

     

     

    I have referred MSP430 guide document from the link given below:

    www.promelec.ru/.../MSP-GANG430.pdf

     

    As per this user guide GangGetResult returns data in the following format:

     

     

    I am getting result string in the same format. But the issue I am facing is that its always returning a zero value

    For ‘D02’. Can you please tell us the scenario when this error emerges? Is it related to any device setting?

    We are using MSP430 gang device for this execution.

    Thanks & Regards,

    Shradha K.

  • Hello Shradha,

    you are mixing here the MSPGANG430 (old programmer) and the MSP-GANG Programmer (new programmer). you should be using the newer MSP-GANg with the dlls you mentioned before. In either case, it seems you are getting Verification errors. I would point you to section 2.1.1.5 "Verify" and section 6.5 "Question: What are possible reasons for the part to fail Verify step?" within the MSP-GANG User Guide for more information.

**Attention** This is a public forum