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.
Hello,
Is there any help available on interfacing EMDC with another MCU over UART.
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 said: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 said: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 said: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 said:Read meteorology values on host MCU.
Definitely possible. See comments above.
Bilal.m.Ahmad said: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 said: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 said: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
Bilal.m.Ahmad said:I aim to deploy the code as it generated by EMDC on to MSP430F6779 EVM.
Excellent!
Bilal.m.Ahmad said: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
Hello Oleg,
You're exactly right. This is the three-byte header that's used by both our CapTIvate and Energy Measurement Design Center's communication protocol between the GUI and MSP430. What you're observing is:
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
You should be able to change the baud rate in the 'uart_defs.h' file located under your CCS project > DesignCenter > comm > drivers folder. However, please keep in mind that it's not possible to change the baud rate of the EMDC GUI running on the PC. Assuming you generate your EMDC code and you're planning to interface with another host MCU, you can always use a lower baud rate, protocol, or different type of interface (e.g. I2C, SPI, etc.). As I may have mentioned, one of the goals behind EMDC was to allow users to focus on the application side, which includes the communication, rather than trying to figure out all the metrology code.
//***************************************************************************** // //! def UART__SAMPLING_MODE defines the eUSCI_A LF or HF mode. // //! def UART__PRESCALER defines the eUSCI_A pre-scaler. // //! def UART__FIRST_STAGE_MOD defines the eUSCI_A first stage modulation. // //! def UART__SECOND_STAGE_MOD defines the eUSCI_A second stage modulation. // //***************************************************************************** #define UART__SAMPLING_MODE (EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION) #if (EM_SMCLK_FREQ_IN_HZ == 25165824) //250K Baud Rate @ 25MHz #define UART__PRESCALER (0x06) #define UART__FIRST_STAGE_MOD (0x03) #define UART__SECOND_STAGE_MOD (0x02) #elif (EM_SMCLK_FREQ_IN_HZ == 16777216) //250K Baud Rate @ 16MHz #define UART__PRESCALER (0x04) #define UART__FIRST_STAGE_MOD (0x03) #define UART__SECOND_STAGE_MOD (0x00) #elif (EM_SMCLK_FREQ_IN_HZ == 8388608) //250K Baud Rate @ 8MHz #define UART__PRESCALER (0x02) #define UART__FIRST_STAGE_MOD (0x01) #define UART__SECOND_STAGE_MOD (0x02) #else #error "SMCLK frequency not supported by the UART driver" #endif
I hope this helps.
Regards,
James
**Attention** This is a public forum