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.

TMS570LS3137 - on chip ADC calibration

Other Parts Discussed in Thread: HALCOGEN

Hi Zhaohong,

I used HalCoGen generated on-chip ADC driver code for some testing.

The analog inputs can be read with no problem. But there were some error. So I start to run the adcCalibration().

It's obvious the calibration was not right. The "0" input was read as "7FF" for 12bit ADC mode.

I went through the adcCalibration() step by step while comparing with the steps suggested on the manual.

I did not see the code wrong, but for each of the 4 cal steps, the converted value in CALR register always 0. 

This is a issue I need figure out.

At same time, I do not understand the calculation of "offset_error = conv_val - 0x7FF". 

"7FF" is the middle point of 12bit ADC.  hope to get some explain from you.

If you have a working ADC calibration code (12bit), please provide for reference.

Best regards,

Yanzhong

  • Yanzhong,

    Please check the states of ADrefhi and ADreflo pins. ADrefhi should be connected to a clean 3.3V and ADreflo should be connected to a clean ground.

    Thanks and regards,

    Zhaohong

  • Zhaohong,

    In my design, the VCCAD = 5V (measured 4.96V)

    ADrefhi = 4.096V (measured 4.092V)

    ADreflo = 0 V.

     

    Before using calibration, I can read data (4.092V ref input => 0xF04; 1V ref input =>0x30D).

    After calibration, all reading was great than 0x7FF, because I found the CALR had the value 0x7FF.

    Then stepped in the calibration rountine, I saw the reason, every time the CALR value was 0x00000000. So the final cal value CALR=0x7FF.

     

    Thanks,

    Yanzhong

  • Hi Zhaohong,

    Have you got any comments for me about the ADC calibration?

    The calibration control for CALCR looks pretty straitforward, I do not know why CALR does not provide reference converted results.

    First of All, I want to make sure my hardware condition is correct for using the built-in ADC.

    May I use 5V for VccAD and 4.096V for Vrefhi? - Since I did read ADC results, I suppose I am right.

     

    Thanks,

    Yanzhong 

  • Yanzhong,

    You already see that offset_error = conv_val - 0x7FF. You should write write the value of offset error back to the calibration register before you exit the calibration mode. You can use 5V for VccAD and 4.096V for Vrefhi. Why not also use 5V for Vrefhi? Are there any special requirements?

    Thanks and regards,

    zhaohong

  • Zhaohong,

    The calibration function works now with no reason - The only difference I can can see was  that I restarted my computer and the IAR IDE.

    I also understood the equation offset_error = conv_val - 0x7FF. 0x7FF is the ideal center point value, and conv_val is a 4-pt average value which stands for the center point value.

    There are two considerations for using 5V for VccAD and 4.096V Ref for Vrefhi.  5V and 4.096VRef on board have different accuracy/stability performance; 4.096Vref source may not have enough current load capability to supply the VccAD.

    Thank you for your help. I will close this thread.

    Yanzhong