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.

Floating Point Package for MSP430F5325 micro

Other Parts Discussed in Thread: MSP430F169, MSP430F5325

Hi There

Is there a new FPP for MSP430F5325 devices? I tried to use FPP4.13 it gave me RES0 redefined error then, after I changed it to RES00 to get around that issue, the calculations are incorrect. I have used the same calculation routine in IAR workbench with MSP430F169 and it has worked OK. Here is an example of code:

;************************************************************************************************
VinCalc

call #FLT_SAV
sub.w #4,SP ; prevent stack corruption
mov.w #wVin,RPARG
call #CNV_BIN16U ;

sub.w #4,SP
mov.w SP,RPARG ;offset pointer from the previous result
mov.w #11234,0(RPARG) ;Vin = Vin*11234
call #CNV_BIN16U

mov.w SP,RPRES
add.w #4,RPRES
call #FLT_MUL ;

sub.w #4,SP ; prevent stack corruption
mov.w SP,RPARG ;offset pointer from the previous result
mov.w #010000,0(RPARG)
call #CNV_BIN16U

mov.w SP,RPRES
add.w #4,RPRES
call #FLT_DIV ;Vin = Vin*11234/10000


call #CNV_FP_BIN ;call floating point to Binary number convertion routine
mov.w 4(SP),&wVin ;Vin in mV

add.w #14,SP
call #FLT_REC
cmp.w #500,&wVin
jc VinCalcRet
mov.w #500,&wVin ; 5.0 V min
VinCalcRet
ret
;****************************************************************************************

  • Souren Harutyunyan said:
    Is there a new FPPfor MSP430F5325 devices?

    I can't find a later version than FPP 4.13.

    Souren Harutyunyan said:
    I have used the same calculation routine in IAR workbench with MSP430F169 and it has worked OK.

    Is HW_MPY set to 0 (use software multiplier) or 1 (use harware multiplier)?

    FPP has been written to use the 16-bit Hardware Multiplier module which is in the MSP430F169.

    The MSP430F5325 uses a different 32-bit Hardware Multiplier module, with different registers compared to the MSP430F169. To use FPP on the MSP430F5325 think you will have to set HW_MPY to 0 to use the software multiplier.

  • Hi Chester. Thank you very much for your help. It is all under control now.

**Attention** This is a public forum