<?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 Re: MCF51QE/JM interfacing a microSD Card in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191707#M8347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sebastian.&lt;/P&gt;&lt;P&gt;im so interested to use a microsd with an JM128 coldfire microcontroller. &amp;nbsp;based on schematics from one of JM60 demos, built a board where the microsd is connected trough channel 1 of SPI module. &amp;nbsp;also, got the entire project of datalogger written for JM60. &amp;nbsp;im using codewarrior 10.1 (new version).&lt;/P&gt;&lt;P&gt;im getting a lot of errors out from the project. &amp;nbsp;found some problems: compiler doesn't recognize library headers, also, there are a lot of errors from fat.c file. &amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any demo project written on CW 10.1 that works fine for JM128?&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Feb 2012 11:32:17 GMT</pubDate>
    <dc:creator>mauricio2346</dc:creator>
    <dc:date>2012-02-06T11:32:17Z</dc:date>
    <item>
      <title>MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191691#M8331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developping an application and I need to write/read some data in a microSD Card.... I have Freescale's Flexis JM&amp;nbsp; SD Card Reader, hardware and software... If I'm not wrong, documentation DRM104 refers to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Freescale's hardware comes with 2 demo softwares:&lt;/P&gt;&lt;P&gt;1- SD Card Datalogger&lt;/P&gt;&lt;P&gt;2- SD Card Reader (USB-SD Reader)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both softwares work fine... The datalogge logs the lumens or lux sensed (I don't remember wich one). Then, with the other soft. I can see the file content...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, for my application I want to use a microSD instead of a SD Card [&lt;EM&gt;Note: for the communication I use a SPI, not the SD Card Protocol&lt;/EM&gt;]... So, to test if it's working I log the data wiht my own application and read the content wth Fresscale's Card Reader (I put the microSD in a SD adapter)...&lt;/P&gt;&lt;P&gt;Well nothing happens... I can read the microSD Card, but it's empty...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So then I use the microSD with Freescale's Datalogger (again, the microSD inside a SD adapter)... For my sourprise, nothing happens, one more time....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once, I remember being in a Freescale Seminaire... And if I recall correctly, someone told me that NOT every microSD can be access by SPI.... So my question is... is that true? Does the microSD Card have other interfacing needs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks all of you!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 19:35:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191691#M8331</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2010-04-13T19:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191692#M8332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sebastian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've worked with that in recent past, check my past posts.&lt;/P&gt;&lt;P&gt;Send my regards to Fito Paez.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 19:52:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191692#M8332</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2010-04-13T19:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191693#M8333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Celso!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll look for them... If I can't solve my problem... I'll be back! (lol)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards would be send!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, Good Luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 21:02:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191693#M8333</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2010-04-13T21:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191694#M8334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is true that not all HCSD cards do (or will continue to) support SPI - I don't think that it is microSD card specific though. The SPI support is an option and may be dropped by some manufacturers. Personally I expect that it will only be on high-end cards since there are many devices that use SPI as simple and reliable solution (possible on just about any small processor) and this dem,and will hardly change in the foreseeable future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As long as you keep away from the highest speed cards (especially for video, etc. where the SD interface will be a must) you probably won't have problems. I tested a number of HCSD cards recently and didn't actually find any in the 'standard' range up to 8GHz that didn't support the SPI mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note also that if the SPI mode is not supported there will be no possibility to communicate with the card (using the SPI mode) and so the SPI based driver will probably declare that the card is not present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also the following for some more details: &lt;A href="http://www.utasker.com/docs/uTasker/uTasker_utFAT.PDF" rel="nofollow" target="_self"&gt;http://www.utasker.com/docs/uTasker/uTasker_utFAT.PDF&lt;/A&gt; This may also be made available for the V1 Coldfires shortly but is presently available for the V2 single-chips ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_self"&gt;www.uTasker.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 23:15:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191694#M8334</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2010-04-13T23:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191695#M8335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you too, Mark!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try 2 different mircoSD cards from 2 different manufacturers (N*kia and S*nD*sk).. Non if them works as data logger... The strange thing is that both of them works when I load the Card Reader software to the microcontroller... And I can read/write the microSD card...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Freescale's SD Card Reader software, communicates with the SD Card via SPI so I guess both microSD support SPI, because otherwise they wouldn't work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now the question is... If Freescale's DataLogger soft works fine with a SD card, and Card Reader works with microSD via SPI... why doesn't the DataLogger works with microSD cards?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'll check both SPI.c and .h files to see if I can find any difference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 09:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191695#M8335</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2010-04-15T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191696#M8336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I check both SPI.c files and find something interesting...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, let me introduce you: The SPI &lt;STRONG&gt;must&lt;/STRONG&gt; run at 375Khz in order to initiate communicate with the SD card. Then it could (or must?) switch to a higher rate to for data exchange.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The major differences were:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initialization&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATALOGGER&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; &lt;FONT color="#ff0000"&gt;SPI_BR_REG = 0x24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 375Khz&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;CARDREADER&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt; SPI_BR_REG = 0x14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 375Khz&lt;/P&gt;&lt;P&gt;I also check clock initialization and was different, so they run at different bus speeds, but the important thing is that both SPI clocks are set to 375Khz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;High Rate&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DATALOGGER&amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; &lt;FONT color="#ff0000"&gt;SPI_BR_REG = 0x11 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 375Khz&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;CARDREADER&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt; SPI_BR_REG = 0x00 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 6Mhz&lt;/P&gt;&lt;P&gt;Here I see two things:&lt;/P&gt;&lt;P&gt;1- First of all, hgiher ates are differents. One is "375Khz" while the other is 6Mhz&lt;/P&gt;&lt;P&gt;2- As you can see in &lt;FONT color="#ff0000"&gt;red&lt;/FONT&gt;, both comments says that speed is 375Khz... That's not correct, second value of the regsiter is a lower one, so it's actually a higher rate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, doing some math (for the DATALOGGER) we get that:&lt;/P&gt;&lt;P&gt;Assuming that initialization is correct and it's set to 375Khz as it must be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BaudRateDivisor = (SPPR + 1) *&amp;nbsp; (2^(SPR + 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SPPR = 2&lt;/P&gt;&lt;P&gt;SPR = 4 -----------&amp;gt; BR_Div = 3 * (2^5) = 96&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if BaudRate is 375Khz, then &lt;EM&gt;&lt;STRONG&gt;BUSCLK&lt;/STRONG&gt; = BaudRate * BR_Div = 375Khz * 96 = &lt;STRONG&gt;36Mhz&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'll calculate the higher rate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SPPR = 1&lt;/P&gt;&lt;P&gt;SPR = 1 -----------&amp;gt; BR_Div = 2 * (2^2) = 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;BaudRate&lt;/STRONG&gt; = BUSCLK / BR_Div = 36Mhz * 8 = &lt;STRONG&gt;4.5Mhz&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we get that:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DATALOGGER HIGH RATE = 4.5Mhz&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;CARDREADER HIGH RATE = 6Mhz&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Maybe this is the difference.... But the odd thing is that it works at the higher rate, so it should also work at a lower one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to keep testing but it's kind of late on this side of the Earth, LOL..... I'll continue tomorrow, any suggestions/corrections/directions are totally wellcome&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 10:29:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191696#M8336</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2010-04-15T10:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191697#M8337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well... I've finally solved it... It wasn't a timing problem, I just re-format the 2 microSD cards and they&amp;nbsp; worked fine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 May 2010 02:31:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191697#M8337</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2010-05-03T02:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191698#M8338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FAT File System of freescale with some bug fixes was posted on:&lt;/P&gt;&lt;P&gt;&lt;A href="http://code.google.com/p/brtos/downloads/list" rel="nofollow" target="_blank"&gt;http://code.google.com/p/brtos/downloads/list&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now supports up to 512 MB and the list function is working&amp;nbsp;correctly.&lt;/P&gt;&lt;P&gt;The corruption of files was also fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Gustavo&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 09:14:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191698#M8338</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2010-09-15T09:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191699#M8339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I downloaded the bug fix, but the fat.c and sd.c files seem to be missing - they show in the project window, but when you click on them, the file is not found.&amp;nbsp; I searched the downloaded projects and can't find the files.&amp;nbsp; Can you please re-post the entire project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Sep 2010 09:50:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191699#M8339</guid>
      <dc:creator>HummingbirdElec</dc:creator>
      <dc:date>2010-09-19T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191700#M8340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gustavo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've downloaded and had a really good look at your FAT implementation.&amp;nbsp; You mention that it now supports up to 512 MB.&amp;nbsp; I can't see any difference between the 2 versions that would make this difference.&amp;nbsp; From what I see, the array that stores the FAT entries (INT8U&amp;nbsp; u8buffer[512]&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; is 512 bytes in size and can therefore store 256 entries.&amp;nbsp; With a max cluster size of 64k, that equals 64k x 256 = 16 384k.&amp;nbsp; What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards, Norman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 10:34:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191700#M8340</guid>
      <dc:creator>HummingbirdElec</dc:creator>
      <dc:date>2010-09-21T10:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191701#M8341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am&amp;nbsp;developping an application and I need to write some data in a microSD Card. I have Freescale's Flexis JM&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;SD Card,&amp;nbsp; hardware and software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am using micro SD&amp;nbsp;Card.&amp;nbsp;In MC9S08JM60(8 bit)&amp;nbsp;hardware I log the data&amp;nbsp;WITH&amp;nbsp;demo code&amp;nbsp;and it working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But with MC51JM128(32 bit) hardware i could not log data in micro SD card and it is&amp;nbsp;empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried bug&amp;nbsp;&amp;nbsp;in SD_Write_Bloc (SD.C)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The changes were from:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=============================================&lt;/P&gt;&lt;P&gt;for(u16Counter=0;u16Counter&amp;lt;BLOCK_SIZE;u16Counter+​+);&lt;/P&gt;&lt;P&gt;if((ReadSPIByte() &amp;amp; 0x0F) != 0x05)&amp;nbsp;&lt;/P&gt;&lt;P&gt;=============================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To:&lt;/P&gt;&lt;P&gt;==================================================​=====================&lt;/P&gt;&lt;P&gt;SD_response=0xFF; // #001 created this variable&lt;BR /&gt;while (SD_response==0xFF) SD_response=ReadSPIByte(); // #001 wait for SD response &amp;lt;&amp;gt; 0xFF&lt;BR /&gt;if((SD_response &amp;amp; 0x0F) != 0x05)&amp;nbsp; // #001 checks if response = 0101 = data accepted&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_SS=DISABLE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(WRITE_DATA_FAILS);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;==================================================​======================&lt;/P&gt;&lt;P&gt;But i could not log data in micro SD card&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Anyone&amp;nbsp;can&amp;nbsp;help me to solving this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nitin Gadgeel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 14:08:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191701#M8341</guid>
      <dc:creator>ngadgeel</dc:creator>
      <dc:date>2011-02-10T14:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191702#M8342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ngadgeel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try our MCF51JM128 demo. Right now we are using a better FAT file system implementation, which supports FAT32 and directory structures. You can download the code in this links:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coldfire JM128 Demo:&lt;/P&gt;&lt;P&gt;&lt;A href="http://brtos.googlecode.com/files/TWR-LCD-FatFS.rar" rel="nofollow" target="_blank"&gt;http://brtos.googlecode.com/files/TWR-LCD-FatFS.rar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coldfire QE128 Demo:&lt;/P&gt;&lt;P&gt;&lt;A href="http://brtos.googlecode.com/files/BRTOS%20CFV1%20SD%20Card%20%2B%20FatFS.rar" rel="nofollow" target="_blank"&gt;http://brtos.googlecode.com/files/BRTOS%20CFV1%20SD%20Card%20%2B%20FatFS.rar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can remove the GLCD code simply by not installing the GLCD task in the main.c file. This will reduce a lot the compiled code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 19:02:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191702#M8342</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2011-04-06T19:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191703#M8343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="http://forums.freescale.com/t5/user/viewprofilepage/user-id/14393" rel="nofollow noopener noreferrer noopener noreferrer" target="_self"&gt;Hummingbird Electronics&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;calculation&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;is not&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;so simple&lt;/SPAN&gt;&lt;SPAN&gt;. For a 512MB SD card there are 32 sectors per cluster.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;  512 MB - 1023 MB    16-bit        32        16K&lt;/PRE&gt;&lt;P&gt;Therefore:&lt;/P&gt;&lt;P&gt;32 * 512 = 16K (Cluster size)&lt;/P&gt;&lt;P&gt;And,&lt;/P&gt;&lt;P&gt;16K clusters * (64k/2) = 512MB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Right now i'm using other FAT file system implemention. T&lt;/SPAN&gt;his new file system supports FAT32 and directory structures. You can download the code in this links:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coldfire JM128 Demo:&lt;/P&gt;&lt;P&gt;&lt;A href="http://brtos.googlecode.com/files/TWR-LCD-FatFS.rar" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://brtos.googlecode.com/files/TWR-LCD-FatFS.rar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coldfire QE128 Demo:&lt;/P&gt;&lt;P&gt;&lt;A href="http://brtos.googlecode.com/files/BRTOS%20CFV1%20SD%20Card%20%2B%20FatFS.rar" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://brtos.googlecode.com/files/BRTOS%20CFV1%20SD%20Card%20%2B%20FatFS.rar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Gustavo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:43:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191703#M8343</guid>
      <dc:creator>gustavod</dc:creator>
      <dc:date>2020-10-29T09:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191704#M8344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now data is logging in SD card using MCF51JM128.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One other thing is I have FLEXIXJM60 card&amp;nbsp;reader&amp;nbsp;software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using this SD card data is read. This is&amp;nbsp;working fine.&amp;nbsp;After converting this code to 32 bit MCF51JM128&amp;nbsp;code at the time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of compilation some error comes.&amp;nbsp;How to&amp;nbsp;eliminate these errors OR&amp;nbsp;there FLEXIX MCF51JM128 32 bit&amp;nbsp;card&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reader&amp;nbsp;code is&amp;nbsp;available?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Nitin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2011 16:32:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191704#M8344</guid>
      <dc:creator>ngadgeel</dc:creator>
      <dc:date>2011-05-03T16:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191705#M8345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm me again with this topic....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having the same troubles as before... one year ago... I also got to say that it's been a year since I last work on this project..... Now I'm back to it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well as said before, I've got Freescale Hardware and Software, the SD Card Reader with a MC9S08JM60 MCU. If you look for DRM 104 on freescale web site you'll find the App Note and there you can see the hardware I'm talking about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have both codes:&lt;/P&gt;&lt;P&gt;1- SD Card Reader&lt;/P&gt;&lt;P&gt;2- Datalogger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well soft #1 works perfectly fine but I can't get soft #2 to work... Same thing as before... I'm working with a 2gb SD card and also with a 128mb microSD card with SD adapter...&lt;/P&gt;&lt;P&gt;Datalogger needs file LOG.TXT to be created previously... So I create it using my laptop. Then run the datalogger application with the card inside. When I extract the card, it seems empty.... I mean, it "seems" because if I want to create a file named LOG.TXT it says it allready exists but I can't see any file in there...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also look at post by Celso and I found nothing that could help me. Also try to use BRTOS, using the new implementation... But still nothing there. User guide is in Portugues and I'm from Argentina, and sadly I don't speak or read this language. Is there an english or better yet spanish version?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I attach datalogger software from Freescale website... If some one could tell me if there's somethign wrong there It would be great... It's not written by me, again, its from freescale.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 06:59:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191705#M8345</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2011-06-03T06:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191706#M8346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solve...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso's&amp;nbsp; post help a lot.... &lt;A __default_attr="56589" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/56589" jivemacro="thread" title="link to post"&gt;link to post&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, don't know why but FAST SPI must be at least 4MHz value lower than that causes FAT_Read_Maste_Block to get stuck..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards, and Good Luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 21:48:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191706#M8346</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2011-06-03T21:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191707#M8347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sebastian.&lt;/P&gt;&lt;P&gt;im so interested to use a microsd with an JM128 coldfire microcontroller. &amp;nbsp;based on schematics from one of JM60 demos, built a board where the microsd is connected trough channel 1 of SPI module. &amp;nbsp;also, got the entire project of datalogger written for JM60. &amp;nbsp;im using codewarrior 10.1 (new version).&lt;/P&gt;&lt;P&gt;im getting a lot of errors out from the project. &amp;nbsp;found some problems: compiler doesn't recognize library headers, also, there are a lot of errors from fat.c file. &amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any demo project written on CW 10.1 that works fine for JM128?&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2012 11:32:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191707#M8347</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2012-02-06T11:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191708#M8348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauricio!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have it for CW10.1... I made it work over CW 6.2. If you serch in the forum there are some threads about how to migrate from an earlier version of CW to v10.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or if you don't want to deal with that you can download v6.2 and work with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you've got more question I'd be please to help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Saludos!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 01:57:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191708#M8348</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-02-07T01:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191709#M8349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastián.&amp;nbsp;&lt;/P&gt;&lt;P&gt;finally i could get it working on codewarrior 6.3&lt;/P&gt;&lt;P&gt;it creates the .txt file if it doesn't exist previously, also it logs data from serial port nice and clean.&lt;/P&gt;&lt;P&gt;but i have some questions about using fat libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this moment, im using FAT16 libraries, tested with 128Mb Sandisk uSD, 256Mb Nokia uSD and generic 2Gb uSD.&lt;/P&gt;&lt;P&gt;created log files shows data like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;001;001;001;001;..... and so. &amp;nbsp;i would like to write into uSD card with indexed information, as excel tables like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 002 &amp;nbsp; &amp;nbsp;003&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 002 &amp;nbsp; &amp;nbsp;003&lt;/P&gt;&lt;P&gt;...... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to export data easily on excel, labview or matlab.&lt;/P&gt;&lt;P&gt;also, i wanna create multiple txt files on execution. &amp;nbsp;using this procedure:&lt;/P&gt;&lt;PRE&gt;u8Error=FAT_FileOpen(FILE_NAME,CREATE);&lt;/PRE&gt;&lt;PRE&gt;#define FILE_NAME   "DATALOG.TXT"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and changing FILE_NAME would create a new txt file, i think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i change the definition above while running, to create files like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATALOG_001.TXT&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DATALOG_002.TXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;DATALOG_003.TXT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;DATALOG_004.TXT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Than you for your hep, i will await your reply.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Regards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:43:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191709#M8349</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2020-10-29T09:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51QE/JM interfacing a microSD Card</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191710#M8350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mauricio!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right, changing that definition, would change the name of the file created. There are several ways of changing the name...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I gues the easiest way is to define some constant like:&lt;/P&gt;&lt;PRE&gt;const byte fileName[] = {"DATALOG_"};const byte fileExtension[] = {".TXT"};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With fileName you would have the "base" name of your files, and fileExtension is the extension of that file:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: If I remind correctly the file name and extension MUST be UPPERCASE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you would need a variable where you will hold the index of the file name. And you'll need a way to increment that value. And then do some string operations to get the complete file name. For example:&lt;/P&gt;&lt;PRE&gt;byte fileIndex[] = {"001"};byte entireFileName[20];/* entireFileName = "DATALOG_" */
strcpy(entireFileName,fileName);
/* entireFileName = "DATALOG_001" */
strcat(entireFileName,fileIndex);
/* entireFileName = "DATALOG_001.TXT" */
strcat(entireFileName,fileExtension);u8Error=FAT_FileOpen(entireFileName,CREATE);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can think of 2 ways to increment the value:&lt;/P&gt;&lt;P&gt;1) You can have a byte value, and convert it to string with some function like itoa (integer to array)&lt;/P&gt;&lt;P&gt;2) You can have the same byte value, as index of a table containg the asociated string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:43:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51QE-JM-interfacing-a-microSD-Card/m-p/191710#M8350</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2020-10-29T09:43:44Z</dc:date>
    </item>
  </channel>
</rss>

