<?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>CodeWarrior Development ToolsのトピックRe: SPI interrupt happens twice</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/SPI-interrupt-happens-twice/m-p/265605#M326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The processor has only one handler for all SPI0 and one for all SPI1 interrupts.&lt;/P&gt;&lt;P&gt;There are several possible sources of SPI0 interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- End of Queue reached (EOQF)&lt;/P&gt;&lt;P&gt;- TX FIFO is not full (TFFF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Transfer of current frame complete (TCF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Attempt to transmit with an empty Transmit FIFO (TFUF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;RX FIFO is not empty (RFDF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Frame received while Receive FIFO is full (RFOF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;They are enabled by the SPI0_RSER register. You probably have two interrupts enabled (for example TCF and RFDF).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to check register SPI0_RSER to see which interrupts are enabled and register&amp;nbsp;SPI0_SR to see which conditions have caused the interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Dec 2018 14:34:11 GMT</pubDate>
    <dc:creator>Ray_V</dc:creator>
    <dc:date>2018-12-13T14:34:11Z</dc:date>
    <item>
      <title>SPI interrupt happens twice</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/SPI-interrupt-happens-twice/m-p/265604#M325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have MK10DN512Z VLL10 with a bareboard project that has PE attached to it.&lt;/P&gt;&lt;P&gt;I have my SPI0 as my slave and sending data to it from outside.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1- I am not sure why the interrupt event "SlaveSPI0_OnBlockReceived" happens twice when I send data!&lt;/P&gt;&lt;P&gt;What I did, every time that I receive a 4 block data (each block is 16 bits), I see that the first time interrupt happens, and so I get the 4 block, but the second time that interrupt happens I don't have anything to pick and so it sends zeros only! But I only send 4 blocks from my master. I don't send 8 blocks at all.&lt;/P&gt;&lt;P&gt;Another thing I did in my interrupt event I flush the RX to make sure overflow is not a problem:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void SlaveSPI0_OnBlockReceived(LDD_TUserData *UserDataPtr)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; printf("==========ISR event: SPI0 receive a block=========\n");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; if ((IO_READ32(Rx0SPI0)) != 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; print_RX_FIFO();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; inbuff = (IO_READ32(Rx0SPI0)&amp;lt;&amp;lt;16);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; inbuff |= IO_READ32(Rx1SPI0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; extended_inbuff = (IO_READ32(Rx2SPI0)&amp;lt;&amp;lt;16);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; extended_inbuff |= IO_READ32(Rx3SPI0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; }&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; RX_FIFO_flush();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; TX_FIFO_flush();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; DataReceiveFlagSlave1 = TRUE;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and this is what I see in my shell:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;==========ISR event: SPI0 receive a block========= (THIS IS FIRST TIME)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SR_SPI0 = 0x3344&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RX0 = 0x1122&amp;nbsp;&amp;nbsp;&amp;nbsp; RX1 = 0x3344&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RX2 = 0x5566&amp;nbsp;&amp;nbsp;&amp;nbsp; RX3 = 0x7788&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;==========ISR event: SPI0 receive a block========= (THIS IS SECOND TIME, HUH!!!)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2- I also looked into SPI0 Interrupt vector at address: 0xA8 and also the normal interrupt at address 0x84. I see that the values inside these vectors do not change, which is surprising to me!!! I expect these values change! Where can I look into what register or vector to see what is triggering the second interrupt?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 23:03:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/SPI-interrupt-happens-twice/m-p/265604#M325</guid>
      <dc:creator>mehdikarimibiuk</dc:creator>
      <dc:date>2014-02-27T23:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: SPI interrupt happens twice</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/SPI-interrupt-happens-twice/m-p/265605#M326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The processor has only one handler for all SPI0 and one for all SPI1 interrupts.&lt;/P&gt;&lt;P&gt;There are several possible sources of SPI0 interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- End of Queue reached (EOQF)&lt;/P&gt;&lt;P&gt;- TX FIFO is not full (TFFF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Transfer of current frame complete (TCF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Attempt to transmit with an empty Transmit FIFO (TFUF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;RX FIFO is not empty (RFDF)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Frame received while Receive FIFO is full (RFOF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;They are enabled by the SPI0_RSER register. You probably have two interrupts enabled (for example TCF and RFDF).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to check register SPI0_RSER to see which interrupts are enabled and register&amp;nbsp;SPI0_SR to see which conditions have caused the interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2018 14:34:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/SPI-interrupt-happens-twice/m-p/265605#M326</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2018-12-13T14:34:11Z</dc:date>
    </item>
  </channel>
</rss>

