<?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中的主题 FRDM-KL25Z - slow SPI clock</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173927#M1376</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'm working on a project involving SD card writing via SPI bus. The writing itself works well, but it's terribly slow (~10kBps). I believe the reason is the SPI clock which ticks only @ 45 kHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The environment is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- FRDM-KL25Z board, Itead Studio SD Card breakout module, Samsung 2GB MicroSD card&lt;/P&gt;&lt;P&gt;- FatFS and SDCard components from &lt;A href="http://www.steinerberg.com/"&gt;www.steinerberg.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- SPI1 bus, 333 kHz and 4 Mhz shift clock speeds&lt;/P&gt;&lt;P&gt;- Clock: 8 Mhz external crystal, 2 MHz bus, MCG is in BLPE mode.&lt;/P&gt;&lt;P&gt;- Codewarrior 10.3, OpenSDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the bus speed to 1 MHz the SPI clock reduces to 23 kHz, eventhough SPI1 shoudn't use bus clock as a reference. The MCG, SIM and SPI registers seem ok and the scope tells me the bus clock is ok (which should mean the OUTDIV1 and OUTDIV4 work as they should). I tried also SPI0 bus but that was slow as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is: what could be the reason for such a slow clock speed?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 14:07:12 GMT</pubDate>
    <dc:creator>jonaseriksson</dc:creator>
    <dc:date>2012-11-13T14:07:12Z</dc:date>
    <item>
      <title>FRDM-KL25Z - slow SPI clock</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173927#M1376</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'm working on a project involving SD card writing via SPI bus. The writing itself works well, but it's terribly slow (~10kBps). I believe the reason is the SPI clock which ticks only @ 45 kHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The environment is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- FRDM-KL25Z board, Itead Studio SD Card breakout module, Samsung 2GB MicroSD card&lt;/P&gt;&lt;P&gt;- FatFS and SDCard components from &lt;A href="http://www.steinerberg.com/"&gt;www.steinerberg.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- SPI1 bus, 333 kHz and 4 Mhz shift clock speeds&lt;/P&gt;&lt;P&gt;- Clock: 8 Mhz external crystal, 2 MHz bus, MCG is in BLPE mode.&lt;/P&gt;&lt;P&gt;- Codewarrior 10.3, OpenSDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the bus speed to 1 MHz the SPI clock reduces to 23 kHz, eventhough SPI1 shoudn't use bus clock as a reference. The MCG, SIM and SPI registers seem ok and the scope tells me the bus clock is ok (which should mean the OUTDIV1 and OUTDIV4 work as they should). I tried also SPI0 bus but that was slow as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is: what could be the reason for such a slow clock speed?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 14:07:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173927#M1376</guid>
      <dc:creator>jonaseriksson</dc:creator>
      <dc:date>2012-11-13T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL25Z - slow SPI clock</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173928#M1377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have you configured the SD_Card component to use a slow and a fast mode? Typically the slow mode has index zero into the clock speed table, and the fast mode has index 1.&lt;/P&gt;&lt;P&gt;Have a look at my Arduino SD-Card shield and the settings in &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;Hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Nov 2012 17:51:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173928#M1377</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2012-11-18T17:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL25Z - slow SPI clock</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173929#M1378</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;Thank you for your reply! Yup, I had the two speed modes in SD component and SM but that didn't give me any speedup. I changed the clocking configuration (MCG=&amp;gt;PEE, core=&amp;gt;48MHz, bus=&amp;gt;24MHz) which led into 413kHz SPI clock and ~42kBps write speed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyhoo, I then read your article and updated the SD_Card and FatFS components. As a result, the SPI clock works as configured! Amazing! The write speed is now ~70kBps (6400B packets * 100 cycles, append to the same file) which should be enough for the project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help and let me know if you come up with any tricks to further boost up the write speed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonas&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 12:13:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL25Z-slow-SPI-clock/m-p/173929#M1378</guid>
      <dc:creator>jonaseriksson</dc:creator>
      <dc:date>2012-11-19T12:13:53Z</dc:date>
    </item>
  </channel>
</rss>

