[MC9S12XET256MAA] Bandgap reference voltage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi I need help,
Do you know how can I access to the internal bandgap reference voltage? I want to have access to it via Analog I/O, but I don't know how. I just need it as a reference for other measurements, I'd like to check the pin and have bandgap voltage measurement answer. i.e. in Processor Expert I mapped PAD03_AN03 [Channel4] - bandgap measurment and I would like to read the bandgap via AN03.
I went through documentation
http://www.mouser.com/ds/2/302/MC9S12XEP100RMV1-782786.pdf
I found this but it didn't help.
[The device temperature can be monitored on ADC0 channel[17]. The internal bandgap reference voltage can also be mapped to ADC0 analog input channel[17]. The voltage regulator VSEL bit when set, maps the bandgap and, when clear, maps the temperature sensor to ADC0 channel[17].]
I read also:
https://community.nxp.com/thread/312395#comment-350833
and
MK10FN1M0VLQ12: Use the internal band gap voltage for ADC
Thanks for help
Jacek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jacek,
Find attached example code demonstrating Vbg measurement via ADC.
The bandgap voltage Vbg can be accessed internally and measured by ADC. To route the Vbg to ATD channel internally, the VSEL bit must be set in VREGHTCL register. Also, we need to set the Special Channel (SC) bit in ATDCTL5 register to access reserved channel AN17.
p.s. there was a mistake in the initial project, ADC channel16 was set and temp sensor output was measured instead of VBG on ADC channel17. I have modified the project and re-attach it.
Hope this helps.
Regards,
iggi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi iggi,
I have similar problem. I used your code and i can measure bandgap, but at the same time i have to measure other ADC inputs using PE generated functions. I have problems because of zero occurences and bad measurements in measurement loop.
As manual says "(ATDCTL5) Writes to this register will abort current conversion sequence and start a new conversion sequence." may this be a problem?
Could you help?