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.

calculation error in msp430??

Other Parts Discussed in Thread: MSP430F2618, CC430F5137

hi all am using msp430f2618 controller .. in my coding some arithmetic calculations is there that is


lSignal2 = lSig*1410/wSa1+1024;

in this code lSig = -2;
wSa1 =500;

as per the manual calculation the answer should be lSignal2 = 1018 but am getting lSignal2 =-183787 while i debug my code by means of step by step
but if the lsig value is positive means its working properly,

since i declared lSignal2,lSig variables as a "signed long int" and wSa1 as a "unsigned int" variable...

what should i do to rectify this calculation errors???

**Attention** This is a public forum