S32K118EVB ADC Potenciometer

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

S32K118EVB ADC Potenciometer

1,171 Views
myna
Contributor III

Hello.

Now I want to test ADC sample driver using on S32K118EBV_64.

But it is not working. I checked the circuit diagram.

ADC_POT is not connected ADC0_SE2. Because R761 is DNP.

Do I have to soldering extra with the exception of R761?

And There is something strange ADC Potentiometer in the circuit.

It would be better for TP5 to be connected to ADC0_SE2 than TP528.

Please check s32k118 EBV Circuit.

Thank you.

Best Regards

Labels (1)
0 Kudos
2 Replies

1,002 Views
myna
Contributor III

Hi Lukas.

I have one more question.

I checked the correct data on ADC channel 0.

At the same time, I want to check the values of other channels.

I have tried many things but can not.

How do I read data from multiple channels?

Thank you.

Best Regards

my.na

======================================================

/* Configure and calibrate the ADC converter
* - See ADC component for the configuration details
*/
ADC_DRV_ConfigConverter(INST_ADCONV1, &adConv1_ConvConfig0);
ADC_DRV_AutoCalibration(INST_ADCONV1);

while (1)
{
   /* Configure ADC channel and software trigger a conversion */
   ADC_DRV_ConfigChan(INST_ADCONV1, 0U, &adConv1_ChnConfig0);
   ADC_DRV_ConfigChan(INST_ADCONV1, 2U, &adConv1_ChnConfig2);
   /* Wait for the conversion to be done */
   ADC_DRV_WaitConvDone(INST_ADCONV1);
   /* Store the channel result into a local variable */
   ADC_DRV_GetChanResult(INST_ADCONV1, 0U, &adcRawValue);
   ADC_DRV_GetChanResult(INST_ADCONV1, 2U, &adcRawValue2);

   /* Process the result to get the value in volts */
   adcValue = ((float) adcRawValue / adcMax) * (ADC_VREFH - ADC_VREFL);
   adcValue2 = ((float) adcRawValue2 / adcMax) * (ADC_VREFH - ADC_VREFL);

   printf("adcRawValue : %d // adcValue : %f ", adcRawValue, adcValue);
   printf("adcRawValue2 : %d // adcValue2 : %f \n", adcRawValue2, adcValue2);

   delay(0x7FFFFF);
}

======================================================

0 Kudos

1,003 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

which "ADC sample driver" is that?

If you use SDK examples from RTM3.0.0 like:

c:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K118\driver_examples\analog\adc_hwtrigger\

c:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K118\driver_examples\analog\adc_pal\

c:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K118\driver_examples\analog\adc_swtrigger\

... then it's mentioned in the example documentation:

pastedImage_1.png

Because some users don't want to use in-built potentiometer, it was decided to implemented it in this way.

"It would be better for TP5 to be connected to ADC0_SE2 than TP528."

- well, you can consider that potentiometer R13 and C5 represent source of analog signal and R597 and C549 represent input RC filter. If it is not suitable for you, you can connect external signal, of course.

Regards,

Lukas

0 Kudos