Failing to measure bandgap voltage on channel 27

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

Failing to measure bandgap voltage on channel 27

ソリューションへジャンプ
712件の閲覧回数
Weber1
Contributor II

Hi community,

I'm using an MCXA156 and continuously failing to get plausible values when reading channel 27 of ADC0, which is the bandgap. All other channels (including temperature measurement on channel 26) work fine.

I tried different configurations of the ADC channel command like different sample time, different numbers of conversion, different resolution modes, but failing to get a plausible value of 1.0V: value/adc_resolution*VDDA-voltage, e.g. value=380, resolution=4096, VDDA-voltage=3.3V -> 0.3V.

Strangely my values differ depending on the configured sample time, (e.g. 5806 @65536 or 14800 @32768 resolution which is opbviously wrong). Of course I read in multiple values which seem to be constant (+noise, maybe more than expected) but nevertheless not showing the expected value of 1.0V. I even went back to the basics and tried it on my demo board FRDM_MCXA156 using the SDK code example "frdmmcxa156_lpadc_interrupt", which also fails to show me the correct bandgap values.

Is there anything special about reading the bandgap from ADC0 like it is for the temperature channel?

Maybe I have to route the bandgap signal to the ADC manually? Couldn't anything like this in the manual/datasheet.

Any other ideas how to solve it?

Regards

Weber

ラベル(1)
0 件の賞賛
返信
1 解決策
80件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Weber1 

Thanks for your patience. 

The bandgap should be enabled before use.

You can use the function SPC_SetActiveModeBandgapModeConfig(SPC0, kSPC_BandgapEnabledBufferEnabled);

Alice_Yang_1-1758620590832.png


It is working fine now.

Alice_Yang_0-1758620589523.png

 

BR

Alice

 

  

 

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
81件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Weber1 

Thanks for your patience. 

The bandgap should be enabled before use.

You can use the function SPC_SetActiveModeBandgapModeConfig(SPC0, kSPC_BandgapEnabledBufferEnabled);

Alice_Yang_1-1758620590832.png


It is working fine now.

Alice_Yang_0-1758620589523.png

 

BR

Alice

 

  

 

 

 

0 件の賞賛
返信
74件の閲覧回数
Weber1
Contributor II

Hi Alice,
this works perfectly fine! Thank you!
Seems to be my fault, which was not obvious to me from the manual. But it's not very obvious, I'd say.

By the way: Any ideas what's the bandgap buffer? (BGMODE=10b - Bandgap enabled, buffer enabled)

Weber1_0-1758624635705.png

BR

Weber

 

0 件の賞賛
返信
376件の閲覧回数
Weber1
Contributor II

Hi Alice,

thank you for your efforts. Getting a value of 0 seems also wrong, because expecting 1V of bandgap voltage.

My results are like this:

Weber1_0-1757402610138.png

The HW setup is as simple as it can be: Windows-laptop -> USB -> FRDM-MCXA156 board -> (nothing else connected)

Weber1_1-1757402789201.png

Any further ideas? Maybe anybody else used the bandgap voltage measurement with or without success?

BR
Weber

 

0 件の賞賛
返信
228件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi @Weber1 

Yes, it’s also incorrect on my side. All zeros even use your project.

Alice_Yang_0-1757649039585.png


I will investigate it deeply and confirm with internal teams.
Sorry for the inconvenience caused.

I’ll keep you updated with any progress.
Thank you.

 

BR

Alice

537件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Weber1 

Thanks for your patience.
Are you using the FRDM-MCXA156 board?
Please send your project to me, and I will help test and check it on my side.
Thank you.

 

BR

Alice

0 件の賞賛
返信
460件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Weber1 

Hope you are well. Just wanted to check back and see if you had a chance to review my previous email. Maybe you've already fixed this problem, else don't hesitate to contact us.

 

BR

Alice

0 件の賞賛
返信
454件の閲覧回数
Weber1
Contributor II

Hi,

thank you for the quick reply. Yes, I'm using the FRDM-MCXA156 board and just imported the lpadc_polling example and made a few changes like 

#define DEMO_LPADC_BASE ADC0
#define DEMO_LPADC_USER_CHANNEL 27

With this, I'm getting values around 5900 at high-resolution, which indicates that bandgap voltage is 0.3V.

Find attached the project files.

BR
Weber

タグ(3)
0 件の賞賛
返信
392件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Weber1 

I have tested your project on my side, but I always get almost 0 every time. I am using the FRDM-MCXA156 board.

Alice_Yang_0-1757323864036.png

Could you please share a photo of your hardware connections, as well as the test results from your side?
Thank you.
 
BR
Alice
 

 

0 件の賞賛
返信