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