<?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のトピックKV58 SPI communication</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008573#M56045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am using KV58 SPI to read and write SPI SRAM(IS62WVS2568).&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am following&amp;nbsp;the sample code "dspi_polling_b2b_transfer_master" to poll the mode register, but I can't get 0x40(default) when I send the command = 0x05.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am using PCS1 for SRAM, PCS0 for SPI flash. Both are not working...&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;1) When I choose PCS1 with low active, and I can see PCS0 is LOW. Do I need to configure PCS0 to HIGH? How about other PCS2~~5 on SPI0? For now, I configure PCS2~~5 as input GPIO. Do I need to configure them as well?&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;2) When I read, I always get 0x00 as return.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Nov 2019 16:50:31 GMT</pubDate>
    <dc:creator>a8Chcx</dc:creator>
    <dc:date>2019-11-05T16:50:31Z</dc:date>
    <item>
      <title>KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008573#M56045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am using KV58 SPI to read and write SPI SRAM(IS62WVS2568).&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am following&amp;nbsp;the sample code "dspi_polling_b2b_transfer_master" to poll the mode register, but I can't get 0x40(default) when I send the command = 0x05.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I am using PCS1 for SRAM, PCS0 for SPI flash. Both are not working...&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;1) When I choose PCS1 with low active, and I can see PCS0 is LOW. Do I need to configure PCS0 to HIGH? How about other PCS2~~5 on SPI0? For now, I configure PCS2~~5 as input GPIO. Do I need to configure them as well?&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;2) When I read, I always get 0x00 as return.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2019 16:50:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008573#M56045</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2019-11-05T16:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008574#M56046</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 am trying to configure PCSx signal as GPIO, and set to LOW during sending and receiving, set to HIGH after finishing.&lt;/P&gt;&lt;P&gt;Then I can get the right response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell where I need to change the configuration if I still use PCSx?&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;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2019 16:03:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008574#M56046</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2019-11-06T16:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008575#M56047</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 am trying to communicate with FXOS8700 over SPI and got the same result.&lt;/P&gt;&lt;P&gt;I have to control PCSx manually. Otherwise, I can't communicate with FXOS8700.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me where the problem is and how to fix it?&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;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2019 14:32:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008575#M56047</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2019-11-07T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008576#M56048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Christie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for any inconveniences, could you provide, in code example, the steps you are following to configure the PCSx pins for the&amp;nbsp; dspi driver. We will try to replicate the problem.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Diego&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2019 23:45:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008576#M56048</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2019-11-11T23:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008577#M56049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Diego,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is from my pin_mux for SPI0:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am using the following sample code, I can't receive the data properly. But if I change the PCS0 and PCS1 as GPIO, Set to LOW before transfer and Set to HIGH after transfer, everythinh is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I tried on several devices, SPI flash, SPI SRAM, and FXOS8700, they are the same result...&lt;/P&gt;&lt;P&gt;2) I checked PCS0 and PCS1, LOW and HIGH changes look fine as well even if I use PCS0 or PCS1...&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;Christie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;//-----*****Configure SPI0 for SPI devices*****-----&lt;/P&gt;&lt;P&gt;&amp;nbsp;PORT_SetPinMux(PORTC, PIN3_IDX, kPORT_MuxAlt2); /* V5.1(IS62_CS) &amp;amp; V5.0(RX1)---PORTC3 (pin 106) is configured as SPI0_PCS1 */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; //PORT_SetPinMux(PORTC, PIN3_IDX, &lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;kPORT_MuxAsGpio&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* V5.1(IS62_CS) &amp;amp; V5.0(RX1)---PORTC3 (pin 106) is configured as SPI0_PCS1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;PORT_SetPinMux(PORTC, PIN4_IDX, kPORT_MuxAlt2); /* V5.1(IS25_CS) &amp;amp; V5.0(TX1)---PORTC4 (pin 109) is configured as SPI0_PCS0 */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; //PORT_SetPinMux(PORTC, PIN4_IDX, &lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;kPORT_MuxAsGpio&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* V5.1(IS25_CS) &amp;amp; V5.0(TX1)---PORTC4 (pin 109) is configured as SPI0_PCS0 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; PORT_SetPinMux(PORTC, PIN5_IDX, &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: small; "&gt;kPORT_MuxAlt2&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* V5.1(DCLK) &amp;amp; V5.0(INX2)---PORTC5 (pin 110) is configured as SPI0_SCK */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; PORT_SetPinMux(PORTC, PIN6_IDX, &lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;kPORT_MuxAlt2&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* V5.1(DATA_OUT) &amp;amp; V5.0(INX3)---PORTC6 (pin 111) is configured as SPI0_SOUT */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; PORT_SetPinMux(PORTC, PIN7_IDX, &lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: small; "&gt;kPORT_MuxAlt2&lt;/EM&gt;&lt;SPAN style="font-size: small;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* V5.1(DATA_IN) &amp;amp; V5.0(INX4)---PORTC7 (pin 112) is configured as SPI0_SIN */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;Here is the code from sample code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Master config&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;masterConfig.whichCtar = kDSPI_Ctar0;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.baudRate = FLASH_RAM_TRANSFER_BAUDRATE;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.bitsPerFrame = 8U;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.cpol = kDSPI_ClockPolarityActiveHigh;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.cpha = kDSPI_ClockPhaseFirstEdge;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.direction = kDSPI_MsbFirst;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.pcsToSckDelayInNanoSec = 1000000000U / FLASH_RAM_TRANSFER_BAUDRATE;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.lastSckToPcsDelayInNanoSec = 1000000000U / FLASH_RAM_TRANSFER_BAUDRATE;&lt;/P&gt;&lt;P&gt;masterConfig.ctarConfig.betweenTransferDelayInNanoSec = 1000000000U / FLASH_RAM_TRANSFER_BAUDRATE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&amp;nbsp;masterConfig.whichPcs = kDSPI_Pcs0; // FOX8700//EXAMPLE_DSPI_MASTER_PCS_FOR_INIT;&lt;/P&gt;&lt;P&gt;// masterConfig.whichPcs = kDSPI_Pcs1; // IS62/65 SRAM---PCS1//EXAMPLE_DSPI_MASTER_PCS_FOR_INIT;&lt;/P&gt;&lt;P&gt;masterConfig.whichPcs = kDSPI_Pcs0; // IS25W Flash---PCS0//EXAMPLE_DSPI_MASTER_PCS_FOR_INIT;&lt;/P&gt;&lt;P&gt;masterConfig.whichPcs = FLASH_DSPI0_MASTER_PCS_FOR_INIT;&lt;/P&gt;&lt;P&gt;masterConfig.whichPcs |= 0x3F; // I have to add this to keep other PCS1 HIGH???&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; masterConfig.pcsActiveHighOrLow = kDSPI_PcsActiveLow; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;// ==1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;masterConfig.enableContinuousSCK = false;&lt;/P&gt;&lt;P&gt;masterConfig.enableRxFifoOverWrite = false;&lt;/P&gt;&lt;P&gt;masterConfig.enableModifiedTimingFormat = false;&lt;/P&gt;&lt;P&gt;masterConfig.samplePoint = kDSPI_SckToSin0Clock;　&lt;/P&gt;&lt;P&gt;srcClock_Hz = unint32_temp0 = FLASH_RAM_DSPI0_MASTER_CLK_FREQ;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//PRINTF("\r\n\r\nDSPI board to board polling example=%d_%d_%d_%d\r\n", FLASH_RAM_DSPI0_MASTER_CLK_FREQ, unint32_temp0, FLASH_RAM_TRANSFER_BAUDRATE, (1000000000U / FLASH_RAM_TRANSFER_BAUDRATE));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DSPI_MasterInit(EXAMPLE_DSPI_MASTER_BASEADDR, &amp;amp;masterConfig, srcClock_Hz);&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;masterTxData[0] = 0x05; // Read Mode Register&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;masterTxData[1] = DSPI_DUMMY_DATA; //0x00; // Read Mode Register&lt;/P&gt;&lt;P&gt;masterTxData[2] = DSPI_DUMMY_DATA; //0x00; // Read Mode Register&lt;/P&gt;&lt;P&gt;masterTxData[3] = DSPI_DUMMY_DATA; //0x00; // Read Mode Register&lt;/P&gt;&lt;P&gt;&amp;nbsp;masterRxData[0] = 0xa5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;masterRxData[1] = 0xa5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;masterRxData[2] = 0xa5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;masterRxData[3] = 0xa5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// // Print out transmit buffer&lt;/P&gt;&lt;P&gt;PRINTF("\r\nFLASH_TX0:%02X_%02X_%02X_%02X_%02X", masterTxData[0], masterTxData[1], masterTxData[2], masterTxData[3], masterRxData[0]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// // Start master transfer, send data to slave&lt;/P&gt;&lt;P&gt;masterXfer.txData = masterTxData;&lt;/P&gt;&lt;P&gt;masterXfer.rxData = NULL;&lt;/P&gt;&lt;P&gt;masterXfer.dataSize = 1; // TRANSFER_SIZE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;masterXfer.configFlags = kDSPI_MasterCtar0 | EXAMPLE_DSPI_MASTER_PCS_FOR_TRANSFER | kDSPI_MasterPcsContinuous;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Start SPI operation&lt;/P&gt;&lt;P&gt;DSPI_MasterTransferBlocking(EXAMPLE_DSPI_MASTER_BASEADDR, &amp;amp;masterXfer);&lt;/P&gt;&lt;P&gt;// Delay to wait slave is ready&lt;/P&gt;&lt;P&gt;for (i = 0U; i &amp;lt; EXAMPLE_DSPI_DEALY_COUNT; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;__NOP();&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;// Start master transfer, receive data from slave&lt;/P&gt;&lt;P&gt;masterXfer.txData = NULL;&lt;/P&gt;&lt;P&gt;masterXfer.rxData = masterRxData;&lt;/P&gt;&lt;P&gt;masterXfer.dataSize =&amp;nbsp;1; // TRANSFER_SIZE;&lt;/P&gt;&lt;P&gt;masterXfer.configFlags = kDSPI_MasterCtar0 | EXAMPLE_DSPI_MASTER_PCS_FOR_TRANSFER | kDSPI_MasterPcsContinuous;&lt;/P&gt;&lt;P&gt;DSPI_MasterTransferBlocking(EXAMPLE_DSPI_MASTER_BASEADDR, &amp;amp;masterXfer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 19:31:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008577#M56049</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2019-11-12T19:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: KV58 SPI communication</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008578#M56050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;I have tried to replicate the problem using the example&amp;nbsp; dspi_interrupt from SDK. It uses only the TWR-KV58. In the example, the SPI0 is set for master and SPI1 for slave. After a successful transmission is put on console: DSPI transfer all data matched!&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;My goal was to enable the PCS1 and PCS0 in the SPI0 and alternate their usage for select master. Note that the other ones where ignored.&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;/* PORTE16 (pin 18) is configured as SPI0_PCS0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enable PCS1 alternative ********************** */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;PORT_SetPinMux(PORTE, 16U, kPORT_MuxAlt2);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;/* PORTC3 (pin 3) is configured as SPI0_PCS1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enable PCS1 alternative&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ******************/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;PORT_SetPinMux(PORTC, 3U, kPORT_MuxAlt2);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;….&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; masterConfig.whichPcs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; kDSPI_Pcs0&amp;nbsp; ;&amp;nbsp; /* use two PCS pins with&amp;nbsp; slave select as active low */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; masterConfig.whichPcs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |=&amp;nbsp; kDSPI_Pcs1&amp;nbsp; ;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;&amp;nbsp; masterConfig.pcsActiveHighOrLow = kDSPI_PcsActiveLow;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;…&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;&amp;nbsp; DSPI_MasterInit(EXAMPLE_DSPI_MASTER_BASEADDR, &amp;amp;masterConfig, srcClock_Hz);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;After the call of DSPI_MasterInit , the logic level on PCS1 and PCS0 is true.&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;Now, for select the which PCS pin to use, it is only necessary to&amp;nbsp; assign it, as the following sentences&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;&lt;STRONG&gt;/* Start master transfer*/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;&lt;STRONG&gt;commandData.whichPcs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = kDSPI_Pcs1 ; // or kDSPI_Pcs0&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;&lt;STRONG&gt;…&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;masterCommand = DSPI_MasterGetFormattedCommand(&amp;amp;commandData);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;After the PCS pins had been selected for a new transfer the transfer will begin with this function.&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG&gt;&lt;EM&gt;/* Start DSPI transfer.*/&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_StartTransfer(EXAMPLE_DSPI_MASTER_BASEADDR);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;I had made successfully two transfers, one with PCS1 and another with PCS0.&amp;nbsp; The PCS pins behave in the correct way in this example. I had attached their oscilloscope captures. In both captures, the PCS0 is on a yellow color and PCS1 pink.&amp;nbsp; There the signal values were at zero level after reset, in one after&amp;nbsp;&lt;EM&gt;&lt;STRONG style="font-size: 12px; "&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DSPI_MasterInit&amp;nbsp; ,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;and finally during transfer, only one toggle his state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;I recommend you to try this example as well because that must be the normal behavior of PCS pins.&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;Please let me know your results, and if this was helpful.&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Diego&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 22:57:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-SPI-communication/m-p/1008578#M56050</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2019-11-19T22:57:26Z</dc:date>
    </item>
  </channel>
</rss>

