<?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 [SPI] MOSI is changed from level '0' to level '1' before the falling edge happens in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-MOSI-is-changed-from-level-0-to-level-1-before-the-falling/m-p/700171#M43049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;Greetings,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;I am using KIT TRK-KEAZN64&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;I am configuring SPI peripheral as below; SPI0_C1 = BIT_SPIC0_SPE | BIT_SPIC0_MSTR | BIT_SPIC0_CPHA | BIT_SPIC0_CPOL; SPE = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; Enable SPI system, MSTR = 1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;=&amp;gt; Set SPI as master device, CPHA = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; First edge at start of first data transfer cycle, CPOL = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; SPI clock as active low (idle high). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;So I am expecting MOSI to be changed at every falling edge of the clock. However, I had strange behavior which is in case of MOSI change from level '0' to level '1', this change occurs vefore the falling edge of clock happens. while it is working good when MOSI changes from level '1' to level '0'. This is illustrated more in the attached screenshots.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Aug 2017 12:09:21 GMT</pubDate>
    <dc:creator>mohammedaboelna</dc:creator>
    <dc:date>2017-08-17T12:09:21Z</dc:date>
    <item>
      <title>[SPI] MOSI is changed from level '0' to level '1' before the falling edge happens</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-MOSI-is-changed-from-level-0-to-level-1-before-the-falling/m-p/700171#M43049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;Greetings,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;I am using KIT TRK-KEAZN64&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;I am configuring SPI peripheral as below; SPI0_C1 = BIT_SPIC0_SPE | BIT_SPIC0_MSTR | BIT_SPIC0_CPHA | BIT_SPIC0_CPOL; SPE = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; Enable SPI system, MSTR = 1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;=&amp;gt; Set SPI as master device, CPHA = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; First edge at start of first data transfer cycle, CPOL = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt; =&amp;gt; SPI clock as active low (idle high). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; background-color: #f2f2f5; font-size: 14px;"&gt;So I am expecting MOSI to be changed at every falling edge of the clock. However, I had strange behavior which is in case of MOSI change from level '0' to level '1', this change occurs vefore the falling edge of clock happens. while it is working good when MOSI changes from level '1' to level '0'. This is illustrated more in the attached screenshots.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:09:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-MOSI-is-changed-from-level-0-to-level-1-before-the-falling/m-p/700171#M43049</guid>
      <dc:creator>mohammedaboelna</dc:creator>
      <dc:date>2017-08-17T12:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: [SPI] MOSI is changed from level '0' to level '1' before the falling edge happens</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-MOSI-is-changed-from-level-0-to-level-1-before-the-falling/m-p/700172#M43050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial,sans-serif; font-size: small;"&gt;Dear Mohammed,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial,sans-serif; font-size: small;"&gt;If you configure the SPI module of KEA processor in master mode and CPHA=CPOL=1, from theory, the falling edge of SPI clock signal SPSCK will trigger the MOSI signal toggle. Regarding your obvervation that the falling edge of SPCLK lags behind the MOSI rising edge, because you use logic analyzer, cable length, pin capacitive difference may leads to the issue. &lt;BR clear="none" /&gt;how about using high frequency oscilloscope to test the signals while you connect the proble to the KEA chip pins as close as possible and remove the capactive load?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial,sans-serif; font-size: small;"&gt;Hope it can help you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial,sans-serif; font-size: small;"&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial,sans-serif; font-size: small;"&gt;xiangjun Rong&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 03:40:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-MOSI-is-changed-from-level-0-to-level-1-before-the-falling/m-p/700172#M43050</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2017-08-22T03:40:00Z</dc:date>
    </item>
  </channel>
</rss>

