• TI Thinks Resolved

[FAQ] MSP430F6779: Interfacing EMDC with another MCU over UART

Part Number: MSP430F6779

Hello, 

Is there any help available on interfacing EMDC with another MCU over UART.

  • Hi Bilal,

    could you please share more details about the application that you want to build?
    Is it that you want to use the EMDC GUI to configure the MSP430F6779 and then interface the MSP430F6779 with another MSP430? Or do you want to use the EMDC with a MSP430 different than MSP430F6779?
    Please let me know which of the scenarios you need help on.

    Thanks and best regards,
    Britta

    --------------------------------------------------------------------------------------------------------------------------------------

    Please verify the answer by clicking the green  "RESOLVED MY ISSUE " button in case the reply solved your question.

  • Hello Bilal.m.Ahmad,

    The link www.ti.com/.../
    shows an UART to UART bridge with a flow diagram, project files, a source code and much more.

    If your EMDC is based on MSP430F6779 your options would depend on an MCU you are interfacing with.

    Best regards,
    Tom

    If I had answered to your question, please mark this post as Resolved.

  • In reply to Britta Ruelander:

    Thanks for your reply.

    We are trying to achieve the following.

    Design energy measurement solution using ENERGY Measurement Design Center (EMDC) GUI.
    Generate code and deploy it as is (no code changes at all) using JTAG.
    Connect another MSP430( lets call it Host) via UART.
    Read meteorology values on host MCU.
    write calibration parameters to EMDC from Host MCU.

    Questions
    1) I have studied the documentation on EMDC - my understanding is that meteorology values and way to update calibration parameters are exposed on UART by default by EMDC. please confirm its correct.

    2) Id like some help on how to read and write data from EMDC on Host MCU. Code will be helpful. it does not have to be extremely detailed basic will do.

    Regards
    Bilal
  • In reply to Bilal.m.Ahmad:

    Hello Bilal,

    Thanks for your interest in using EMDC. First, I would recommend that you update from the initial version v1.20.00 to the latest version v1.30.00. Here's some feedback.

    Bilal.m.Ahmad
    Design energy measurement solution using ENERGY Measurement Design Center (EMDC) GUI.

    Excellent! We provide several pre-configured EMDC example projects that match our supported EVMs. However, you can always use these as a starting point for your design by saving the project as your custom project and then making your changes rather than starting a new project from the ground up.

    Bilal.m.Ahmad
    Generate code and deploy it as is (no code changes at all) using JTAG.

    You can program the EVM430-F6779 using the provided example firmware images that match the EMDC example projects. There's no need to generate code as long as you use the matching EMDC project and don't need to change anything. If you'd like, you can use the EMDC example project to generate the code, import to CCS or IAR, and then program the EVM430-F6779 over JTAG using the MSP-FET.

    Bilal.m.Ahmad
    Connect another MSP430( lets call it Host) via UART.

    This is possible as long as the UART protocol and state machines match. Please keep in mind that the protocol packets change based on your project configuration - if results aren't needed, then they aren't included to keep the protocol transmission leaner.

    Bilal.m.Ahmad
    Read meteorology values on host MCU.

    Definitely possible. See comments above.

    Bilal.m.Ahmad
    write calibration parameters to EMDC from Host MCU.

    This is also possible if you follow the flow described in the EMDC Technology Guide.

    Now, onto your other questions.

    Bilal.m.Ahmad
    1) I have studied the documentation on EMDC - my understanding is that meteorology values and way to update calibration parameters are exposed on UART by default by EMDC. please confirm its correct.

    Yes, that's correct.

    Bilal.m.Ahmad
    2) Id like some help on how to read and write data from EMDC on Host MCU. Code will be helpful. it does not have to be extremely detailed basic will do.

    Have you had a chance to read through the "Communication Protocol Spec" chapter in the EMDC Technology Guide? More specifically, the "Protocol Overview" section shows how the EMDC GUI communicates with the target MSP430 device. As you can see in the diagram below (found here), the application code running on the target MSP430 device switches modes to start sending results (again, this depends on the results selected in the EMDC configuration before code generation) to the EMDC GUI. If your host MCU follows the same flow and uses the same protocol and baud rate, then you'll be able to read data from MSP430 using your host MCU.

    For more details about the packet structure, refer to the "MSP430 EM Design Center Packet Structure" section in the EMDC Technology Guide.

    I hope this helps!

    Regards,

    James

  • In reply to James Evans:

    Thanks James, This is extremely helpful.

    I aim to deploy the code as it generated by EMDC on to MSP430F6779 EVM.


    What is the default baud rate?


    Thanks
  • In reply to Bilal.m.Ahmad:

    Typically it is 9600 or 115200, 1 stop and no parity.
    It is always worth to check.
    Please, watch an example and flow form 25 cents (link in my first post).

    Best regards,
    Tom

    If I had answered to your question, please mark this post as Resolved.

  • In reply to Bilal.m.Ahmad:

    Bilal.m.Ahmad
    I aim to deploy the code as it generated by EMDC on to MSP430F6779 EVM.

    Excellent!

    Bilal.m.Ahmad
    What is the default baud rate?

    The default baud rate is 250kbaud. I'm not sure how we missed adding that to the documentation. I'll get it added in the next release.

    Regards,

    James

  • In reply to James Evans:

    Hello.
    I found out one thing: when I monitored serial port activity I observed 3 extra bytes before MSP design center ID byte, they are 0x55, 0xAA and 0x0A. These bytes are not described in the spec. How come that they appeared on the line? Also, is CRC checked in the evaluation board?

    Looking forward to your reply.
    Oleg
  • In reply to Oleg Irinichev:

    Hello Oleg,

    You're exactly right. This is the three-byte header that's used by both our CapTIvate and Energy Measurement Design Centers' communication protocol between the GUI and MSP430. What you're observing is:

    • [Byte 0] Sync byte at position 0, equal to 0x55
    • [Byte 1] Blank byte at position 1, equal to NOT 0x55 (0xAA is typically used)
    • [Byte 2] Length byte at position 2, equal to number of payload and checksum bytes (basically payload length + 2)
    • [Byte 3] MSP Design Center ID byte, always 0x04 for EMDC, denoted as position [0] in EMDC packet structure below
    • [Byte 4] Command ID byte, specifies command type, denoted as position [1] in EMDC packet structure below
    • [Byte 5] Read/Write Command byte, specifies read or write operation, denoted as position [2] in EMDC packet structure below
    • [Byte 6] Payload byte 0, denoted as position [3] in EMDC packet structure below
    • ...
    • [Byte N+6] Payload byte N, denoted as position [N+1] in EMDC packet structure below
    • [Byte N+7] Checksum LSB byte, denoted as position [N+2] in EMDC packet structure below
    • [Byte N+8] Checksum MSB byte, denoted as position [N+3] in EMDC packet structure below

    More information about the packets can be found here in the CapTIvate Technology Guide. It does seem rather hidden in the documentation, so I'll add this feedback and request the overall packet structure gets updated in the EMDC Technology Guide.

    I hope this helps!

    Regards,

    James

  • In reply to James Evans:

    Thanks for your response.

    We would like to change the default baud rate from 250K to 115200.

    if we change code that is generated by EMDC to change baud rate. Would the EMDC software work with 115200 baud rate. reason we what to do that is because the device we would like to use does not support 250K baud rate.

    Regards
    Bilal