ADC0 reading different channels

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ADC0 reading different channels

4,398 次查看
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 项奖励
回复
6 回复数

4,235 次查看
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 项奖励
回复

4,208 次查看
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 项奖励
回复

4,308 次查看
DemaQasem
Contributor II

yes, VREF is stable.

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

0 项奖励
回复

4,353 次查看
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 项奖励
回复

4,361 次查看
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 项奖励
回复

4,381 次查看
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 项奖励
回复