DS_ADC Calibration issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

Hi

I'm trying the code present here

https://github.com/Infineon/AURIX_code_examples/blob/master/code_examples/EDSADC_1_KIT_TC397_TFT/EDS...

Something goes wrong during the calibration because if I check the CAL register of FCNTC0 the value is TERMINATED instead of COMPLETED.

 

What could be the cause?

 

 

 

 

Checking the code it seems that, if I've well understood, the calibration is automatically started as soon as this function is called 

IfxEdsadc_Edsadc_initChannel
since it cointains the 
IfxEdsadc_Edsadc_initFirFilter that initialize the register AUTOCAL and CALIB. But after this other register are changed without any waiting state. It could the this one the cause?
 
 

Another possibility is that the configuration present into the example is not supported by the Calibration? But I think we go into the second row GAINSEL =0 (1:1) and one of the pins connected to GND and the other as the signal pin

FD_aurix_0-1664807402109.png

0 Likes
1 Solution
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

The root cause of the issue is the wrong place of the calibration request in the IfxEdsadc_Edsadc_initChannel function in the_ IfxEdsadc_Edsadc.c_ file. The calibration request is made in the IfxEdsadc_Edsadc_initFirFilter function which is called before enabling the modulator. However, for correct calibration, this function has to be called after enabling the modulator.

In order to overcome this issue in the example a few modifications in the EDSADC.c file should be done. In function init_EDSADC in line 101 change edsadcChannelConfig.firFilter.calibrationTrigger to FALSE. In line 116 after calling the function IfxEdsadc_Edsadc_startScan add the following lines. We will check internally for the updating of the driver.

edsadcChannelConfig.firFilter.calibrationTrigger = TRUE;    /* Start the calibration initializing the channel   */
IfxEdsadc_Edsadc_initFirFilter(&g_edsadcChannel, &edsadcChannelConfig.firFilter );
while( EDSADC_CH0_FCNTC.B.CAL == 0x1 ); /* wait for the calibration completion */

View solution in original post

0 Likes
5 Replies
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

Any idea?

0 Likes
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

Any idea?  

0 Likes
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

Anyone? Do someone has completed properly the calibration using ILLD?

0 Likes
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

The root cause of the issue is the wrong place of the calibration request in the IfxEdsadc_Edsadc_initChannel function in the_ IfxEdsadc_Edsadc.c_ file. The calibration request is made in the IfxEdsadc_Edsadc_initFirFilter function which is called before enabling the modulator. However, for correct calibration, this function has to be called after enabling the modulator.

In order to overcome this issue in the example a few modifications in the EDSADC.c file should be done. In function init_EDSADC in line 101 change edsadcChannelConfig.firFilter.calibrationTrigger to FALSE. In line 116 after calling the function IfxEdsadc_Edsadc_startScan add the following lines. We will check internally for the updating of the driver.

edsadcChannelConfig.firFilter.calibrationTrigger = TRUE;    /* Start the calibration initializing the channel   */
IfxEdsadc_Edsadc_initFirFilter(&g_edsadcChannel, &edsadcChannelConfig.firFilter );
while( EDSADC_CH0_FCNTC.B.CAL == 0x1 ); /* wait for the calibration completion */
0 Likes
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

Hi

During my last month tests I've also found this possible problem and done the same change but it doesn't solve 100% of the cases. Does it always pass and complete the calibration in your case? What device are you using (I'm using TC377)?

0 Likes