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.

MSP430FR6989: Calibration process

Part Number: MSP430FR6989

Dear MSP team,

My customer need some support on the calibration process for the ESI interface. 

In the https://www.ti.com/lit/an/slaa639/slaa639.pdf the initial calibration takes place during a second ( function Set_Dac() ) -  Section 4.6: Optimal DAC Voltage Level Setting

Nevertheless, in the real application, if lower fluxes are expected, we can't make sure the metal and nonmetal part of the disc are measured during the 1 second delay.

Should we stay in the Set_Dac() for longer waiting for the metal and nonmetal part  to be detected?

Is there a way to wait in the Set_Dac() function to wait for the metal and not metal part to be seeing? 

Do we need this initial calibration, or it is enough with ReCalScanIF() ? 

 

Thanks and best regards, 

Juan. 

  • Hello Juan,

    Our expert on this solution is out of office today, but is returning next week. They should be able to reply to you by 7/21.

  • Hello Jace,

    Do we have any update of this?

    Best regards

    Samuel

  • Hi Samuel,

    Should we stay in the Set_Dac() for longer waiting for the metal and nonmetal part  to be detected?  Yes, I would recommend staying in Set_Dac for a time period long enough to detect metal and non metal.

    Is there a way to wait in the Set_Dac() function to wait for the metal and not metal part to be seeing?  No, we do not have any function to auto detect this.

    Do we need this initial calibration, or it is enough with ReCalScanIF() ? It is recommended to perform the initial calibration.  You can find further details in the app note below.

    https://www.ti.com/lit/an/slaa609a/slaa609a.pdf 

  • Hi Eddi,

    Thank you for your response, I'm trying to implement it similar as the initial calibration of 8 turns. So enabling Q6 and ESISTOP interrupts on SetDac() in order to get 4 loopcounters in which I have a LMP3+ GIE, but Q6 flag is not detected properly with the disk rotating, do you have any idea?

    void Set_DAC(void)
    {
    // min 4 ,  max 6;
    #define SEPARATION_FACTOR               4
    
    	uint16_t loopCounter = 0;
    	fastParams fsParams= {0};
    
    	gMinDACCH0 = 4096;
    	gMaxDACCH0 = 0;
    	gMinDACCH1 = 4096;
    	gMaxDACCH1 = 0;
    
    	fsParams.range = 5;
    
    	fsParams.channel0Enabled = true;
    	fsParams.channel1Enabled = true;
    
    	// minimum times 4, maximum 6;
    	gStateSeparation = gNoiseLevel*(SEPARATION_FACTOR-1)+gNoiseLevel/2;
    
    
    	 // do loop for 1 more second after valid separation detected;
    	//do {
            
            ESI_clearInterrupt(ESI_INTERRUPT_FLAG_ESISTOP);
            ESI_enableInterrupt(ESI_INTERRUPT_ESISTOP);
            //ESI_clearInterrupt(ESI_INTERRUPT_FLAG_Q6_BIT_SET);
            //ESI_enableInterrupt(ESI_INTERRUPT_Q6_BIT_SET);
    
    
    		// do loop for detection of valid Max-Min separation;
    		do {
    		    uart_sprint("xxx Set DAC xxx ");
    
    			fsParams.channel0StartingPoint = ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER);
    			fsParams.channel1StartingPoint = ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER);
    
    			FindDAC_Fast_Successive(&fsParams);
    
    			if(fsParams.channel0Enabled ==true){
    				if(ESI_getAFE1DACValue(CHANNEL_0_DAC1_LOWER_REGISTER) < gMinDACCH0){
    					gMinDACCH0 = ESI_getAFE1DACValue(CHANNEL_0_DAC1_LOWER_REGISTER);
    				}
    
    				if(ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER) > gMaxDACCH0){
    					gMaxDACCH0 = ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER);
    				}
    			}			if(fsParams.channel1Enabled ==true){
    				if(ESI_getAFE1DACValue(CHANNEL_1_DAC1_LOWER_REGISTER) < gMinDACCH1){
    					gMinDACCH1 = ESI_getAFE1DACValue(CHANNEL_1_DAC1_LOWER_REGISTER);
    				}
    
    				if(ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER) > gMaxDACCH1){
    					gMaxDACCH1 = ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER);
    				}
    			}
    			ESI_clearInterrupt(ESI_INTERRUPT_FLAG_Q6_BIT_SET);
                ESI_enableInterrupt(ESI_INTERRUPT_Q6_BIT_SET);
    	        loopCounter++;
    
    	        if (gRecalFlag&INITIAL_AFE2_RECALIBRATION) {
    	            ESI_disableInterrupt(ESI_INTERRUPT_ESISTOP);
    #ifdef USE_UART
    	            sprintf(__buff, "<%d\n", loopCounter);
    	            uart_sprint(__buff);
    	            if ((loopCounter == 4) ) {
    	                uart_sprint("o\n");
    	                gRecalFlag |= VALID_RECALIBRATION;
    	            }
    #endif
    
                ESI_clearInterrupt(ESI_INTERRUPT_FLAG_Q6_BIT_SET);
                ESI_enableInterrupt(ESI_INTERRUPT_Q6_BIT_SET);        // Enable Q6 INT for in case of Time out.
                //ESI_enable();
                uart_sprint("Wait for Q6 flag\n");
                __bis_SR_register(LPM3_bits+GIE);
    	        }
    
    	        ESI_clearInterrupt(ESI_INTERRUPT_FLAG_ESISTOP);
    	        ESI_enableInterrupt(ESI_INTERRUPT_ESISTOP);
    	        ESI_clearInterrupt(ESI_INTERRUPT_FLAG_Q6_BIT_SET);
    	        ESI_enableInterrupt(ESI_INTERRUPT_Q6_BIT_SET);
    
    	        // To detect the a change due to rotation
    			// if a separation of gStateSeparation is found, a rotation is
    			// detected and keep running for 1 second to find the max and min
    
    			gThresholdH0 = gMaxDACCH0 - gMinDACCH0;
    			gThresholdH1 = gMaxDACCH1 - gMinDACCH1;
    
    			// check for valid separation
    
    			if(fsParams.channel0Enabled==true){
    				if (gThresholdH0 > gStateSeparation){
    					gESIStatusFlag |= VALID_SEPARATION_CH0;
    				}
    			}
    			if(fsParams.channel1Enabled==true){
    				if (gThresholdH1 > gStateSeparation){
    					gESIStatusFlag |= VALID_SEPARATION_CH1;
    				}
    			}
    			ESI_disable();
    		}while (!((gESIStatusFlag&VALID_SEPARATION_CH0) && (gESIStatusFlag&VALID_SEPARATION_CH1) && (gRecalFlag & VALID_RECALIBRATION)));
    
    	//} while(!(gRecalFlag & VALID_RECALIBRATION))   ;   // 1 second for 2340Hz using Find_Fast_Successive();
    	// "+" for INV version, "-" for non-INV version
    
    	if(fsParams.channel0Enabled ==true){
    		ESI_setAFE1DACValue((gMaxDACCH0 + gMinDACCH0)/2, CHANNEL_0_DAC1_UPPER_REGISTER);
    		// "+" for INV version, "-" for non-INV version
    		ESI_setAFE1DACValue(ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER) + gNoiseLevel, CHANNEL_0_DAC1_LOWER_REGISTER);
    		gAFE1Base0 = ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER);
    		// "-" for INV version, "+" for non-INV version
    		ESI_setAFE1DACValue(ESI_getAFE1DACValue(CHANNEL_0_DAC1_UPPER_REGISTER) - gNoiseLevel, CHANNEL_0_DAC1_UPPER_REGISTER);
    	}	if(fsParams.channel1Enabled ==true){
    		ESI_setAFE1DACValue((gMaxDACCH1 + gMinDACCH1)/2, CHANNEL_1_DAC1_UPPER_REGISTER);
    		// "+" for INV version, "-" for non-INV version
    		ESI_setAFE1DACValue(ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER) + gNoiseLevel, CHANNEL_1_DAC1_LOWER_REGISTER);
    		gAFE1Base1 = ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER);
    		// "-" for INV version, "+" for non-INV version
    		ESI_setAFE1DACValue(ESI_getAFE1DACValue(CHANNEL_1_DAC1_UPPER_REGISTER) - gNoiseLevel, CHANNEL_1_DAC1_UPPER_REGISTER);
    	}
    
    
    }

**Attention** This is a public forum