<?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: K60 NXP  SPI problem</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171498#M58573</link>
    <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;One more doubt I am using SPI available on port C whether I have to use CS of same port or any of the gpio can be configures as CS to operate the SPI&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 03:24:46 GMT</pubDate>
    <dc:creator>mdrasool_yadwad</dc:creator>
    <dc:date>2020-10-22T03:24:46Z</dc:date>
    <item>
      <title>K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170113#M58548</link>
      <description>&lt;P&gt;Hello Sir,&lt;/P&gt;&lt;P&gt;I attached document please check it once. In SPI0 the document of tower board is showing chip select 4 as Output. What does it mean we cant able to write or read&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 07:01:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170113#M58548</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-20T07:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170208#M58550</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;mdrasool_yadwad,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;SPI CS pin output is to the master, it is used to select the slave chip in the SPI modules.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;So, you just can consider one SPI0 has several CS pins, CS4 is just one external slave SPI chip select pins.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you still have questions about it, please kindly let me know!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kerry&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 08:28:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170208#M58550</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-10-20T08:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170299#M58553</link>
      <description>&lt;P&gt;I am enable to read the correct data by using the SPI. Below is my code please check it once. I am getting garbage data&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* SPI config&lt;/P&gt;&lt;P&gt;// disable SPI&lt;BR /&gt;spiDisable(SPI0);&lt;BR /&gt;&lt;BR /&gt;// enabling master mode and disable tx and rx,and clear rx,tx&lt;BR /&gt;SPI_MCR_REG(SPI0) |= (SPI_MCR_MSTR_MASK | SPI_MCR_ROOE_MASK | SPI_MCR_DIS_RXF_MASK | SPI_MCR_DIS_TXF_MASK | SPI_MCR_CLR_TXF_MASK | (SPI_MCR_CLR_RXF_MASK) );&lt;BR /&gt;SPI_MCR_REG(SPI0) |= SPI_MCR_PCSIS(1U); //--&amp;gt;Peripheral Chip Select is Inactive Low&lt;BR /&gt;&lt;BR /&gt;// End of SpiEnableREeceiver&lt;BR /&gt;SPI_MCR_REG(spi) |= (1U&amp;lt;&amp;lt;SPI_MCR_ROOE_SHIFT);&lt;BR /&gt;&lt;BR /&gt;// Frame size 8Bit **frame is equal to the FMSZ field value plus 1.&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) = SPI_CTAR_FMSZ(7);&lt;BR /&gt;&lt;BR /&gt;// set baudrate different frequency like 500khz&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) |= SPI_CTAR_PBR(1U);//prescalar-3&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) |= SPI_CTAR_BR(4U);//baud SCALAR factor-32&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) |= (0U &amp;lt;&amp;lt; SPI_CTAR_DBR_SHIFT);//value set to 0&lt;BR /&gt;&lt;BR /&gt;// clock phase,polarity 0,msb first then 0 (LSBFE)&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) &amp;amp;= ~(SPI_CTAR_CPHA_MASK | SPI_CTAR_CPOL_MASK | SPI_CTAR_LSBFE_MASK);&lt;/P&gt;&lt;P&gt;// Delay After Transfer Scaler ,ASC-ACK delay scalar,CSSCK-SCK delay,PCSSCK-PCS to SCK Delay Prescaler,PASC-After SCK Delay Prescaler,PDT-Delay after Transfer Prescaler&lt;BR /&gt;SPI_CTAR_REG(SPI0,0) |= (SPI_CTAR_DT(5U) | SPI_CTAR_ASC(5U) | SPI_CTAR_CSSCK(5U) | SPI_CTAR_PCSSCK(0U) | SPI_CTAR_PASC(0U) | SPI_CTAR_PDT(0U));&lt;BR /&gt;SPI_PUSHR_REG(SPI0) =SPI_PUSHR_PCS(1&amp;lt;&amp;lt;4);&lt;BR /&gt;spiEnable(SPI0);&lt;/P&gt;&lt;P&gt;*/End&lt;/P&gt;&lt;P&gt;/* SPI Write&lt;/P&gt;&lt;P&gt;void DAC_AD5724(int data)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;SPI_Start();&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;uint8_t i=0;&lt;BR /&gt;i=data;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SPI0_PUSHR = SPI_PUSHR_CONT_MASK|SPI_PUSHR_CTAS(0x01)|(SPI_PUSHR_PCS(1&amp;lt;&amp;lt;4))|SPI_PUSHR_TXDATA(0x02);&lt;BR /&gt;&lt;BR /&gt;SPI0_PUSHR =SPI_PUSHR_TXDATA(i);&lt;BR /&gt;&lt;BR /&gt;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;SPI0_PUSHR |= SPI_PUSHR_TXDATA(data&amp;gt;&amp;gt;8);&lt;BR /&gt;&amp;nbsp;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;&amp;nbsp;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;SPI0_PUSHR|=SPI_PUSHR_TXDATA(data);&lt;BR /&gt;&amp;nbsp;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;&amp;nbsp;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;SPI_Stop();&lt;/P&gt;&lt;P&gt;*/Write End&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*SPI Read&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SPI_Start(); // Reading the data from the 23lcv1024&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SPI0_PUSHR=SPI_PUSHR_PCS(1&amp;lt;&amp;lt;4)|SPI_PUSHR_CTAS(0x01)|SPI_PUSHR_TXDATA(0x03);&lt;BR /&gt;SPI0_PUSHR|=SPI_PUSHR_TXDATA(0x03);&lt;BR /&gt;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&lt;BR /&gt;SPI0_PUSHR |= SPI_PUSHR_TXDATA(0x00);&lt;BR /&gt;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SPI0_PUSHR|= SPI_PUSHR_TXDATA(0x00);&lt;BR /&gt;&lt;BR /&gt;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&lt;BR /&gt;SPI0_PUSHR |= SPI_PUSHR_TXDATA(0x10);&lt;BR /&gt;while(!(SPI0_SR &amp;amp; SPI_SR_TCF_MASK ));&lt;BR /&gt;SPI0_SR |= SPI_SR_TCF_MASK;&lt;BR /&gt;&lt;BR /&gt;a = SPI0_POPR;&lt;BR /&gt;&lt;BR /&gt;SPI_Stop();&lt;/P&gt;&lt;P&gt;*/READ End&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 10:51:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170299#M58553</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-20T10:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170585#M58561</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;A suggestion is that do not use the default pin for pcs. You can use any pin configured as gpio to make the pin as cs. Here is the reason. When start transfer, the cs will be low automatically. Then you send one byte, the cs will be high&amp;nbsp;automatically. But sometimes the master should send continuous several bytes. In this time, the cs should hold low. Due to you can't control the cs, your communication will fail. Another suggestion is that use sdk. The attachment is a project reading w25q. It uses gpio to control cs. You can use refer this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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;- We are following threads for 7 days 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;</description>
      <pubDate>Wed, 21 Oct 2020 01:04:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170585#M58561</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-10-21T01:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170774#M58563</link>
      <description>&lt;P&gt;You mean to say we cant control CS using registers.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 06:58:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170774#M58563</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-21T06:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170789#M58565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Using gpio is more convenient and flexible.&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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;- We are following threads for 7 days 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;</description>
      <pubDate>Wed, 21 Oct 2020 07:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1170789#M58565</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-10-21T07:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171498#M58573</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;One more doubt I am using SPI available on port C whether I have to use CS of same port or any of the gpio can be configures as CS to operate the SPI&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 03:24:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171498#M58573</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-22T03:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171555#M58575</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Any gpio is ok. gpio is not controlled by spi. You can refer the attachment I sent to you.&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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;- We are following threads for 7 days 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;</description>
      <pubDate>Thu, 22 Oct 2020 05:36:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171555#M58575</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-10-22T05:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171571#M58576</link>
      <description>&lt;P&gt;Like wise in your attachment you have used SPI0 of port D (93,94,95,96 pins), 93-CS you made as normal GPIO of same port D.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my doubt whether i have to use the same port CS as gpio or any of the pin as GPIO and use as CS.&lt;/P&gt;&lt;P&gt;When i use any of pin as GPIO and CS i m not getting the correct data&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 06:17:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1171571#M58576</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-22T06:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1172098#M58580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;This means your code may have some problems. You have to use oscilloscope to check the spi timing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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;- We are following threads for 7 days 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;</description>
      <pubDate>Fri, 23 Oct 2020 00:56:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1172098#M58580</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-10-23T00:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: K60 NXP  SPI problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1172158#M58582</link>
      <description>&lt;P&gt;I have checked that also but data is not proper.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 03:20:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-NXP-SPI-problem/m-p/1172158#M58582</guid>
      <dc:creator>mdrasool_yadwad</dc:creator>
      <dc:date>2020-10-23T03:20:10Z</dc:date>
    </item>
  </channel>
</rss>

