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.

CCS/MSP430G2553: Temperature acquisition using MSP and ADS1118 interfaced with a K-type thermocouple

Part Number: MSP430G2553
Other Parts Discussed in Thread: ADS1118, ENERGIA,

Tool/software: Code Composer Studio

Hi , We bought MSP430 and ADS1118 booster pack for a project to acquire temperature data using a k-type thermocouple and print it to serial COM port. We created a data acquisition app in C# that reads serial COM periodically , show it in a windows form and save it as csv file with time stamp . We did it successfully using Arduino and MAX6675 , but we are not able to achieve it using TI assembly :( . We tried both in energia and CCS . We are able to flash MSP using TI's MSP430 flasher downloaded from TI software support . Temperature is successfully printed in ADS1118 LCD ,so we re able to upload simple skeches like hello world and blink. But the temperature acquisition and printing to serial is not working ,

Anybody have the energia or ccs version source code of the default temperature acquisition program which is pre-loaded in MSP430(which is now in bin format and we cant edit) .

The program from the above link is also not working . Please help!!!

  • What does/does not happen?

    Can you use one of the serial example sketches to send serial to the PC?
  • We customized an ADS1118.h library from github and now we are able to print data to serial , But do you have the source code of the default program that is flashed in to MSP430 , ie for connecting to ADS1118 and getting temperature values from a k-type thermo couple ?

  • Hello,

    You should be able to find all of the info you are looking for regarding the ADS1118 BoosterPack on the device's linked landing page. There is a provided User's Guide for it along with a zipped file of the firmware.

    Best regards,

    Matt Calvo

  • Dear Matthew , Thanks for your reply , but the fact is that we already tried the bundled support software from the landing page , There is a flash helper (batch file) to upload the (bin format) sketch in to MSP430 to display temperature in the ADS 1118LCD . The program is fully functional and stable. All the switches (buzzer beep temperature threshold and C/F temperature format switching also working fine) But it wont write these values to serial port when connected to a PC , So we would like to get the Energia or CCS source code of the program so that we can customize it to do the serial printing . We saw a CCS code with the bundled pack but thats not compiling in our CCS 6or7.

  • Hello,

    When I go to download the firmware from the landing page, I see that there is another zip file inside of the original zip file with the CCS source code for the MSP430G2553. Please let me know if you are able to see it as well because this seems to be the CCS source code you are looking for. From this, you can dig into the files to see how to add the serial port interface.

    -Matt Calvo
  • Ya ,i saw it ! As i have already told , we tried compiling that but something is not right , i think the issue is with "grace"  tools , we tried different versions but still nothings seems to help. we have managed to get somewhat stable results  with energia code customized by ourselves after tweaking an ADS1118 library that we got from github  .Could you help us by sharing the original energia (prefered) or ccs equivalent of the support package(bin/flashable) file given in the landing page zip archive

  • I am able to reproduce the problem you are referring to and I now understand your concern. Now that Grace is no longer supported on recent versions of CCS, I am going to reach out to the team responsible for developing this booster-pack board and source code to determine if they can provide a compatible version of the source code for customers to use.

    Thank you for bringing this to our attention and I will be sure to fill you in when I get a response. Thank you for your patience!

    Best regards,

    Matt Calvo
  • Hello,

    I have done some digging into this and it turns out that another engineer here at TI has been working with you on another post to develop source code that would be compatible with the CC3220 platform. On that E2E post ( e2e.ti.com/.../635811 ), Josh attached the MSP430G2xx CCS project that would be compatible with CCSv7 and now his team is working on porting that solution over to the CC3220 platform. Thank you so much for your patience and please keep an eye on your SimpleLink Wifi forum thread for when he gets back to you with the solution. I have confirmed with him that he will reach out to you on the other post when that process is complete.

    Best regards,

    Matt Calvo
  • Dear Matthew , Thanks for your quick response , As you have noticed , we had a similar a similar issue with cc3220 , but then josh acknowledged us that the support package for cc3220 with ads1118 was yet to be developed as its a new one , and he assured immediate support , but he didn't responded for a few months , but as we have to complete our project in time , we decided to purchase MSP430 which was supposed to work fine with ads1118 , We used the code in this link >>  but there was some issues with the original ads1118.h  library which i think you may checkout ,also ,Both the ccs project from ads1118 landing page and the ccs code sent by josh https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/968/ADS1118_5F00_LP_5F00_CCSv73.zip  is not working for us . So finally we customized an ads1118.h library that we got from github and developed an energia source code alternate to  Now program is ok , But not as perfect as the (factory flashed) flashable version (bin file version) available from the ads1118 landing page , we would be delighted if you can share us the stable Energia or CCS version of the default MSP430 ADS1118 program.

  • A stable CCS version of the source code would have to be created by migrating the old Grace based source code provided on the landing page to a version that is CCSv7.x compatible. I have set up a meeting with a software apps engineer to see how that can be done. In the meantime, I found this resource that might be able to help you get started on migrating the old code ( processors.wiki.ti.com/.../CCSv7_Grace_Migration )

    Best regards,

    Matt Calvo
  • Hello,

    I have migrated the CCSv5.3 Grace based source code to CCSv7.x and have attached a working CCS version of the default MSP430 ADS1118 program.

    ADS1118_test.zip

    Please let me know if you are able to build/run it successfully. This should give you a working foundation to expand upon for your specific design.

    Best regards,

    Matt Calvo

  • Hi Matthew , thanks for your reply, By the way , the code have two issues

    1 . The code can only convert temperatures up to 500 degree Celsius .(We are trying to extend the functionalities in ADC_Code2temp() in ADS1118.h to make it support up to 900 )

    2.  We are not able to print data to serial , we tried System_printf() but then we are having build errors . (We did it using  serial.print() in energia)

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "ADS1118_test.out" not built

    Any help ??

  • After looking in to the ADS1118.h file and seeing the ADC_Code2temp function, it seems as though you are going to have to alter the if statement tree to account for the wider temperature range.

    I found an E2E post that might be able to give you some guidance in solving your serial print data issue ( e2e.ti.com/.../43747 ). The code should build without issues, as is, when you import it into CCS. Was anything added to the project, after you imported it, which can be producing the errors?

    Best regards,

    Matt Calvo
  • Dear Matthew , Thanks again for your quick response , and yes , we have extended the If statement tree in ADC_Code2temp() to match our requirement, and the code shared by you is working fine (except the fact that it can only measure up to 500 degrees) , But it's showing build errors while we are trying to print the temperature to serial port of a PC .
    here is our code
    void ADC_display()
    {
    //
    .................
    Act_temp = temp;
    LCD_display_temp(1,5,Act_temp);
    LCD_display_char(1,11,'C');
    printf("Temperature: %d!\r\n", Act_temp);//This statement is causing error .
    ............
    }

    Errors thrown
    -----------------

    <Linking>
    "../lnk_msp430g2553.cmd", line 91: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".data" size 0x102 . Available memory ranges:
    RAM size: 0x200 unused: 0x22 max hole: 0x22
    "../lnk_msp430g2553.cmd", line 94: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".stack" size 0x50 . Available memory ranges:
    RAM size: 0x200 unused: 0x22 max hole: 0x22
    "../lnk_msp430g2553.cmd", line 93: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".sysmem" size 0x50 . Available memory ranges:
    RAM size: 0x200 unused: 0x22 max hole: 0x22
    error #10010: errors encountered during linking; "ADS1118_test.out" not built

    >> Compilation failure
    makefile:159: recipe for target 'ADS1118_test.out' failed
    gmake[1]: *** [ADS1118_test.out] Error 1
    makefile:155: recipe for target 'all' failed
    gmake: *** [all] Error 2
  • I was able to recreate what you are seeing by adding

    #include <stdio.h>

    and added a printf() statement in the main function and it caused the same error flags to raise. This is due to the fact that the "printf()" code is very large and there is only .5KB of RAM available on the MSP430G2553. See this E2E post for an explanation ( e2e.ti.com/.../253360 ).


    You can view your memory allocation in real-time using View-> Memory Allocation and seeing the code built before and after adding the printf() statement to see its impact on your RAM usage. What serial communication are you attempting to send to the PC? Could you use the dedicated serial communication peripherals to accomplish the same goal, perhaps the back-channel UART provided on the Launchpad?

    See this post ( e2e.ti.com/.../2147756 ) where Ryan Brown shows example for how you can use back-channel UART for interfacing with the PC.

    Best regards,

    Matt Calvo
  • Ok..  I got you , By the way , I looked in to the post of Ryan Brown that you just referred but sadly that didn't solved our  problem . We actually did the entire code in energia and we are getting the expected results ,

    Anyway as energia have limitations and we want to have fair experience  in  ccs for our future projects , we want to recreate the entire thing in ccs 7 , We modified the ccs (grace tool migrated version) code you shared as per our requirements of temperature range and everything is fine expect the issue with serial printing . Serial.println() works fine in our energia code , is there any alternatives in ccs expect printf() that will work in ccs for msp430 ?

  • Alternatives to printf() for smaller micro-controllers, such as the MSP430G2553, would be to use the on board serial communication peripherals. There is printf() support on CCS, however it is limited to devices with larger memory footprints.

    Using the MSP-EXP430G2 Launchpad User's Guide ( www.swarthmore.edu/.../slau318b.pdf ) and this simple "Hello World" example ( forum.43oh.com/.../ ), you can get a solid understanding of how the back-channel UART works with the board. You must set up a terminal using any terminal connection SW, I use Tera Term, and initialize the communication parameters (in this case, set the baud rate to 9600). Read through the example and the User's Guide to get a full understanding of how it works. One thing to keep in mind is the orientation of the UART jumpers on the Launchpad as their orientation during programming and during code execution are very important.

    Hopefully this helps you implement serial communication to a PC successfully!

    Best regards,

    Matt Calvo
  • Hello,

    If support for the MSP430 side of this request is complete, please go ahead and select "Resolved" so I can close this thread out. Thank you for your help!

    Best regards,

    Matt Calvo

**Attention** This is a public forum