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/MSP430FR2422: MSP430FR2422

Part Number: MSP430FR2422

Tool/software: Code Composer Studio

Dear Sir, 

I have implemented Three channel polling method, After compile which taking maximum memory. If i add ADC INIT and ADC sampling conversion. Some default memory has occupied the memory area. 

void ADC_SequentialSampling(void)
{
int i =0;

Channel = 7;
Portpin = 0x080;

while(Channel != 4)
{
ADCCode[i] += ADCSamplingDatatoRead(Channel,Portpin);
ADCNEXTCHANNEL;
ADCSTOP;
Channel -= 1;
Portpin >>=1;
i++;
}
ADCCLEAR;
ADCSTOP;
Count1++;

if(Count1 > 100)
{
TVSTempCount = ADCCode[0] /100;
LekageCount = ADCCode[1] /100;
TVS_DummyCount = ADCCode[2] /100;

TVSLekagePositiveVolt = (float)((TVSTempCount * 3.3 )/ 1023);
TVSEarthLeakageVolt = (float)((LekageCount * 3.3 )/ 1023);
TVS_TemperatureMVolt = (float)((TVS_DummyCount * 3.3 )/ 1023);
TVSTempCount = 0;
LekageCount = 0;
TVS_DummyCount = 0;
Count1 = 0;
i = 0;
}

 After compile which is taking maximum memory. FRAM size reached 7.3KB. How can i reduce the memory. 

  • My first guess is that the floating point support library code is using up your code space.

    Can you accomplish what you want using scaled-integer rather than float? E.g. multiply everything by 1000 and keep it as integer, then take this into account when you're using it.

  • I agree with Bruce that the floating point is the root cause for large code space occupied. Could you please try to change them to integer calculation and see if there is any improvement? 

    Thanks, 

    Lixin 

**Attention** This is a public forum