<?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>Kinetis MicrocontrollersのトピックUnderstanding Programmable Delay Block (PDB) details</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775277#M47166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a MK66FX1M0VMD18 chip from NXP/Freescale and was trying to understand/confirm my understanding of the PDB in more detail. Sorry if I am asking something obvious. (Since there is just one PDB in this chip, I'll use PDB0 instead of PDBx for the identifier names.)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Interrupts are generated at the expected frequency, when I set the frequency of the PDB clock using the PRESCALER and MULT fields in the PDB0_SC register, then set the PDB0_MOD register to the desired modulus to divide this clock even finer, and also set PDB_SC_PDBIE.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now what I do not understand exactly is the functioning of the PDB0_IDLY register. As far as I understood the internal counter of the PDB (PDB0_CNT) is incremented at each PDB clock tick, and the PDB clock is generated from the peripheral frequency divided by the prescaler divider (which itself is set by MULT and PRESCALER).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PDB0_MOD sets the modulus for the PDB0_CNT, so when PDB0_CNT reaches this value, PDB0_CNT resets to zero and the interrupt/dma request is triggered. PDB0_IDLY determines at which value of PDB0_CNT the interrupt or dma request is triggered.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In pseudocode:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;at_every_PDB_clock_tick&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PDB0_CNT &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; PDB0_MOD &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CNT &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PDB0_CNT &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; PDB0_IDLY&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;trigger_interrupt_or_DMA_request&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CNT&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;If anything is wrong so far, please correct me (in pseudocode would be great, to have it clearer than using just language). For example, I am not sure if the interrupt/dma gets triggered already at the start, or only after the PDB0_CNT cycled once at least. So, assume PDB0_MOD = 9 and PDB0_IDLY = 0: would it already trigger an interrupt immediately when the PDB is started, and the counter PDB0_CNT had no time to increment yet? Or would it wait until the PDB0 counter is reset to zero again due to having completed one cycle as defined by PDB0_MOD?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A related question: in the documentation, for example page 1116, the following is said&amp;nbsp; "Reading this field returns the value of internal register that is effective for the current cycle of the PDB.". Is the mentioned cycle the cycle PDB0_CNT does, from 0 to PDB0_MOD?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Which leads me to my final question. If all of the above is true, you can change PDB0_IDLY in the current cycle, and it will only be applied in the next cycle? You could do PWM this way with a stable frequency, but variable duty cycle.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you made it this far, thanks for your patience &lt;IMG alt="Smiley Wink" class="emoticon emoticon-smileywink" id="smileywink" src="https://community.nxp.com/i/smilies/16x16_smiley-wink.png" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 14:07:52 GMT</pubDate>
    <dc:creator>maelh</dc:creator>
    <dc:date>2020-11-02T14:07:52Z</dc:date>
    <item>
      <title>Understanding Programmable Delay Block (PDB) details</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775277#M47166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a MK66FX1M0VMD18 chip from NXP/Freescale and was trying to understand/confirm my understanding of the PDB in more detail. Sorry if I am asking something obvious. (Since there is just one PDB in this chip, I'll use PDB0 instead of PDBx for the identifier names.)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Interrupts are generated at the expected frequency, when I set the frequency of the PDB clock using the PRESCALER and MULT fields in the PDB0_SC register, then set the PDB0_MOD register to the desired modulus to divide this clock even finer, and also set PDB_SC_PDBIE.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now what I do not understand exactly is the functioning of the PDB0_IDLY register. As far as I understood the internal counter of the PDB (PDB0_CNT) is incremented at each PDB clock tick, and the PDB clock is generated from the peripheral frequency divided by the prescaler divider (which itself is set by MULT and PRESCALER).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PDB0_MOD sets the modulus for the PDB0_CNT, so when PDB0_CNT reaches this value, PDB0_CNT resets to zero and the interrupt/dma request is triggered. PDB0_IDLY determines at which value of PDB0_CNT the interrupt or dma request is triggered.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In pseudocode:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;at_every_PDB_clock_tick&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PDB0_CNT &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; PDB0_MOD &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CNT &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PDB0_CNT &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; PDB0_IDLY&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;trigger_interrupt_or_DMA_request&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CNT&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;If anything is wrong so far, please correct me (in pseudocode would be great, to have it clearer than using just language). For example, I am not sure if the interrupt/dma gets triggered already at the start, or only after the PDB0_CNT cycled once at least. So, assume PDB0_MOD = 9 and PDB0_IDLY = 0: would it already trigger an interrupt immediately when the PDB is started, and the counter PDB0_CNT had no time to increment yet? Or would it wait until the PDB0 counter is reset to zero again due to having completed one cycle as defined by PDB0_MOD?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A related question: in the documentation, for example page 1116, the following is said&amp;nbsp; "Reading this field returns the value of internal register that is effective for the current cycle of the PDB.". Is the mentioned cycle the cycle PDB0_CNT does, from 0 to PDB0_MOD?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Which leads me to my final question. If all of the above is true, you can change PDB0_IDLY in the current cycle, and it will only be applied in the next cycle? You could do PWM this way with a stable frequency, but variable duty cycle.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you made it this far, thanks for your patience &lt;IMG alt="Smiley Wink" class="emoticon emoticon-smileywink" id="smileywink" src="https://community.nxp.com/i/smilies/16x16_smiley-wink.png" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:07:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775277#M47166</guid>
      <dc:creator>maelh</dc:creator>
      <dc:date>2020-11-02T14:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Programmable Delay Block (PDB) details</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775278#M47167</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;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTaskerADC.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerADC.pdf&lt;/A&gt;&lt;SPAN&gt; - page 9, which may help clarify something.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K66:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K65F180M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K65F180M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-K66F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K66F.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTEENSY_3.6.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_3.6.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Free Open Source solution: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FuTasker%2FuTasker-Kinetis" rel="nofollow" target="_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Working project in 15 minutes video: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fyoutu.be%2FK8ScSgpgQ6M" rel="nofollow" target="_blank"&gt;https://youtu.be/K8ScSgpgQ6M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fsupport.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/support.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 22:58:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775278#M47167</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-31T22:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Programmable Delay Block (PDB) details</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775279#M47168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I am still not clear about all the details, as they aren't mentioned explicitly, but your document helped clear up some terms.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2018 02:04:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Understanding-Programmable-Delay-Block-PDB-details/m-p/775279#M47168</guid>
      <dc:creator>maelh</dc:creator>
      <dc:date>2018-02-05T02:04:41Z</dc:date>
    </item>
  </channel>
</rss>

