Hello @nxp
i am configuring ADC module for S32k31xevb- q100. i am using Autosar based MCAL layer configuration. in my case i am using software trigger without Interrupt method. it is entering in to this function but my ADc value is not converting Adc_Sar_Ip_StartConversion(PhysicalHwUnitId, ADC_SAR_IP_CONV_CH AIN_NORMAL); what will be reason for this?
hi @Senlent
ok, Thankyou.
Another one problem.
when read data via analog pin. the VREF is always it taking 2.5 v only. I need 3.3v or 5v Vref. where i need to configure this? i can't set the Vref voltage. the configuration setting is inactive. i attached image for your reference
Hi@dhanabharathi
I'm not sure what you mean. Shouldn't VREF be fixed? I
sn't it determined during hardware design?
If I'm misunderstanding your question, please let me know.
Hi @Senlent ,
I will explain clearly My ADC reading seems to be calculated using the internal 2.5 V reference, but my input uses a 3.3 V reference (potentiometer on 5 V). How do I change the ADC reference from 2.5 V to 5 V so that the calculation V_measured = (ADC_value / (2^n − 1)) × Vref uses 5V?
Hi@dhanabharath
"My ADC reading seems to be calculated using the internal 2.5 V reference"
Unless there is a problem with your VREFH pins, this is not possible
The ADC reference voltage VREF cannot be modified via software.
This is related to your current external voltage selections for VREFH and VREFL pins.
If you are referring to how to modify the external ADC reference voltage in hardware, then you
need to review your hardware design and modify it.
hello @Senlent
ok. i understood.
I verified that VREFH is 5.0 V. However, when I feed 4.0 V into the ADC, the conversion result is off from the expected value for a 5 V reference. Could you help me review potential causes (reference selection, calibration, sampling time, or pin routing)?
Hi@dhanabharathi
Share your whole project and i will take time to test it.
Hi@dhanabharathi
I see no problem with your configuration, but some mistake in your code.
Issues 1.
#define ADC_BANDGAP 5980U /* Vbandgap ~ 1.2V on 14 bits resolution, 3.3V VrefH */
#else
#define ADC_BANDGAP 3932U /* Vbandgap ~ 1.2V on 14 bits resolution, 5V VrefH */
#endif
if your VREF is 5V , then the ADC_BANDGAP is 3932, not 5980.
Issues 2.
if ((ResultBufferDma[0u] >> 1U != AdcReadGroupResult[0u]) || \
(ResultBufferDma[1u] >> 1U != AdcReadGroupResult[1u]) || \
(ResultBufferDma[2u] != RESULT_BUFF_VAL) || \
(AdcReadGroupResult[2u] != ADC_RESULT_BUFF_VAL) || \
(ADC_TOLERANCE((ResultBufferDma[0u] >> 1U), ADC_BANDGAP)) || \
(ADC_TOLERANCE((ResultBufferDma[1u] >> 1U), ADC_VREFH)) \
)
You should delete these two lines of code. The original demo only set up two sampling channels, but you are currently using 4 sampling channels. This judgment will cause you to be unable to perform the next sampling.
Hi@dhanabharathi
vrefh and vrefl are the high and low reference voltage points of the ADC, corresponding to the vrefh and vrefl pins of the pins
Can you understand my explanation?
Hi@dhanabharathi
You didn't add and configurate "Rm" component in your project.