Can I expect some answer to my last post?
Thank you in advance
It is recommended to bypass the reference voltage with a 1µF cap at pin P0_3 or P3_2.
Set in ADC configuration Reference, but check if on your board the cap is already installed. See if that works better.
Hi Bob, yes, I put a 1.0 uf capacitor not in a project I posted here but on other I tested after and the table with Vin and ADC counts remain the same.
I just have a little experience with analog circuits, may be you can consider that and be so kind to give some help to understand why after calibration at zero volt and almost ADC FS range I get such error. My understanding is it is not about DNL or INL because the errors are very big as you can see. So every thing is OK at end of two point calibration but not in the middle.
Thank you very much for your answer.
I saw a similar post but it doesn't work for mi case.
This time I am trying to use the hardware method for offset and gain adjustment.
Please find attached Topdesign.
I am facing some issues regarding the use of GCOR and OCOR for the Delta Sigma Converter.
I followed the explanation of AN 68403, I set the values of those registers up in a calibration function, afterward I am doing measurements with the ADC but the ADC counts I am getting are Zero values.
The main loop is only a measurement function an also the calibration function which is always called but it is only for test purpose.
The same measurement function give non calibrated counts, but it give me counts when I am not using the calibration function
The following code snippet is the procedure I am following to set the correction registers up.
In that function is a fact that :
1-The Registers GCOR and OCOR are written in EEPROM verified through the debugger using a memory windows.
2-That the return value of " ADC_DelSig_1_SetGCOR(gcor_newf); " is zero telling me that the correction multiplier is in the range 0 to 1.999.
3- The conversion of gcor_new to float is OK and verified with a on line converter - " gcor_newf = GetFloatP(gcor_new); "
4- The ADC is bypassed at P0(3) .
/* Read the existing OCOR register to ocor_old */
ocor_old = (int32) (ADC_DelSig_1_DEC_OCOR_REG) + // 0X40004E08
((int32) (ADC_DelSig_1_DEC_OCORM_REG) << 8) + //0X40004E09
((int32) (ADC_DelSig_1_DEC_OCORH_REG) <<16); //0X40004E0A
//Read from EEPROM the ocor_new
ocor_newL = CY_GET_REG8(CYDEV_EE_BASE + 4);
ocor_newM = CY_GET_REG8(CYDEV_EE_BASE + 5);
ocor_newH = CY_GET_REG8(CYDEV_EE_BASE + 6);
ocor_new= ocor_newL | ocor_newM<<8 |ocor_newH<<16;
/* Add the offset correction read from EEPROM to the existing OCOR value */
ocor = ocor_old + ocor_new;
/* Write the updated OCOR value back to registers */
ADC_DelSig_1_DEC_OCOR_REG = (int8)(ocor);
ADC_DelSig_1_DEC_OCORM_REG = (int8)(ocor>>8);
ADC_DelSig_1_DEC_OCORH_REG = (int8)(ocor>>16);
/* Update the GCOR register with the GCOR adjustment read from EEPROM */
/*Read from EEPROM the gcor_new*/
gcor_newl= CY_GET_REG8(CYDEV_EE_BASE );
gcor_newh= CY_GET_REG8(CYDEV_EE_BASE + 1);
gcor_new= gcor_newl | gcor_newh<<8;
/* Convert gcor_new to float*/
gcor_newf = GetFloatP(gcor_new);
ExistentGcor =ADC_DelSig_1_ReadGCOR() ;
Hope you can help me with this.
Thank you in advance.
TopDesign.docx 199.6 K
I do not understand why you are going the complicated way by writing directly io internal registers.
When you have got two different known voltages measured you can compare them to the result and solve the equation for
y = a*x +b
Then you can use the functions ADC_SetOffset(b) and ADC_SetGain(a) to do a 2-point calibration.
Thank you Bob
I am wondering why this complicated way is suggested in the AN 68403.
Also is suggested to use the APIs to do soft calibration.
As a commentary before that, I used the linear equation you are suggesting me to get "a" and "b", afterward I applied: ADC corrected =(Adc read - b) /a .
The Vdacs were set to 10 mv and 1124 mv to get "a" and "b".
As a result the gain of the signal chain is approx 7 instead of approx 8, (PGA gain=8) and LPF gain<1.
On the other hand I am sure you will give me an explanation about when to use the method of the AN 68403 for PSoC LP.
Thank you very much for your help, as always you do.
The appnote AN 68403 is comparably old, it goes back to Creator 2.0 as you can see. I presume that at that time the components weren't as comfortable as nowadays. When you need more precision you could write your own conversion using float arithmetic.