While VBAT=6V,according to S912ZVL12F0 datasheet,
VDDA & ADC reference voltage is not 5V any more. This will influence sampling precision.
How to fix this problem?
Solved! Go to Solution.
Hi Joe,
Sorry, the VRH and VRL are the reference voltage inputs. It can be selected as the reference input by selection in ADCCMD_1 register. I suggested you to connect these pins to VSSA/VDDA to avoid not accurate measurements when the ADCCMD_1 register is not properly set. I suggest you to use the VBG voltage and recalculate the ADC result for each ADC measurement to reach highest accuracy.
Best Regards,
Stano.
Hello Joe,
Thank you for your request.
There are two option how to maintain the high accuracy of the ADC measurements – use the external reference voltage or use the internal reference VBG voltage. The internal stabile reference VBG is mapped to ADC internal_1 input as showed in Table 1-7. The value of this voltage reference is measured during manufacturing process by -40 and +150C and the average values are stored in IFR register in FLASH memory.
The next option usable when the VDDA = VRH (by VSSA = VRL) varies is the make VBG measurement always together with required analog value measurement and then recalculate the final ADC channel result. The detail values of the VBG voltage are in Table B-1 and detail description of the ADC Calibration in Section 1.14.1 of the RM_V2.49:
https://www.nxp.com/webapp/Download?colCode=MC9S12ZVLRM
I think it can help you to solve your issue, but you are welcome with next questions.
Best Regards,
Stano.
Hello Stano,
Thanks for your instant response!
The test result is as below:
VBAT(V) | VSUP(V) | VDDX(V) |
6.06 | 5.49 | 4.364 |
6.24 | 5.65 | 4.5 |
6.44 | 5.84 | 4.61 |
6.63 | 6.05 | 4.91 |
According to the test data, while VBAT<6.63V时,VDDX is not 5V.
At the same time,the ADC reference voltage is not 5V any longer.
Will ADC sampling result in a deviation?
Hello Joe,
This is not problem. When you measure such ADC value for your application measure also the VBG voltage in conjunction and then recalculate the final result for the measured analog value. The VBG voltage is stabile 1.20V (see RM) even if the VDDA voltage varies in allowed range. The recalculation sequence is in Sec 1.14.1. So the measurement accuracy is based on VBG voltage accuracy not VDDA.
If the VDDA voltage differs from 5.0V (e.g. VDDA = 4.0V) the ADC measurement of the VBG voltage provides higher digital value (than for VDDA=5.0V). So this means the full ADC range =0xFFF means 4.0V not 5.0V. The back recalculation gives the correct measurement value.
Best Regards,
Stano.
According to MCU datasheet 1.9.1.1
Set VRH_1 to VDDA, VRL_1 & VRL_0 to VSSA, then MCU_Pin16 for other uses(e.g use MCU_Pin16 for ADC channel 0),
MCU_Pin13 for other uses (e.g use MCU_Pin13 for GPIO). Is it right?
Hello Joe,
Please select the right version of ADC module as in Table 10-2.
The VRH pins connect externally to VDDA and the VRL pins connect externally to VSSA. Those are references for ADC and must be connected properly. Use also the suggested capacitance as close as possible to affected pins.
So for LQFP48 the pin16 belongs to VRH = VDDA and pin 13 belongs to VRL = VSSA.
For LQFP32 pin 12 = VRH = VDDA and pin 9 = VRL = VSSA.
Other free pins can be used for ADC inputs or GPIO.
Best Regards,
Stano.
This is TRK-S12ZVL demo sch from NXP web site.Why VRH & VRL for ADC input channel?
How to get ADC12B_LBA Module Version?Take S912ZVL12F0MLF as an example.
That means MCU_pin13 & pin16 can only use as VRL & VRH,while using ADC module.
Why MCU_pin13 has AN1 function,MCU_pin16 AN0?At which condition ,they can be used as ADC channel?
Hello Joe,
The Knox MCU on Picture is ZVL32 and VRH & VRL connection is described in RM Sec.1.9.1.2. This is ADC12B_LBA version V1.
The ZVL128 has ADC V2.
The detail information about those reference pins is in Figure 10-2 and Sec. 10.4.1.2. Sorry that there is no Table with clear information about ADC versions in RM.
The extra reference pins (VRH or VRL) can be used for the special analog measurements where the reference points are not equal to VDDA and VSSA. Then the ADC result in data register reflects the range from VRL to VRH (e.g. from 1.0V to 4.0V). In this case the VRL and VRH levels can be measured by ADC inputs together with analog value in this range and then the accurate analog value is calculated.
The information about allowed VRH and VRL range is in Table C-1 in RM.
I hope this helps you to solve your task.
Best Regards,
Stano.
Take S912ZVL12F0 as an example.
According to RM 1.9.1.1, if setting VRH_1 mapped to VDDA, VRL_1 &VRL_0 mapped to VSSA, is the external Pin VRH no need to connect VDDA and VRL Pin no need to connect VSSA?Then VRH & VRL can be used for ADC input channel or GPIO?
if S912ZVL12F0 is ADC12B_LBA V3 , which Pin mapped to VRH_2?
Hello Joe,
The S912ZVL12F0 has ADC12B_LBA_V2 so pin VRH_2 not exists. The ZVL12F0 = ZVL128. The number “8” is not showed on type mark.
So this MCU has VRH_0 mapped to PAD0 and VRH_1 mapped to VDDA -> Sec1.9.1.1. Thus if you want measure VRH_1 (selected in the ADCCMD1 register) you will measure VDDA value. If you select VRH_0 you will measure analog value of PAD0.
Best Regards,
Stano.
According to the discussion before, the following schematic is used.
To avoid error configuration to damage MCU, if MCU_Pin16 needed to series one resistor to VDDA?
Hi Joe,
Yes sure, never connect GPIO pins directly to power supply pins. If you want to use it as analog input the series resistor to measured point with small capacitance (~100pF) to GND has to be used. The capacitance can be higher value also – it depends on the measured signal properties. If you want to measure VRH I suggest you Rs = 3k3 and C4 = 1nF. If you want measure such analog signal on AN0 then Rs = 220 and C4 = 100pF for high speed signals. The high speed signals are usually impedance amplified (A = 1) by properly selected OpAmp. The R, C for slower signals could be Rs <= 470, C4 about 1nF.
For better understanding please read document from my friend:
https://os.mbed.com/media/uploads/GregC/an4373-cookbook_for_sar_adc.pdf
I think it could help you with your design.
Best Regards,
Stano.
I use this circuit,not for measuring VRH. You suggest that VRH & VRL should be connected to VDDA & VSSA respectively in order to accurate ADC measure even VBAT <6V.
Hi Joe,
Sorry, the VRH and VRL are the reference voltage inputs. It can be selected as the reference input by selection in ADCCMD_1 register. I suggested you to connect these pins to VSSA/VDDA to avoid not accurate measurements when the ADCCMD_1 register is not properly set. I suggest you to use the VBG voltage and recalculate the ADC result for each ADC measurement to reach highest accuracy.
Best Regards,
Stano.