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
解決済! 解決策の投稿を見る。
Hello @Weber1
Thanks for your patience.
The bandgap should be enabled before use.
You can use the function SPC_SetActiveModeBandgapModeConfig(SPC0, kSPC_BandgapEnabledBufferEnabled);
It is working fine now.
BR
Alice
Hello @Weber1
Thanks for your patience.
The bandgap should be enabled before use.
You can use the function SPC_SetActiveModeBandgapModeConfig(SPC0, kSPC_BandgapEnabledBufferEnabled);
It is working fine now.
BR
Alice
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)
BR
Weber
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:
The HW setup is as simple as it can be: Windows-laptop -> USB -> FRDM-MCXA156 board -> (nothing else connected)
Any further ideas? Maybe anybody else used the bandgap voltage measurement with or without success?
BR
Weber
Hi @Weber1
Yes, it’s also incorrect on my side. All zeros even use your project.
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
Hello @Weber1
BR
Alice
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
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
Hello @Weber1