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
;****************************************************************************************