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.

SD24INCH_0 is undefined on MSP430 Energy Library

Other Parts Discussed in Thread: MSP430F6736

I have downloaded v2 of MSP energy library from http://www.ti.com/tool/msp430-energy-library

I import emeter-metrology-F6736 into CCSv6 (to use on EVM430F6736)

line 242 of emeter-metrology-setup.c outputs this error "#20 identifier "SD24INCH_0" is undefined"

#if defined(SINGLE_PHASE)
    sd_set_normal_live_current_mode(LIVE); //line242
#else
    sd_set_normal_live_current_mode(CURRENT_1);
    sd_set_normal_live_current_mode(CURRENT_2);
    sd_set_normal_live_current_mode(CURRENT_3);
#endif

Macro expression:

#define sd_set_normal_live_current_mode(a) SD_INCTL_ ## a = SD_INCH_CURRENT | SD_LIVE_CURRENT_GAIN; \
    SD_CCTL_ ## a = SD_DF_1 | SD24SCS_4; \
    SD_OSR_ ## a = 256 - 1; \
    SD_PRE_ ## a = 0;

I see a nice property of CCS that shows the expension steps by default. So it shows:

SD24BINCTL1 = SD24INCH_0 | (0x0020); \
    SD24BCCTL1 = (0x0010) | (0x0008); \
    SD24BOSR1 = 256 - 1; \
    SD24BPRE1 = 0;

I have searched the all files, there is no SD24INCH or similar definition in the energy library. Then I checked msp430F6736.h, so nothing there. Lastly, I checked the datasheet of MSP430F6736 for the SD24_B registers (page 45 of the datasheet), so nothing there neither.

The library and code that I import is the default ones, no modification is done. I am confused why do I get something that is not even defined anywhere related to MSP430F6736 and how can I fix this error?

 

  • It is a reminder to this question that have not got any reply yet.

    The source code was released on 30th May, 2012. I have not seen anybody encountered the same problem as I could search on the web. 2 years is a long time. I wonder if nobody ever uses the library on the CCS or what? 

    The datasheet says that SD24BINCTL1 should have 0x1A value. Since it is a bitwise operation, no value of SD24BINCTL1 would output 0x1A as it is ORed with 0x20. Therefore, I "#define SD24INCH_0", something random (like 0) then assign 0x001A to SD24BINCTL1 manually which seems to solve the problem. As I don't know the library well, could anyone tell me if it would solve the problem or might cause another problem (run-time)?

    I also noticed v1.3 of MSP430F6736.h removed some definitions on the library. It may be related with the missing definition. 

    I posted on one of my unanswered questions that there are some mistakes on the source code which is likely to cause run-time errors or unexpected results. I think the team who maintains the code should be aware of such issues and most probably should already fix it. May I have the latest(clean) version of the library that works fine on CCS (and on EVM430F6736)?

     

  • The 6736 has three independent DS24 converters with exactly one input channel each, which is SD24INCH_0.

    This is the default anyway (zero-value) and it makes no sense setting it to anything else. So the ADC24INCHx bits can be simply written 0 and any SD24INCH_x value can be omitted from the initialization.
    Apparently nobody has bothered to add a superfluous definition to the header file.
    However, why do you insist on using a symbol (which would have a zero-value anyway) while you’re using explicit numeric values for all other control bits?

    Or is it possible that you didn’t take a look at the users guide (which describes all the hardware modules in an MSP family)?
    If so, you should get a copy ASAP. It is available from the MSP430F6736 product page right beneath the datasheet. It’s the same for every member of an MSP family, but nevertheless an integral part of any MSP development.

  • Serdar kose said:
    It is a reminder to this question that have not got any reply yet.

    This is sometimes counter-productive.
    IN my case, I scan the forum oldest first. if I fall behind (which icurrently is the case), then it takes some time to catch up. If oyu post a 'push' notice, your post jumps forward in the thread list adn it takes even longer until I reach it and have a chance to answer.
    It is surely the same for most others here. Without this post, you've had gotten an answer about a week earlier.

**Attention** This is a public forum