<?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>Processor Expert SoftwareのトピックRe: SPI with Multiple Devices (One is an SD Card)</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225395#M1129</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;/P&gt;&lt;P&gt;Where did you find the SD card demo based on the SPI?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jul 2014 18:35:45 GMT</pubDate>
    <dc:creator>danielchai</dc:creator>
    <dc:date>2014-07-02T18:35:45Z</dc:date>
    <item>
      <title>SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225390#M1124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developin my application with CW 10.4 and MQX 4.0.2 on my K60-base custom board.&lt;/P&gt;&lt;P&gt;I used SPIMaster_LDD in my BSP to communicate with 2 data-flash memories through SPI0 in Mode-3.&lt;/P&gt;&lt;P&gt;Now I was asked to add an SD card connected to the same SPI0 bus and to mount a file system on it.&lt;/P&gt;&lt;P&gt;I have 2 problem to face:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;For SD card the SPI0 bus must be configured in a different way (Mode-0 with different baud rate)&lt;/LI&gt;&lt;LI&gt;There is a MQX sample code for using MFS on a SD card with SPI, but that code is not based on a BSP library generated with Processor Expert, i.e. the demo uses the MQX IO SPI Driver.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I use MQX IO SPI driver in my BSP for all thedevices connected to the SPI0 bus?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 08:04:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225390#M1124</guid>
      <dc:creator>Vagni</dc:creator>
      <dc:date>2013-09-11T08:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225391#M1125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding using Filesystem, I don't know it there is a possibility to connect to MQX filesysten, but you can see this article that shows how to communicate with SD card and use File-system with Processor Expert on FRDM-KL25:&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/11/18/arduino-data-logger-shield-with-the-frdm-kl25z-board/" title="http://mcuoneclipse.com/2012/11/18/arduino-data-logger-shield-with-the-frdm-kl25z-board/"&gt;Arduino Data-Logger Shield with the FRDM-KL25Z Board | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 10:23:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225391#M1125</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2014-02-26T10:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225392#M1126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is another tutorial which uses SPI SD Card and W5100 on the same SPI bus:&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2014/01/07/frdm-with-arduino-ethernet-shield-r3-part-2-ping/" title="http://mcuoneclipse.com/2014/01/07/frdm-with-arduino-ethernet-shield-r3-part-2-ping/"&gt;FRDM with Arduino Ethernet Shield R3, Part 2: Ping | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 10:52:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225392#M1126</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-02-26T10:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225393#M1127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HI, I am very new to Freescale Kinetic microcontrollers. I am working on FRDM-k20d50m development board and trying to develop an application to interface two slaves on this development board. My requirement is to send data to 1st slave and then receive data from the same slave and then to deploy same operation on 2nd slave. If I am using one slave at a time and disconnect the other one then it works fine but if I connect two slaves the at same time I am not receiving any data from slave. The basic code to initiate SPI communication between two slaves is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;/* Below block of code writes/reads data from first slave*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; SM1_SelectConfiguration(SPI, ChipSelect, AttributeSet);&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; SM1_SendBlock(SPI, out_data, sizeof (out_data));&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; SM1_ReceiveBlock(SPI, &amp;amp;in_data, sizeof (in_data));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; /* Below block of code writes/reads data from second slave*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; SM1_SelectConfiguration(SPI, ChipSelect_1, AttributeSet_1);&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SM1_SendBlock(SPI, out_data, sizeof (out_data));&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SM1_ReceiveBlock(SPI, &amp;amp;in_data_1, sizeof (in_data_1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Please help me to make the communication possible with two slaves at the same time with proper toggling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 06:27:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225393#M1127</guid>
      <dc:creator>joginderrana</dc:creator>
      <dc:date>2014-03-31T06:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225394#M1128</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;I think there are two issues here:&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;1. You need to call ReceiveBlock first instead of what you have in your post, because the clock is generated after the transfer is performed. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Your code does not wait for the result. Please note that the component methods do not wait for the operation to end, the transfer just puts the value to the HW output buffer. You can use SM1_GetBlockReceivedStatus method for checking that the data are completely sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should look like this:&lt;/P&gt;&lt;P&gt;Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */&lt;/P&gt;&lt;P&gt;Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE); /* Start transmission/reception */&lt;/P&gt;&lt;P&gt;while (!SM1_GetBlockReceivedStatus(MySPIPtr)) {}; // wait for the transaction to finish&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;You can find examples at the Typical usage page of the SPIMaster_LDD component help which you can get using the pop-up menu command "Help on component"&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 10:06:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225394#M1128</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2014-04-02T10:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with Multiple Devices (One is an SD Card)</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225395#M1129</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;/P&gt;&lt;P&gt;Where did you find the SD card demo based on the SPI?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 18:35:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-with-Multiple-Devices-One-is-an-SD-Card/m-p/225395#M1129</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-07-02T18:35:45Z</dc:date>
    </item>
  </channel>
</rss>

