<?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: SPI Interface with the MMC (Multimedia Card) in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150544#M4249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well thank you for telling me how things turned out.&lt;BR /&gt;&lt;BR /&gt;I was thinking about the fact you are using in interrupt. If you want to get maximum transfer rate, you should not use the interrupt.&lt;BR /&gt;&lt;BR /&gt;If you are clock the SPI at max, it takes 16 cycles to clock the data out. You have to wait that amount of time before the interrupt happens. The over head of the interrupt is at least 16 cycles, so you are at least doubling the time it takes to send/receive a byte.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2007 21:12:30 GMT</pubDate>
    <dc:creator>JimDon</dc:creator>
    <dc:date>2007-10-04T21:12:30Z</dc:date>
    <item>
      <title>SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150539#M4244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;I want to&amp;nbsp;communicate with a Mutimedia Card using the SPI interface of my processor MC9S12E64.&lt;/DIV&gt;&lt;DIV&gt;When i send a CMD0 for setting the MMC to the SPI mode, i get the correct answer (0x01)&amp;nbsp;from the MMC. But when i send the CMD1 to the MMC for startting the initialisation of the MMC, i get also 0x01 us answer, it must be a zero.&lt;/DIV&gt;&lt;DIV&gt;Is there any application note by Freescale talking about the MMC?&lt;/DIV&gt;&lt;DIV&gt;Has anybody an example code for this aplication?&lt;/DIV&gt;&lt;DIV&gt;Think you for your fats reaction.&lt;/DIV&gt;&lt;DIV&gt;Bye&lt;/DIV&gt;&lt;DIV&gt;T. El Boubkari&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F16BITCOMM%2F4595_SPI.zip" rel="nofollow" target="_blank"&gt;SPI.zip&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-20&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:45 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 15:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150539#M4244</guid>
      <dc:creator>Taoufik</dc:creator>
      <dc:date>2007-09-27T15:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150540#M4245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;Well for one thing it looks like you did not deselect the card between commands.&lt;BR /&gt;&lt;BR /&gt;CS is like a reset to the logic, and indicates the start of a new command. I deselect and send an FF byte after each command.&lt;BR /&gt;&lt;BR /&gt;Although you said MMC, is it really an SD card that you are using?&lt;BR /&gt;The slots are the same, but the specs are slightly different.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2007-09-27&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:30 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 03:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150540#M4245</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2007-09-28T03:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150541#M4246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Jim,&lt;/DIV&gt;&lt;DIV&gt;I've deselcted the Card between the 2 commands, but no change in the data&amp;nbsp;(0x01) coming from the MCC.&lt;/DIV&gt;&lt;DIV&gt;I'm using a MMC, not SD Card.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 19:49:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150541#M4246</guid>
      <dc:creator>Taoufik</dc:creator>
      <dc:date>2007-09-28T19:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150542#M4247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well upon further investigation, there are other problems with the code.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void SPISendChar (unsigned char data){    while (!SPISR_SPTEF);   /* wait until transmit buffer is empty*/    SPIDR = data;    /* Transmit counter*/}&lt;/PRE&gt;&lt;/DIV&gt;This generates the code:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  0001 4f0020fc     [4]     BRCLR _SPISR,#32,*+0 ;abs = 0001&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;So what you doing is attemping to clear the bit.&lt;BR /&gt;The code I use is:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  while(!(SPI0SR &amp;amp; SPI0SR_SPTEF_MASK) )// Wait for write to end.      ;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Which reads the register, masks the bit, and tests it (and seems to work).&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150542#M4247</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2020-10-29T08:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150543#M4248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you Jim for your effort.&lt;/DIV&gt;&lt;DIV&gt;I solved my problem with littel delays&amp;nbsp;(for lus) between CS low and send command. This was my problem.&lt;/DIV&gt;&lt;DIV&gt;Best Regards,&lt;/DIV&gt;&lt;DIV&gt;Taoufik&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by Taoufik on &lt;SPAN class="date_text"&gt;2007-10-04&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:00 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 16:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150543#M4248</guid>
      <dc:creator>Taoufik</dc:creator>
      <dc:date>2007-10-04T16:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150544#M4249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well thank you for telling me how things turned out.&lt;BR /&gt;&lt;BR /&gt;I was thinking about the fact you are using in interrupt. If you want to get maximum transfer rate, you should not use the interrupt.&lt;BR /&gt;&lt;BR /&gt;If you are clock the SPI at max, it takes 16 cycles to clock the data out. You have to wait that amount of time before the interrupt happens. The over head of the interrupt is at least 16 cycles, so you are at least doubling the time it takes to send/receive a byte.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 21:12:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150544#M4249</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2007-10-04T21:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interface with the MMC (Multimedia Card)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150545#M4250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I should thank you for not calling me an idiot, but to be honest it would have been ok if you pointed out my error.&lt;BR /&gt;Because now, in the interest of helping others by not leaving an incorrect statement stand, I have to correct myself.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt; 0001 4f0020fc     [4]     BRCLR _SPISR,#32,*+0 ;abs = 0001&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;This is branch if clear, not bit clear as I mistook for, so of course it is correct.&lt;BR /&gt;&lt;BR /&gt;I should have taken more time before jumping to a conclusion, and I am sorry if I mislead or confused anyone.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-Interface-with-the-MMC-Multimedia-Card/m-p/150545#M4250</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2020-10-29T08:53:10Z</dc:date>
    </item>
  </channel>
</rss>

