S32K344 ADC2 calibration error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 ADC2 calibration error

1,979 Views
olof1
Contributor I

Hi!

I try to calibrate ADC2 on the S32K344EVB-Q257 but always get error, even after several thousands attempts. Calibration of ADC0 and ADC1 works.

I have started with the example project Adc_example_S32K344 and slightly modified it so that AD0, ADC1 and ADC2 are calibrated, to study and demonstrate this issue.

In the modified project I also start conversion of ADC2 channels and read the values. The BANDGAP and VREFH channels fulfill the ADC_TOLERANCE condition introduced in the original Adc_example project. I have added the ADC2_S19 channel (potentiometer on the evalboard) and the conversion and reading seem to work fine.
The project is attached.

What can be the reason for the error of ADC2 calibration and how to I solve this issue?

Additional question: I have compared the calibration algorithm described in the reference manual for S32K3XX with the Adc_Sar_Ip_DoCalibration() function in Adc_Sar_Ip.c that is eventually called in the Adc_example project via Adc_Calibrate(). I can not find where step 4.
"Disable the error correction for the smaller capacitances in the CDAC of the ADC (write 0h to CAL2[ENX])."
from the calibration algorithm is implemented in the calibration function Adc_Sar_Ip_DoCalibration() (or earlier in the function call sequence). I note that during calibration of all ADC instances CAL2[ENX] is 1. Since the calibration of ADC0 and ADC1 works I guess this is not the problem behind the calibration error but I still wonder where this step is implemented, or if it is not implemented what is the reason? I want to find out to avoid any further issues with the calibration.

 

Thanks!

Olof

0 Kudos
Reply
7 Replies

1,931 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Are you facing incorrect results, or how the issue manifest?

0 Kudos
Reply

1,917 Views
olof1
Contributor I

No, as I wrote in my initial post I measure the BANDGAP and VREFH channels and the results from these measurements are correct. I have also measured other channels as ADC2_S19 (the potentiometer) and the results are correct.

The problem is that the calibration of ADC2 always returns error/E_NOT_OK. This issue manifest when I call

Adc_Calibrate(AdcHwUnit_2, &CalibStatus)

where AdcHwUnit_2 corresponds to the ADC2 instance, and CalibStatus.AdcUnitSelfTestStatus is always E_NOT_OK.

For ADC0 and ADC1 where the calibration works, for which after some attempts the corresponding CalibStatus.AdcUnitSelfTestStatus is E_OK. But, for ADC2 CalibStatus.AdcUnitSelfTestStatus is always E_NOT_OK, even after several thousands calibration attempts! And whether the results are correct or incorrect does not matter because the calibration should work.

To summarize:
*Are you facing incorrect results? No, the results are correct.
*How the issue manifest? Calibration of ADC2 always returns error/E_NOT_OK.

0 Kudos
Reply

1,896 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It seems it is working correctly on my side? Am I missing something?

davidtosenovjan_1-1677844461369.png

 

0 Kudos
Reply

1,894 Views
olof1
Contributor I

Hi, I don't think you are missing something. The project has exactly the same setup for ADC2 as for ADC0 and ADC1, but only ADC2 never successfully calibrates. And now you have tried it on another board, where ADC2 calibration works, so I guess the configuration and program are setup correctly.
I have never had the result you show in your figure, where ADC2 calibration is E_OK, even after multiple runs with several thousand attempts.

Could it be something wrong then with the ADC2 hardware? In that case, how can I fix it? I have tried finding some solution in the ADC2 registers and so on, however without any success.

0 Kudos
Reply

1,885 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

That's hard to say. On the EVB there is nothing what would affect particular ADCs separately.

Could your share complete device part number (all lines printed on the MCU)? Also board revision?

0 Kudos
Reply

1,871 Views
olof1
Contributor I

MCU:
P32K344EHVMMS
0P55A
CTZA2029A

Board:
SCH-53189 REV A
700-53189 REV A
AX214152864

0 Kudos
Reply

1,862 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

We have the same board revision and also same chip. So the only option crossing my mind is some HW failure on the MCU or possibly ADC supply/reference circuit failure (but it should be some corner condition as it only happens with ADC2)

To be honest, I have no idea at this point.

0 Kudos
Reply