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.
Tool/software: Code Composer Studio
For MSP430F67641 application, Three-Phase Energy Measurement system, I down load this source code from the web, but it is IAR. But I use IDE is CCS. My question: where can I get the the source code of CCS.
Thanks and best regard
Lucy zhou
Hello Lucy,
Thank you for your post. Unfortunately, the existing Energy Library source code features support for IAR but not CCS. However, we're actively monitoring requests for CCS support and if anything changes, I'll be sure to update you.
For now, I would recommend using IAR as your IDE. Porting the IAR projects to CCS is extremely challenging. For example, the toolkit (mathematical) functions have been implemented in assembly and must be ported. There's some discussion about this in the following thread.
CCS/MSP430F6736: SLAA517e - MSP low-power microcontroller forum - MSP low-power microcontrollers - TI...
Regards,
James
MSP Customer Applications
Hello,
You can download IAR from the following link.
The DriverLib project should include (under the "inc" folder) a header file called 'hw_memmap.h'. This file (shown below) includes a call to the 'msp430.h' header file. Using the device chosen when creating the project, it will automatically select the correct header file such as 'MSP430F67641.h'.
/* --COPYRIGHT--,BSD * Copyright (c) 2017, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * --/COPYRIGHT--*/ #ifndef __HW_MEMMAP__ #define __HW_MEMMAP__ #define __DRIVERLIB_MSP430F5XX_6XX_FAMILY__ //***************************************************************************** // // Include device specific header file // //***************************************************************************** #include <msp430.h> #include "msp430f5xx_6xxgeneric.h" #include "stdint.h" #include "stdbool.h" //***************************************************************************** // // SUCCESS and FAILURE for API return value // //***************************************************************************** #define STATUS_SUCCESS 0x01 #define STATUS_FAIL 0x00 //***************************************************************************** // // Macro for enabling assert statements for debugging // //***************************************************************************** #define NDEBUG //***************************************************************************** // // Macros for hardware access // //***************************************************************************** #define HWREG32(x) \ (*((volatile uint32_t *)((uint16_t)x))) #define HWREG16(x) \ (*((volatile uint16_t *)((uint16_t)x))) #define HWREG8(x) \ (*((volatile uint8_t *)((uint16_t)x))) #endif // #ifndef __HW_MEMMAP__
Regards,
James
MSP Customer Applications
Hello Lucy,
I apologize for the delayed response due to the holidays.
Regarding the IAR license, please refer to the following IAR website.
Also, you can find information about the source code and flowcharts in the Implementation of a Low-Cost Three-Phase Electronic Watt-Hour Meter Using the MSP430F67641 app note.
Regards,
James
MSP Customer Applications
Hello Lucy,
You'll probably need to add the #defines related to the UART_2 interface in the 'emeter-template.h' file (put the code snippet below after Line 71). I see that they exist for the UART_0 and UART_1 but not UART_2. Adding "UART_2_SUPPORT" will increase "MAX_UART_PORT" from 2 to 3 in 'emeter-communication.h' file (see Lines 36 to 49), which should allow UART_2 to be configured (I suspect that your issue is caused by disabled UART_2 interrupts). Remember to rebuild all the projects in this order after making changes to any files: emeter-toolkit-67641 -> emeter-metrology-67641 -> emeter-app-67641.
/*! This defines the speed of eUSCI 2 */ #define UART_2_SUPPORT #define UART_2_BAUD_RATE 9600 #define UART_2_DLT645_SUPPORT
Regards,
James
MSP Customer Applications
James,
Thanks.
I done some modifications for use Uart_2 (See attached), after I modify the code, I rebuild all the projects in this order after making changes to any files: emeter-toolkit-67641 -> emeter-metrology-67641 -> emeter-app-67641,but still don’t enter the break point, see the attached.
Use IC: MSP430F67641IPN (80pins)
Thanks and best regards
Lucy
UART1 and UART2 break point.docx
James,
Any update?
This is urgent for me.
In our application, need use these two functions,UART_A2(p2.2,p2.3) and B0_SPI (P1.7,P2.0,P2.1),but cannot right working,I use TI provide UART and SPI example of code add to slaa621c source , Cannot enter their interrupt entrance.When I only buld UART and SPI example code ,they are right.How do I add these two function to slaa621c source? pls advise.
Thanks and best regards
Lucy zhou
James,
ThanksUART1 and UART2 register.xlsx
I use original code and build it,URAT_1 is working.Then I add define UART_2 same as UART_1 below,
#define UART_2_SUPPORT
#define UART_2_BAUD_RATE 9600
#define UART_2_DLT645_SUPPORT
UART_2 can right configure and can enter line 270 break point,But UART_2 still cannot working.I check and compare their registers,find out UCA2IE=0,its value has been modify,UART_2 cannot interrupt,refer the attached. Where can I restore its interrupt enable?
(One more thing, if you're debugging, please be sure to turn off the compiler optimizations (both size and speed). I've found where this causes problems when debugging if not done.) I don't find out where can turn off?
Thanks and best regards
Lucy zhou
lucy zhou said:(One more thing, if you're debugging, please be sure to turn off the compiler optimizations (both size and speed). I've found where this causes problems when debugging if not done.) I don't find out where can turn off?
In IAR, right-click the project, go to Properties > C/C++ Compiler > Optimizations, select "None" for Level, click "OK" and then rebuild the project. You'll need to do this for each project.
lucy zhou said:I use original code and build it,URAT_1 is working.Then I add define UART_2 same as UART_1 below,
#define UART_2_SUPPORT
#define UART_2_BAUD_RATE 9600
#define UART_2_DLT645_SUPPORT
UART_2 can right configure and can enter line 270 break point,But UART_2 still cannot working.I check and compare their registers,find out UCA2IE=0,its value has been modify,UART_2 cannot interrupt,refer the attached. Where can I restore its interrupt enable?
I'd try tracking down exactly where the interrupt gets disabled.
Regards,
James
MSP Customer Applications
**Attention** This is a public forum