<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Re: Bandgap reading accuracy (bandgap is enabled in PMC) in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334833#M15933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ping,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As stated in the heading of the post, the bandgap buffer is enabled.&lt;/P&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;P&gt;My main() calls PE_low_level_init() and has the following code&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* PMC_SPMSC1: LVWACK=1,LVWIE=0,LVDRE=1,LVDSE=0,LVDE=1,??=0,BGBE=1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;PMC_SPMSC1&lt;/STRONG&gt; = (uint8_t)((PMC_SPMSC1 &amp;amp; (uint8_t)~(uint8_t)(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVWIE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDSE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x02U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )) | (uint8_t)(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVWACK_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDRE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;PMC_SPMSC1_BGBE_MASK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;/P&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my previous readings, you can see that they are not random. &lt;/P&gt;&lt;P&gt;For the rail voltage of 5.3V, the counts of 0x0365-0x03B7 correspond to a bandgap voltage of 1.12-1.23V.&lt;/P&gt;&lt;P&gt;Note that temperature is constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added 1uF to the voltage rail and will repeat the measurements. If this is the expected precision at constant temperature I need to select an alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a paid option for support?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2014 23:53:14 GMT</pubDate>
    <dc:creator>ryanparasram</dc:creator>
    <dc:date>2014-12-02T23:53:14Z</dc:date>
    <item>
      <title>Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334827#M15927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a S9KEAZN64AMLC controller with a 5.3V power supply. I have a scope on the power supply and see that it is stable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the PIT triggering ADC conversions at 500us.&lt;/P&gt;&lt;P&gt;The ADC is configured to take 4 12 bit readings with 16 bit right justified results.&lt;/P&gt;&lt;P&gt;The ADC is configured as&lt;/P&gt;&lt;P&gt;- Discontinuous mode OFF, Low power mode OFF, ADC clock 1Mhz, Conversion time 40us, Sample time 23.5 clock periods.&lt;/P&gt;&lt;P&gt;- When I read the bandgap and dump the results to a serial port, I see the 8 LSB's changing, corresponding to about 1.11 to 1.21V&lt;/P&gt;&lt;P&gt;- The CPU is clocked at 8Mhz (both Core and Bus)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping that the values will have good precision and maintain at least 4LSB's.&lt;/P&gt;&lt;P&gt;Could you tell me what I am doing wrongly and what I may try?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 15:31:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334827#M15927</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-11-12T15:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334828#M15928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, it need to keep the ADC VERFH and VREFL be stable.&lt;/P&gt;&lt;P&gt;We recommend customer to use VREFH = VDDA and VREFL =VSSA, while customer also could select any stable voltage to VREFH and VREFL.&lt;/P&gt;&lt;P&gt;Then customer can select the ADC with long sample time in software.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;BR /&gt;best regards &lt;BR /&gt;Ma Hui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 07:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334828#M15928</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2014-11-14T07:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334829#M15929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use Processor expert to configure the device and I see that VDDa/REFH and VSSA/VREFL are selected as the references.&lt;/P&gt;&lt;P&gt;I scope the VDD/VSS lines and the voltage is stable. The readings below imply a change in the 5V rail of 0.3V for the short sample and 0.17V for the long sample (assuming a 1.16 BandGap).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried both long (23.5 clock periods) and short (3.5 clock periods) sample times with the same result. PE prevents selecting invalid options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The full ADC config is now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short sample time (3.5)&lt;/P&gt;&lt;P&gt;Conversion time 20us&lt;/P&gt;&lt;P&gt;ADC clock 1Mhz&lt;/P&gt;&lt;P&gt;I get 8 results as follows (note variation in bit 7)&lt;/P&gt;&lt;P&gt;BG0371&amp;nbsp; BG038A&amp;nbsp; BG03A5&amp;nbsp; BG0362&amp;nbsp; BG0389&amp;nbsp; BG039A&amp;nbsp; BG0386&amp;nbsp; BG039A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long sample time (23.5)&lt;/P&gt;&lt;P&gt;Conversion time&lt;/P&gt;&lt;P&gt;ADC clock 2Mhz&lt;/P&gt;&lt;P&gt;I get 8 results as follows (note variation in bit 7)&lt;/P&gt;&lt;P&gt;BG0396&amp;nbsp; BG038A&amp;nbsp; BG0397&amp;nbsp; BG038B&amp;nbsp; BG0397&amp;nbsp; BG0397&amp;nbsp; BG037A&amp;nbsp; BG0395&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a sample Keil project that I may use to read the bandgap a few times?&lt;/P&gt;&lt;P&gt;Could there be a bug in PE 10.4.0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate the quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 14:05:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334829#M15929</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-11-14T14:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334830#M15930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;I was wondering if you can share your demo, then I could run this demo with the TRK-KEA64 board and reproduce this issue.&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 03:46:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334830#M15930</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2014-11-28T03:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334831#M15931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ping,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the driver code generated from Processor Expert and built in Keil uVision 5.12. The code generation simply has the settings stated previously.&lt;/P&gt;&lt;P&gt;I have the code compiling with a proprietary telemetry application. Before working to separate the telemetry app from the bandgap and serial routines, could you let me know what configuration will work for the bandgap?&lt;/P&gt;&lt;P&gt;I can easily modify my code from PE to try different configurations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following another suggestion, I slowed the ADC clock down to close to the minimum (0.4Mhz), with the following config&lt;/P&gt;&lt;P&gt;12 bit&lt;/P&gt;&lt;P&gt;Sample time 3.5 clock periods&lt;/P&gt;&lt;P&gt;Conversion time 48.48us&lt;/P&gt;&lt;P&gt;ADC clock 412.5khz&lt;/P&gt;&lt;P&gt;Conversion time 56.382us&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I still get the following results&lt;/P&gt;&lt;P&gt;(Note that the PIT triggers a reading every 500us and I get 8 buffered readings)&lt;/P&gt;&lt;P&gt;Try 1: BG0368&amp;nbsp; BG03A3&amp;nbsp; BG039E&amp;nbsp; BG0397&amp;nbsp; BG0368&amp;nbsp; BG035B&amp;nbsp; BG039D&amp;nbsp; BG0374 BG0382&lt;/P&gt;&lt;P&gt;Try 2: BG03A2&amp;nbsp; BG03B7&amp;nbsp; BG037B&amp;nbsp; BG036B&amp;nbsp; BG0382&amp;nbsp; BG0377&amp;nbsp; BG03A6&amp;nbsp; BG039A BG038F&lt;/P&gt;&lt;P&gt;Try 3: BG03AC&amp;nbsp; BG03AB&amp;nbsp; BG037F&amp;nbsp; BG039D&amp;nbsp; BG039C&amp;nbsp; BG0385&amp;nbsp; BG0365&amp;nbsp; BG03AE &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;BG0394&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. - I will get a Dev board and see if I get different results. Could you configure your dev board in the meanwhile and let me know if you see a 12 bit stable reading?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I am using PE 10.4.0 with controller SKEAZN64MLC2 selected. &lt;/P&gt;&lt;P&gt;It is configured to use the internal oscillator 31.25khz with the trim values loaded.&lt;/P&gt;&lt;P&gt;FEI mode is used for an FLL output of 32Mhz and an ICS output clock of 8 MHz. The Core and Bus clocks are set to 8Mhz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 02:05:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334831#M15931</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-12-01T02:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334832#M15932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;I had encountered the similar issue when I used the PE component to generate the code for sampling the Bandgap value, and the Bandgap vaules were also variable just like you got.&lt;/P&gt;&lt;P&gt;The issue bothered me a lot. Finaly, I figured out this issue, the PE default don't enable the Bandgap buffer.&lt;/P&gt;&lt;P&gt;So I'd like to suggest that you'd better to check out the code that the PE 10.4.0 generated.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 07:01:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334832#M15932</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2014-12-01T07:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334833#M15933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ping,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As stated in the heading of the post, the bandgap buffer is enabled.&lt;/P&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;P&gt;My main() calls PE_low_level_init() and has the following code&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* PMC_SPMSC1: LVWACK=1,LVWIE=0,LVDRE=1,LVDSE=0,LVDE=1,??=0,BGBE=1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;PMC_SPMSC1&lt;/STRONG&gt; = (uint8_t)((PMC_SPMSC1 &amp;amp; (uint8_t)~(uint8_t)(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVWIE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDSE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x02U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )) | (uint8_t)(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVWACK_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDRE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMC_SPMSC1_LVDE_MASK |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;PMC_SPMSC1_BGBE_MASK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;/P&gt;&lt;P&gt;===========================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my previous readings, you can see that they are not random. &lt;/P&gt;&lt;P&gt;For the rail voltage of 5.3V, the counts of 0x0365-0x03B7 correspond to a bandgap voltage of 1.12-1.23V.&lt;/P&gt;&lt;P&gt;Note that temperature is constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added 1uF to the voltage rail and will repeat the measurements. If this is the expected precision at constant temperature I need to select an alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a paid option for support?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 23:53:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334833#M15933</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-12-02T23:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334834#M15934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;Sorry, I missed this important information in your first thread.&lt;/P&gt;&lt;P&gt;To be honest, I can't give the exactly answer about the vaule between the 0x0365~0x03B7 whether meet the precision of the bandgap in the S9KEAZN64AMLC now.&lt;/P&gt;&lt;P&gt;I think I need to contact with the AE team about this issue.&lt;/P&gt;&lt;P&gt;I'll inform you ASAP after I receive the reply from the AE team.&lt;BR /&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 09:11:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334834#M15934</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2014-12-03T09:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334835#M15935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One quick comment --- while the title talks about Accuracy, the content is all about reading-stability.&amp;nbsp; When it comes to accuracy, the on-chip reference is 'poor' at best.&amp;nbsp; For 70cents (REF3030, 0.2% 75ppm) to a buck-and-a-half (REF5030, 0.1% 8ppm), you will do MUCH better feeding VrefH from an external reference regulator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:12:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334835#M15935</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2014-12-03T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334836#M15936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The datasheet claims that the BG should be 1.14 to 1.18 for 5VDC at 125DegC. My parameters are 5.22VDC at 70DegF (21DegC).&lt;/P&gt;&lt;P&gt;That corresponds to 5 stable bits. I am seeing only 4 stable bits.&lt;/P&gt;&lt;P&gt;I also hoped that the spec range expressed a drift with temperature and not instability at 1 temperature. I have seen &amp;gt;8 bit stability on TIMSP430 and PIC16 parts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I added an extra 1uF (it was previously .1uF) across the rails and reference (pins 3,4 and 5,6) and the bandgap had the same performance. The other ADC readings had&lt;/P&gt;&lt;P&gt;only 3 LSB's changing which shows that the ADC configuration is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will use an alternative reference as suggested by Earl. The REF50xx series looks good or I may characterize my 5V rail over temperature and just use that. It seems to be 5.3V +- 2%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate the replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 17:56:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334836#M15936</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-12-03T17:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334837#M15937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're still mixing stability and accuracy here -- but the bottom line on accuracy is that said 1.14-1.18V range is still 1.16V+/-1.72%, at that ONE test value.&amp;nbsp; If you want any kind of real accuracy, the external REF30xx or 50xx is the way to go!&amp;nbsp; I look forward to some results!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 21:16:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334837#M15937</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2014-12-03T21:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334838#M15938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today, I do a test with TRK-KEA64 board with bandgap measurement.&lt;/P&gt;&lt;P&gt;My test result the ADC_R register value is&amp;nbsp; within [0x3bb ~ 0x3bf] range.&lt;/P&gt;&lt;P&gt;Below is my ADC initialization code, which I use slow ADCK clock and use long sample time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define TWELVE_BIT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;ADC_Init(23,TWELVE_BIT);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Configure ADC channel 3 in 8-bit resolution mode */&lt;/P&gt;&lt;P&gt;/***********************************************************************************************&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;* @brief&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_Init - Initiates the Channeln to read the value of the ADC channel&lt;/P&gt;&lt;P&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; Channel to init and resolution&lt;/P&gt;&lt;P&gt;* @return&amp;nbsp;&amp;nbsp; none&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;************************************************************************************************/&amp;nbsp; &lt;/P&gt;&lt;P&gt;void ADC_Init(UINT8 channel, UINT8 mode)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC |= SIM_SCGC_ADC_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable bus clock in ADC*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC3 |= ADC_SC3_ADICLK(0b00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Bus clock selected*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC2 |= 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Software Conversion trigger, disable compare function*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC2 |=ADC_SC2_REFSEL(0b01);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Select VDD and VSS as voltage reference source*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC1 = 0&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable ADC by setting ADCH bits as low*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC1|= ADC_SC1_ADCO_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Continuous mode operation */&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_APCTL1 |= ADC_APCTL1_ADPC(1&amp;lt;&amp;lt;channel);&amp;nbsp; /* Channel selection */&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC3 |= ADC_SC3_MODE(mode);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 8,10,12 bit mode operation */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_SC3 |= ADC_SC3_ADLSMP_MASK | ADC_SC3_ADICLK(1) |ADC_SC3_ADIV(3);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ADC module is using VDDA and VSSA as reference voltage. I measure the TRK-KEA63 VDDA voltage is about 4.88V.&lt;/P&gt;&lt;P&gt;Then, the measured Bandgap voltage is about 1.143V.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;BR /&gt;best regards &lt;BR /&gt;Ma Hui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 06:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334838#M15938</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2014-12-04T06:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Bandgap reading accuracy (bandgap is enabled in PMC)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334839#M15939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I took my previous settings&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sample time 3.5 clock periods&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Conversion time 48.48us&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ADC clock 412.5khz&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Conversion time 56.382us&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;And slowed down the Sample Time to 23.5 clock periods.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I then took 800 readings several times and observed a mean of 1.16 with std dev 0.01 (using my actual measured rail voltage of 5.2V).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I then calculated the number of readings over which I needed to take the mean.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks to all for the replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 16:09:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bandgap-reading-accuracy-bandgap-is-enabled-in-PMC/m-p/334839#M15939</guid>
      <dc:creator>ryanparasram</dc:creator>
      <dc:date>2014-12-05T16:09:29Z</dc:date>
    </item>
  </channel>
</rss>

