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/MSP430F5438A: Array Declaration

Part Number: MSP430F5438A

Tool/software: Code Composer Studio

Hello,

I am having an issue with array declaration in my project. I found that after element assignment, the array element values are not actually changing rather showing (-1) for all! Here I am pasting a rough code to clarify the problem:

#include <msp430.h>
#include <stdio.h>
#include <stdint.h>


void main (void)
{ int i, j, k,l,m,n;
float y[211], out [211];

int in[211] = {4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, ----------------> Like here at in[] array none of the value is assigned, all are (-1)
4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
4095, 4095, 4095, 4095, 4090, 4095, 3920, 4095,
3754, 4095, 3608, 4095, 3412, 4095, 3306, 4095,
3144, 4095, 3044, 4086, 2974, 4032, 2950, 3972,
2884, 3925, 2880, 3829, 2860, 3704, 2901, 3651,
2950, 3481, 2965, 3367, 3013, 3236, 3081, 3066,
3136, 2971, 3179, 2820, 3238, 2705, 3323, 2665,
3418, 2624, 3562, 2552, 3420, 2397, 3434, 2325,
3362, 2259, 3344, 2261, 3306, 2222, 3087, 2158,
3448, 3084, 4095, 2806, 2652, 2060, 2880, 2555,
2798, 2599, 2712, 2688, 2584, 2823, 2506, 2848,
2400, 2926, 2289, 2974, 2225, 3069, 2161, 3088,
2112, 3105, 2048, 3116, 2048, 3114, 2048, 3085,
2070, 3094, 2118, 3048, 2185, 3017, 2276, 2938,
2368, 2880, 2423, 2752, 2504, 2656, 2608, 2554,
2703, 2464, 2788, 2381, 2838, 2272, 2956, 2240,
3052, 2186, 3095, 2148, 3141, 2132, 3191, 2112,
3199, 2120, 3181, 2132, 3136, 2169, 3136, 2240,
3100, 2340, 3051, 2442, 3032, 2595, 2986, 2806,
2914, 2727, 2780, 2898, 2640, 2904, 2554, 3008,
2480, 3092, 2381, 3008, 2112, 3353, 2886, 4095,
2810, 3010, 1728, 3098, 2240, 3264, 2201, 3219,
2240, 3165, 2241, 3136, 2322, 2992, 2333, 2914,
2392};
int BPcoef[211] = {-3, -6, -8, 6, 34, 49, 34, 6, -8, -6, -3};

WDTCTL = WDTPW| WDTHOLD;

for (j=11; j<211; j++ )
{
BPcoef[j]= 0;
}
for (k=201; j<211; k++ )
{
in[k]= 0;
}


for (l=0; l<211; l++ )
{
out[l] = 0;
for (m=0; m<l;m++)
{
out[l] += ((in[m]*2.5)/4095)* BPcoef[l-m];
}
}
for (n=0; n<211; n++ )
{
y[n]=out [n];
}

}

Thanks.