EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

alternative to IAR's @
syntax for CCS

Started by Pete Flugstad February 2, 2010
I'm using IAR Kickstart:

IAR C/C++ Compiler for MSP430
4.20.1 [Kickstart] (4.20.1.30017)

and I've setup code to calculate the temperature using the ADC and
it's calibration values.
To support this, I use this syntax (I'm sure I found it in an example
somewhere):

// ADC Cal Tag is @0x1A14 - 1 bytes
// ADC Cal Length is @0x1A15 - 1 bytes
// ADC Gain Factor is @0x1A16 - 2 bytes
// ADC Offset is @0x1A18 - 2 bytes
// ADC 1.5V Ref Factor is @0x1A1A - 2 bytes
__no_init unsigned short cal_adc_15T30 @ 0x1A1C;
__no_init unsigned short cal_adc_15T85 @ 0x1A1E;

It's probably not the "right way" to do it, but it worked just fine.

Now I'm having to switch over to CCSv4, which has the compiler:

MSP430 Evaluation C/C++ Compiler v3.2.1
Build Number 1JE6M-KDADEMDK-RTARQ-TAV-ZACIF_T_S_R

I've looked but I haven't found any alternative syntax like the IAR Kickstart
compiler has. Do I need to do something like:

unsigned short cal_adc_15T30 = *((unsigned short *)0x1A1C);

Or maybe add something to the msp430f54x.cmd linker file?

Thanks,
Pete

Beginning Microcontrollers with the MSP430


The 2024 Embedded Online Conference