<?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: [MKW01Z128] SPI communication - Master</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW01Z128-SPI-communication-Master/m-p/713844#M43840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Erik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which evaluation board and demo application are you using? In case you are using the FRDM-KW01, there is a board support patch for KSDK 1.3 under the &lt;STRONG&gt;Archive Releases&lt;/STRONG&gt; section in the &lt;A href="http://www.nxp.com/products/developer-resources/hardware-development-tools/freedom-development-boards/software-development-kit-for-kinetis-mcus:KINETIS-SDK?fsrch=1&amp;amp;sr=1&amp;amp;pageNum=1"&gt;KSDK page&lt;/A&gt;.&amp;nbsp;This&amp;nbsp;patch&amp;nbsp;adds support for the &lt;SPAN&gt;FRDM-KW01&amp;nbsp;&lt;/SPAN&gt;board, including the set of demos and examples, into an existing KSDK 1.3.0 installation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gerardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2017 21:23:05 GMT</pubDate>
    <dc:creator>gerardo_rodriguez</dc:creator>
    <dc:date>2017-09-07T21:23:05Z</dc:date>
    <item>
      <title>[MKW01Z128] SPI communication - Master</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW01Z128-SPI-communication-Master/m-p/713843#M43839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first off, I'm new to this website and programming. I have a problem with SPI communication on MKW01Z128. I will try to give you as much details as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using IAR ide. I took KSDK example from MRB KW01 chip since it was the closest name to my chip. My chip will be the master of this communication. I configured SPI pins(in fuction void configure_spi_pins(uint32_t instance)) in pin_mux correctly:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;PORT_HAL_SetMuxMode(PORTE,0u,kPortMuxAlt2); /* MISO */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTE,1u,kPortMuxAlt2); /* MOSI */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTD,5u,kPortMuxAlt2); /* SCK */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTD,4u,kPortMuxAlt2); /* PCS0 */&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;for pin 27, 29, 32, 34 as SPI1 PCS, SPI1 clock, SPI1 MISO, SPI1 MOSI on my chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything works fine, except a wierd short clock pulse(in yellow- MOSI is dark blue and MISO is light blue) everytime I send a packet before the actual payload:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="NewFile6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/27469iDF1E42FD497EEBD7/image-size/large?v=v2&amp;amp;px=999" role="button" title="NewFile6.png" alt="NewFile6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;A closeup of this short pulse:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="NewFile9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/27511iF09DA5F93FD1A9F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="NewFile9.png" alt="NewFile9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;MOSI sends correct bits and clock works great except the pulse part.&lt;/P&gt;&lt;P&gt;Unfortunatelly this pulse messes up the slave so won't send his data back. Tested this SPI communication with some other chip and it worked fine.&lt;/P&gt;&lt;P&gt;I will paste my code for inicialization and sending packets as well, maybe that is the cause:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define SPI_MASTER_INSTANCE BOARD_SPI_INSTANCE /*! User change define to choose SPI instance */&lt;BR /&gt;#define TRANSFER_BAUDRATE (1250000U) /*! Transfer baudrate - 500k */&lt;BR /&gt;#define MASTER_TRANSFER_TIMEOUT (100U) /*! Transfer timeout of master - 100ms */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t calculatedBaudRate;&lt;BR /&gt; spi_master_state_t spiMasterState;&lt;BR /&gt; spi_master_user_config_t userConfig =&lt;BR /&gt; {&lt;BR /&gt;#if FSL_FEATURE_SPI_16BIT_TRANSFERS&lt;BR /&gt; .bitCount = kSpi8BitMode,&lt;BR /&gt;#endif&lt;BR /&gt; .polarity = kSpiClockPolarity_ActiveHigh,&lt;BR /&gt; .phase = kSpiClockPhase_SecondEdge,&lt;BR /&gt; .direction = kSpiMsbFirst,&lt;BR /&gt; .bitsPerSec = TRANSFER_BAUDRATE&lt;BR /&gt; };&lt;BR /&gt; //CLOCK_SYS_EnablePortClock(PORTA_IDX); //doesn't matter&lt;BR /&gt; CLOCK_SYS_EnablePortClock(PORTD_IDX);&lt;BR /&gt; CLOCK_SYS_EnablePortClock(PORTE_IDX);&lt;BR /&gt; // dbg_uart_init(); &lt;BR /&gt; configure_spi_pins(SPI1_IDX);&lt;BR /&gt; // Init OSA layer.&lt;BR /&gt; OSA_Init();&lt;BR /&gt; // Init and setup baudrate for the master&lt;BR /&gt; SPI_DRV_MasterInit(SPI_MASTER_INSTANCE, &amp;amp;spiMasterState);&lt;BR /&gt; SPI_DRV_MasterConfigureBus(SPI_MASTER_INSTANCE,&lt;BR /&gt; &amp;amp;userConfig,&lt;BR /&gt; &amp;amp;calculatedBaudRate);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and sending packets:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if (SPI_DRV_MasterTransferBlocking(SPI_MASTER_INSTANCE, NULL, SendBuffer, s_spiSinkBufferS, 5, MASTER_TRANSFER_TIMEOUT) == kStatus_SPI_Timeout){}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I also tried normal(non-blocking) sending of packets, but clock still does this pulse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has any questions or information about it I would appreaciate the comment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance, Erik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2017 13:09:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW01Z128-SPI-communication-Master/m-p/713843#M43839</guid>
      <dc:creator>erikkokalj</dc:creator>
      <dc:date>2017-09-01T13:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: [MKW01Z128] SPI communication - Master</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW01Z128-SPI-communication-Master/m-p/713844#M43840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Erik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which evaluation board and demo application are you using? In case you are using the FRDM-KW01, there is a board support patch for KSDK 1.3 under the &lt;STRONG&gt;Archive Releases&lt;/STRONG&gt; section in the &lt;A href="http://www.nxp.com/products/developer-resources/hardware-development-tools/freedom-development-boards/software-development-kit-for-kinetis-mcus:KINETIS-SDK?fsrch=1&amp;amp;sr=1&amp;amp;pageNum=1"&gt;KSDK page&lt;/A&gt;.&amp;nbsp;This&amp;nbsp;patch&amp;nbsp;adds support for the &lt;SPAN&gt;FRDM-KW01&amp;nbsp;&lt;/SPAN&gt;board, including the set of demos and examples, into an existing KSDK 1.3.0 installation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gerardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 21:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW01Z128-SPI-communication-Master/m-p/713844#M43840</guid>
      <dc:creator>gerardo_rodriguez</dc:creator>
      <dc:date>2017-09-07T21:23:05Z</dc:date>
    </item>
  </channel>
</rss>

