<?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-calibrating ADC after start up in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Re-calibrating-ADC-after-start-up/m-p/1026345#M56379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an MKE18F512VLH16 MCU at 250MHz.&amp;nbsp; I have a set up where I use eDMA to collect samples from the ADC, and stuff them into an array for processing later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calibrate the ADC at least once on every start up using the auto calibration function.&amp;nbsp; However, it would be beneficial if I could manually update the cal coefficients while the system is running.&amp;nbsp; I have a function that will receive these coefficients over a CAN bus, and writes the values into the registers.&lt;SPAN&gt;&amp;nbsp; After I receive the values that need to be written, I put them through a range check.&amp;nbsp; If they pass the check, I commit them to the ADC.&amp;nbsp; Currently the registers that I am writing to are:&amp;nbsp; CLPS, CLP0, CLP1,&amp;nbsp;&lt;SPAN&gt;CLP2,&amp;nbsp;CLP3,&amp;nbsp;CLP9, CLPX, OFS, and G.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am simply just writing to the registers, and letting the system resume its normal actions.&amp;nbsp; However, when I try writing to the registers, the system does not behave correctly.&amp;nbsp; Without getting too much into the nitty gritty details of the code, the DMA channel that collects the ADC samples is supposed to interrupt after so many samples are collected.&amp;nbsp; This is where I run into issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am wondering if simply writing to registers and resuming normal operations is sufficient enough for re-calibrating the ADC?&amp;nbsp; If there is a guide that I can use to help me with this, that would also be helpful.&amp;nbsp; I have read App Note 2989(Design, Accuracy, and Calibration of Analog to Digital Converters on the MPC5500 Family), and App Note 5314(ADC Calibration on Kinetis E+ Microcontrollers).&amp;nbsp; Didn't really get too much out of it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated.&amp;nbsp; Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Feb 2020 01:06:16 GMT</pubDate>
    <dc:creator>sean_dvorscak</dc:creator>
    <dc:date>2020-02-01T01:06:16Z</dc:date>
    <item>
      <title>Re-calibrating ADC after start up</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Re-calibrating-ADC-after-start-up/m-p/1026345#M56379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an MKE18F512VLH16 MCU at 250MHz.&amp;nbsp; I have a set up where I use eDMA to collect samples from the ADC, and stuff them into an array for processing later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calibrate the ADC at least once on every start up using the auto calibration function.&amp;nbsp; However, it would be beneficial if I could manually update the cal coefficients while the system is running.&amp;nbsp; I have a function that will receive these coefficients over a CAN bus, and writes the values into the registers.&lt;SPAN&gt;&amp;nbsp; After I receive the values that need to be written, I put them through a range check.&amp;nbsp; If they pass the check, I commit them to the ADC.&amp;nbsp; Currently the registers that I am writing to are:&amp;nbsp; CLPS, CLP0, CLP1,&amp;nbsp;&lt;SPAN&gt;CLP2,&amp;nbsp;CLP3,&amp;nbsp;CLP9, CLPX, OFS, and G.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am simply just writing to the registers, and letting the system resume its normal actions.&amp;nbsp; However, when I try writing to the registers, the system does not behave correctly.&amp;nbsp; Without getting too much into the nitty gritty details of the code, the DMA channel that collects the ADC samples is supposed to interrupt after so many samples are collected.&amp;nbsp; This is where I run into issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am wondering if simply writing to registers and resuming normal operations is sufficient enough for re-calibrating the ADC?&amp;nbsp; If there is a guide that I can use to help me with this, that would also be helpful.&amp;nbsp; I have read App Note 2989(Design, Accuracy, and Calibration of Analog to Digital Converters on the MPC5500 Family), and App Note 5314(ADC Calibration on Kinetis E+ Microcontrollers).&amp;nbsp; Didn't really get too much out of it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated.&amp;nbsp; Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Feb 2020 01:06:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Re-calibrating-ADC-after-start-up/m-p/1026345#M56379</guid>
      <dc:creator>sean_dvorscak</dc:creator>
      <dc:date>2020-02-01T01:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re-calibrating ADC after start up</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Re-calibrating-ADC-after-start-up/m-p/1026346#M56380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="350911" data-username="sean.dvorscak@craneae.com" href="https://community.nxp.com/people/sean.dvorscak@craneae.com"&gt;Sean Dvorscak&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calibrate the ADC manually you can follow these steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Calibrate only one ADC instance&amp;nbsp; at a time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Set ADC clk to half the maximum specified frequency&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Clear CLPS, CLP3 CLP2, CLP1, CLP0,CLPX and CLP9 registers by writing 0x0 into them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Write 0x87 into ADC_SC3 register (This will set CAL=1b, AVGE=1b and AVGS=11b)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Wait calibration to finish in the COCO field of ADC_SC1 register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When CAL=1, the ADC begins the calibration sequence and writes to the other registers automatically. After this you can restore your ADC configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Omar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 18:47:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Re-calibrating-ADC-after-start-up/m-p/1026346#M56380</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2020-02-06T18:47:10Z</dc:date>
    </item>
  </channel>
</rss>

