<?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 modified methods for SPI module in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/modified-methods-for-SPI-module/m-p/265727#M327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have MK10DN512Z VLL10 and using bareboard in codewarrior with PE attached.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to use SendBlock and ReceiveBlock methods that PE generates for SPI, because, with these methods I have to tell what is the size of my data, and since I am slave I cannot tell what is the size. Sometimes, master sends me 1 block (16bits), sometimes 2 blocks (32bits) and sometimes 4 blocks (64bits).&lt;/P&gt;&lt;P&gt;This is my SPI0 setup in PE (SPI0 is as slave):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9976_9976.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119729i64072072D11888F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9976_9976.png" alt="9976_9976.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="spi0.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42912iBB199F7CAEDBA100/image-size/large?v=v2&amp;amp;px=999" role="button" title="spi0.PNG.png" alt="spi0.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;No since I did not used those SPI PE methods (SendBlock and ReceiveBlock), I created my owen in the interrupt event and also modified the ISR as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9984_9984.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119730iDF33115D989EC9B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9984_9984.png" alt="9984_9984.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="isr1.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42913i1D8B6B55F176095B/image-size/large?v=v2&amp;amp;px=999" role="button" title="isr1.PNG.png" alt="isr1.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9983_9983.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119731i198F49AEB0640A60/image-size/large?v=v2&amp;amp;px=999" role="button" title="9983_9983.png" alt="9983_9983.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="isr2.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42914i5C2A0FB75765EC5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="isr2.PNG.png" alt="isr2.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and also here is my onBlockReceived:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9985_9985.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119732i95B48E9034BE15B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9985_9985.png" alt="9985_9985.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="received spi.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42915i42A96CBDBB96355D/image-size/large?v=v2&amp;amp;px=999" role="button" title="received spi.PNG.png" alt="received spi.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this works fine unless for the time that I receive two interrupt events for every 2 and 4 block (32bits and 64bits) sendings. I don't know why?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One possible solution I was thinking is maybe I can go back to using SendBlock and ReceiveBlock functions provided by PE and use them in onBlockReceived event method, but for that I need to know the size that I am receiving? Is there any smart way for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 23:35:46 GMT</pubDate>
    <dc:creator>mehdikarimibiuk</dc:creator>
    <dc:date>2014-02-27T23:35:46Z</dc:date>
    <item>
      <title>modified methods for SPI module</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/modified-methods-for-SPI-module/m-p/265727#M327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have MK10DN512Z VLL10 and using bareboard in codewarrior with PE attached.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to use SendBlock and ReceiveBlock methods that PE generates for SPI, because, with these methods I have to tell what is the size of my data, and since I am slave I cannot tell what is the size. Sometimes, master sends me 1 block (16bits), sometimes 2 blocks (32bits) and sometimes 4 blocks (64bits).&lt;/P&gt;&lt;P&gt;This is my SPI0 setup in PE (SPI0 is as slave):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9976_9976.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119729i64072072D11888F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9976_9976.png" alt="9976_9976.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="spi0.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42912iBB199F7CAEDBA100/image-size/large?v=v2&amp;amp;px=999" role="button" title="spi0.PNG.png" alt="spi0.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;No since I did not used those SPI PE methods (SendBlock and ReceiveBlock), I created my owen in the interrupt event and also modified the ISR as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9984_9984.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119730iDF33115D989EC9B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9984_9984.png" alt="9984_9984.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="isr1.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42913i1D8B6B55F176095B/image-size/large?v=v2&amp;amp;px=999" role="button" title="isr1.PNG.png" alt="isr1.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9983_9983.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119731i198F49AEB0640A60/image-size/large?v=v2&amp;amp;px=999" role="button" title="9983_9983.png" alt="9983_9983.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="isr2.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42914i5C2A0FB75765EC5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="isr2.PNG.png" alt="isr2.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and also here is my onBlockReceived:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9985_9985.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119732i95B48E9034BE15B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="9985_9985.png" alt="9985_9985.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="received spi.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42915i42A96CBDBB96355D/image-size/large?v=v2&amp;amp;px=999" role="button" title="received spi.PNG.png" alt="received spi.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this works fine unless for the time that I receive two interrupt events for every 2 and 4 block (32bits and 64bits) sendings. I don't know why?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One possible solution I was thinking is maybe I can go back to using SendBlock and ReceiveBlock functions provided by PE and use them in onBlockReceived event method, but for that I need to know the size that I am receiving? Is there any smart way for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 23:35:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/modified-methods-for-SPI-module/m-p/265727#M327</guid>
      <dc:creator>mehdikarimibiuk</dc:creator>
      <dc:date>2014-02-27T23:35:46Z</dc:date>
    </item>
  </channel>
</rss>

