<?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中的主题 Re: Problem with SPI interrupt</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343581#M16675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durgesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you are using PE generated code as a base for the operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This tends to be very simply code that just gives you a starting point by writing a flag when an interrupt occurs. If you want it to be more intelligent and recognise the completion of a block of data you will probably need to modify the interrupt routine to count the interrupts that occur and compare with the amount of data bytes originally sent and then set the flag only when they match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note also that you should be checking the busy state of SPI Flash between writing and reading since the chip will require some time to complete write operations.&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;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 16:32:03 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2015-01-14T16:32:03Z</dc:date>
    <item>
      <title>Problem with SPI interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343580#M16674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my code, I need to write data into flash, which is interfaced to my KL26Z through SPI.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;error = SM0_SendBlock(masterDevData, (LDD_TData*)Data,Number_Of_Bytes);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(error !=ERR_OK)&lt;/P&gt;&lt;P&gt;return SLLD_ERROR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error = SM0_ReceiveBlock(masterDevData, (LDD_TData*)dummyBuffer,&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Number_Of_Bytes&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;if(error!=ERR_OK)&lt;/P&gt;&lt;P&gt;return SLLD_ERROR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(Tx_CompleteFlag==0);&lt;/P&gt;&lt;P&gt;Tx_CompleteFlag=0;&lt;/P&gt;&lt;P&gt;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am setting Tx_CompleteFlag in SPI_OnBlockSent event in Events.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement needs Tx_CompleteFlag to be set after transmission of Number_Of_Bytes mentioned above. But I am getting interrupt after tx of only a single character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any of you know the solution kindly reply me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Durgesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 10:22:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343580#M16674</guid>
      <dc:creator>durgeshtanuku</dc:creator>
      <dc:date>2015-01-14T10:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SPI interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343581#M16675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durgesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you are using PE generated code as a base for the operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This tends to be very simply code that just gives you a starting point by writing a flag when an interrupt occurs. If you want it to be more intelligent and recognise the completion of a block of data you will probably need to modify the interrupt routine to count the interrupts that occur and compare with the amount of data bytes originally sent and then set the flag only when they match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note also that you should be checking the busy state of SPI Flash between writing and reading since the chip will require some time to complete write operations.&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;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 16:32:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343581#M16675</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-14T16:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SPI interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343582#M16676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durgesh,&lt;/P&gt;&lt;P&gt;The transmit interrupt is triggered by the either SPI transmit buffer empty flag ( when FIFO is not supported or not enabled ) or SPI transmit FIFO empty flag ( when FIFO is supported and enabled ),&lt;/P&gt;&lt;P&gt;So you can't get the code by PE which can active a interrupt after the accomplishment of transfer the number of bytes you defined, and as the Mark suggested,&lt;/P&gt;&lt;P&gt;I think you need to modify the original code that PE created to work it out.&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>Thu, 15 Jan 2015 07:44:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343582#M16676</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-01-15T07:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SPI interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343583#M16677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;If the interrupt is occuring after exactly one character, I could use the the logic you have suggested. But today I have observed that as I am changing the SPI clock rate, The interrupt is occuring at different intervals for different SPI frequencies irrespective of number of transmitted characters. Some times after getting the interrupt, I could not even see the tx data on logic analyser&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 11:16:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SPI-interrupt/m-p/343583#M16677</guid>
      <dc:creator>durgeshtanuku</dc:creator>
      <dc:date>2015-01-15T11:16:50Z</dc:date>
    </item>
  </channel>
</rss>

