s32k144 adc error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k144 adc error

1,244 Views
maojun
Contributor II

Hi:

 I have a touble with s32k144 about its adc function.when I using its adc function.if the problem was happended,the adc Value I inquired was half,but the adc supply voltage to adc input pin was 3.3V,it is same as the adc reference voltage.Normally,it could not be half of the right value. In  additon, during the problem, other ad supply voltage could retrun a right value except 3.3V.

If  anyone else has this problem or has some advices,please let me know. thank you very much for your help.

Tags (1)
0 Kudos
3 Replies

918 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi maojun@hangsheng.com.cn,

I tested the ADC function with 3.3V supply voltage and I did not notice any error. 

Do you use evaluation board S32K144EVB?

Could you share your code?

Thank you.

Best Regards,

Diana

0 Kudos

918 Views
maojun
Contributor II

Hi  Diana:

I wasn‘t use evaluation board ,I use the board on my project;

In addition,this problem isn't occurted every time.

here are some codes.

static t_ADC_Resolution_Table ADC0_ResolutionTable[]=
{
{
AirAdchannel,ADC_RESOLUTION_8BIT
},
{
HardVerAdchannel,ADC_RESOLUTION_8BIT
},
{
DATypeAdchannel,ADC_RESOLUTION_8BIT
}

};

unsigned short bsp_ADC0_GetChanVal(unsigned char chan)
{
unsigned short tmpVal=0;
unsigned char i=0;
adConv0_ChnConfig0.channel = chan;
/* Configure ADC channel and software trigger a conversion */
ADC_DRV_ConfigChan(INST_ADCONV0, 0, &adConv0_ChnConfig0);
/* Wait for the conversion to be done */
ADC_DRV_WaitConvDone(INST_ADCONV0);
/* Store the channel result into a local variable */
ADC_DRV_GetChanResult(INST_ADCONV0, 0, &tmpVal);

for(i=0; i<ARR_SIZE(ADC0_ResolutionTable); i++)
{
if(chan==ADC0_ResolutionTable[i].chan)
{
switch(ADC0_ResolutionTable[i].resolution)
{
case ADC_RESOLUTION_10BIT:
tmpVal=TransResolution_12_10(tmpVal);
break;

case ADC_RESOLUTION_8BIT:
tmpVal=TransResolution_12_8(tmpVal);
break;

default:
break;
}
}
}

return tmpVal;
}

0 Kudos

918 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your information.

In that case, I recommend you look at the document AN12217 - S32K1xx ADC guidelines, spec and configuration: https://www.nxp.com/docs/en/application-note/AN12217.pdf 

There is a chapter 2. ADC concepts, error sources and specification. Also, check if is your analog input signal source resistance within ADC specification.

I hope it helps you.

Best Regards,

Diana

0 Kudos