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 uint

Other Parts Discussed in Thread: MSP430FR5969

Hi, I'm writing a code on CCS for a MSP430FR5969 and I don't understand why it doesn't work as I want.

This is the code, and when the last value of the array (1280) is selected the X_Time is something around 64848 (it seems a problem with the size of the int) instead of 128000. I have changed the array from uint16_t to uint32_t and all works well.

uint32_t X_Time=0;
const uint16_t TABLE_X_TIME_MODE_2_0to3[16] = {5,10,15,20,30,40,60,80,120,160,240,320,480,640,960,1280};
X_Time=TABLE_X_TIME_MODE_2_0to3[POT_Frq_0_15]*100;

So I review the code and I find another array :

uint16_t  Gap=0;
const uint8_t TABLE_MODE_0[8][2] ={{1,1},{2,1},{3,1},{4,1},{1,5},{2,5},{3,5},{4,5}};    
Gap=TABLE_MODE_0[Program][1] *1000;

In this case all works well without change the array from uint8_t to uint16_t.

Anyone know why it happens ?


Thanks

Riccardo

**Attention** This is a public forum