ADC0 reading different channels

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ADC0 reading different channels

3,594件の閲覧回数
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 返答(返信)

3,431件の閲覧回数
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 件の賞賛
返信

3,404件の閲覧回数
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 件の賞賛
返信

3,504件の閲覧回数
DemaQasem
Contributor II

yes, VREF is stable.

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

0 件の賞賛
返信

3,549件の閲覧回数
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 件の賞賛
返信

3,557件の閲覧回数
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 件の賞賛
返信

3,577件の閲覧回数
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 件の賞賛
返信