<?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: I2C DMA Slave Transmitter in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415770#M1990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin Leclerc:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is not an interrupt to detect the reception of NAK, but there is an interrupt for the detection of the I2C bus STOP condition. Would that work for you?&lt;/P&gt;&lt;P&gt;I suppose your I2C master device would trigger the stop signal when receiving the last byte expected from the KL17 slave.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&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, 20 Nov 2015 03:30:28 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-11-20T03:30:28Z</dc:date>
    <item>
      <title>I2C DMA Slave Transmitter</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415769#M1989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I am trying to improve the performance of my I2C slave driver by using the DMA mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The board is design with a KL17 MCU.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the I2C Slave is transmitting data, the DMA option 'Cycle-Steal' is activated.&lt;/P&gt;&lt;P&gt;And when the DMA channel counter reach zero, an interrupt is generated.&lt;/P&gt;&lt;P&gt;So far it's working as expected.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the Slave doesn’t know in advance how many data bytes are to be transmitted to the master device.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;And all the regular I2C interrupt seems to be disabled when the DMA is activated with the mode 'Cycle-Steal'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to have an interrupt to detect the end of transfer (NAK) when the 'Cycle Steal' mode is activated ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only solution I found so far is by polling the I2C status register for RXAK with a While loop.&lt;/P&gt;&lt;P&gt;I want to free my CPU as much as possible, this is why the polling mechanism is not a good solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 20:42:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415769#M1989</guid>
      <dc:creator>martinleclerc</dc:creator>
      <dc:date>2015-11-16T20:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: I2C DMA Slave Transmitter</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415770#M1990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin Leclerc:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is not an interrupt to detect the reception of NAK, but there is an interrupt for the detection of the I2C bus STOP condition. Would that work for you?&lt;/P&gt;&lt;P&gt;I suppose your I2C master device would trigger the stop signal when receiving the last byte expected from the KL17 slave.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&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, 20 Nov 2015 03:30:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415770#M1990</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-11-20T03:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: I2C DMA Slave Transmitter</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415771#M1991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge, The I2C bus STOP condition is exactly the solution that I am looking for.&lt;/P&gt;&lt;P&gt;I can confirm that when I2C interrupt are enabled, the STOP condition is detected properly.&lt;/P&gt;&lt;P&gt;I am also able to detect all other interrupts like START, TCF (Transfer Complete), ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, when the DMA interrupt is activated with the mode `Cycle Steal` &lt;/P&gt;&lt;P&gt;the only interrupt generated is when the DMA channel counter reach zero.&lt;/P&gt;&lt;P&gt;All other I2C interrupts including the STOP condition are not generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main suspect is the mode "Cycle Steal".&lt;/P&gt;&lt;P&gt;It looks like this mode can be used only when you know exactly the length (number of bytes) to be transmitted.&lt;/P&gt;&lt;P&gt;Otherwise it's not a good solution when you don't know in advance how many bytes are to be transmitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 14:15:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415771#M1991</guid>
      <dc:creator>martinleclerc</dc:creator>
      <dc:date>2015-11-23T14:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: I2C DMA Slave Transmitter</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415772#M1992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;Having random length transfers on a slave serial communications peripheral will make using the DMA challenging.&amp;nbsp; The I2C peripheral can generate either an interrupt or a DMA service request, but not both.&amp;nbsp; I have discussed this scenario with several other engineers in the past.&amp;nbsp; The most common resolution involves linking a second DMA channel that is configured to reset a hardware timeout.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;As an example, the Low Power Timer (LPTMR) can be configured to function as this I2C timeout by setting up its prescale and compare registers accordingly.&amp;nbsp; The LPTMR’s counter is reset when it’s disabled, counts up when it’s enabled and can generate an interrupt when the counter’s value equals that of its compare register.&amp;nbsp; The second DMA channel can be configured to perform sequential transfers (i.e., continuous operation, not cycle-steal) to the LPTMR’s Control Status Register that will disable it (thereby resetting the counter) and then re-enable it.&amp;nbsp; Once there is a long enough pause by the I2C master – i.e., I2C transfers have stopped – the LPTMR will generate an interrupt indicating that the transfer is finished.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;This technique relies upon knowing that the I2C transfers are continuous and that a proper timeout value can be used.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;Please let me know if this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12pt; font-family: 'Times New Roman', serif; color: #222222;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #0070c0;"&gt;Derrick&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 12:59:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-DMA-Slave-Transmitter/m-p/415772#M1992</guid>
      <dc:creator>martinleclerc</dc:creator>
      <dc:date>2015-12-01T12:59:52Z</dc:date>
    </item>
  </channel>
</rss>

