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.

FLOWESI-GUI: MSP430FR6989 - Generated Code Seems Wrong

Part Number: FLOWESI-GUI
Other Parts Discussed in Thread: EVM430-FR6989

Hi Team,

My customer generated code using FlowESI-GUI, but they found bug in the code.

in serviceInterrupts(), when the PERIODIC_AFE2_RECALIBRATION flag is on, the code clears the flag right after "if" as below.

However, ReCalScanIF(), also uses PERIODIC_AFE2_RECALIBRATION in the function. so It seems like the flag should be cleared after ReCalScanIF() execution.

void serviceInterrupts(void){
 if(gRecalFlag&PERIODIC_AFE2_RECALIBRATION){
  gRecalFlag &= ~PERIODIC_AFE2_RECALIBRATION;
  Timer_A_setCompareValue(TIMER_RECALIBRATION_SELECTION,
   TIMER_A_CAPTURECOMPARE_REGISTER_0,
   RECAL_TIME_OUT);
  Timer_A_startCounter(TIMER_RECALIBRATION_SELECTION,TIMER_A_UP_MODE);
  ReCalScanIF();
  gRecalCounter = TIME_TO_RECAL_REPEAT;

............

Is this right?

Best Regards,

Ted

  • Hi Ted,

    In serviceInterrupts(), after the code clearing the PERIODIC_AFE2_RECALIBRATION flag, it will start Timer A. In Timer A interrupt ISR, it will set the the PERIODIC_AFE2_RECALIBRATION flag. This function is for periodic re-calibration. The period is controled by Timer A.

    B.R

    Winter

  • Hi Winter,

    in esiCalibration.c line 529~548, It never updates afe2MinDACCH0.

    sensorState = ESI_getLatchedComparatorOutput(CHANNEL_0_PPU_SELECT | CHANNEL_1_PPU_SELECT);
    switch(sensorState)
    {
    case 0x00:
    afe2MaxDACCH0 += ESI_getAFE2DACValue(CHANNEL_0_DAC2_UPPER_REGISTER);
    break;

    case 0x01:
    afe2MinDACCH1 += ESI_getAFE2DACValue(CHANNEL_1_DAC2_LOWER_REGISTER);
    break;

    case 0x02:
    afe2MaxDACCH1 += ESI_getAFE2DACValue(CHANNEL_1_DAC2_UPPER_REGISTER);
    break;

    case 0x03:
    afe2MaxDACCH0 += ESI_getAFE2DACValue(CHANNEL_0_DAC2_UPPER_REGISTER);
    break; default:
    break;
    }

    case 0x00 should be

    afe2MinDACCH0 += ESI_getAFE2DACValue(CHANNEL_0_DAC2_LOWER_REGISTER);

    am I right? Please check.
  • Hi Ted,

    Thanks for your post. You are right. I will report this issue to person responsible for it. Despite of FlowESI GUI, you can refer to the EVM430-FR6989 out of box demo software which is validated. Please find it as below link.

    EVM430-FR6989 Sample Source Code Installer 

    B.R

    Winter

**Attention** This is a public forum