ADC0 reading different channels

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

ADC0 reading different channels

4,346 Views
DemaQasem
Contributor II

Hello,

I am using S32K144 EVB, Design Studio v1.3

I am trying to read 3 sensor's values.

they are connected to (PTC1, PTB2 and PTC3) on ADC0.
when I connect a potentiometer to PTC1 and read it's value 
all readings (PTC1, PTB2, and PTC3) are affected ! 

 

the code I used is attached.

Thank you.

0 Kudos
Reply
6 Replies

4,183 Views
DemaQasem
Contributor II

Hello,
I checked again ( PTC3 and PTC1) affect each other's readings
I changed all channels to be (PTB1,PTB2 & PTB3) they worked fine.

but the sensors pins are fixed
does it help ?

0 Kudos
Reply

4,156 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @DemaQasem,

Do you inject an current at the pins adjacent to PTC1, PTC3?

Do you measure the voltage at the PTC1, PTC3, VREF pins during the ADC sampling?

If the voltage stays stable during the sampling, I don't see any reason to see incorrect results, especially, if you tested it at longer sample time.

 

Regards,

Daniel

 

0 Kudos
Reply

4,256 Views
DemaQasem
Contributor II

yes, VREF is stable.

PTC1 & PTC3 voltage is 5V which is the Reference voltage.

0 Kudos
Reply

4,301 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Can you scope the VREFH and make sure it is stable?

Have you measured the PTC1 and PTC3 signals using an oscilloscope?

 

Regards,

Daniel

0 Kudos
Reply

4,309 Views
DemaQasem
Contributor II

Thank you @danielmartynek, I tried to increase the sample time and decrease the ADC clock, same thing,
I connected a potentiometer to PTC1 and PTC3 when increasing the resistance on PTC1 without touching  the potentiometer on PTC3, and read the values via UART, they both change values.


0 Kudos
Reply

4,329 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @DemaQasem,

How effected is the reading?

The ADC module does not feature pre-sampling to a known value.

So, the sample-and-hold capacitor keeps the charge from the previous conversion at the start of a new sampling phase.

If you increase the sample time or decrease the ADC clock, do you get better results?

 

Regards,

Daniel

0 Kudos
Reply