read adc value problem

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

read adc value problem

ソリューションへジャンプ
1,395件の閲覧回数
darkblue
Contributor I

I use adc0_dp0 to read value in KW36 sdk, and I got voltage like 1 or 0. Can I just init adc0_dp0 as single mode?

0 件の賞賛
返信
1 解決策
1,149件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @darkblue ,

In this case, we can only choose single-ended mode. Please refer to the Reference Manual [Link] ,  chapter 4.8.2.3.1 ADC0 Channel Assignment listed all options.

Gavin_Jia_0-1695105661349.png

 

Best regards,

Gavin

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
1,378件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @darkblue ,

You are correct. 

When the channel is selected as a Single-Ended Input, the positive input (ADC0_DP0) is the selected input signal. 

 

Best regards,

Gavin

0 件の賞賛
返信
1,374件の閲覧回数
darkblue
Contributor I

thanks for replying.  When I enabled diff mode and used adc0_dm0 to measure voltage, I found that the value was incorrect.  The actual voltage is 1.09v, but it reads 64189. It seems like already over range.  how can I fix that ?

0 件の賞賛
返信
1,293件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @darkblue ,

 

Please check the result value in the code, which cannot be defined as the uint type, because there will be a result of less than 0 when using diff mode.

 

Gavin

0 件の賞賛
返信
1,287件の閲覧回数
darkblue
Contributor I

thanks. I understand the minus number in diff mode. But actually, I want to use the single end mode

I can't find how to make adc0_dm0 working in single mode in MKW36A512RM.  That means adc0_dm0 can be only configured in diff mode in mkw36a512? 

0 件の賞賛
返信
1,208件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @darkblue ,

 

Sorry for my late reply.

I got your point now. If you configure ADC to the single-end mode, you only need to consider dp which should connect input signal. dm connected to GND internally, no additional configuration required, and it can be ignored.

 

Best regards,

Gavin

0 件の賞賛
返信
1,199件の閲覧回数
darkblue
Contributor I

Thanks for reply. Due to project design I can only use dm to measure voltage  instead of dp. Which means I have to connect dm to input signal. meanwhile the dp may be 0 or 1 or float. Does that work? In this situation the dp can be ignored?

0 件の賞賛
返信
1,150件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @darkblue ,

In this case, we can only choose single-ended mode. Please refer to the Reference Manual [Link] ,  chapter 4.8.2.3.1 ADC0 Channel Assignment listed all options.

Gavin_Jia_0-1695105661349.png

 

Best regards,

Gavin

0 件の賞賛
返信