<?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>S12 / MagniV MicrocontrollersのトピックRe: S12 SPI read and write 93lc76c</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197068#M7847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi mac,&lt;/P&gt;&lt;P&gt;i use oscilloscope track mosi pin and observe &lt;FONT face="courier new,courier"&gt;the data had outed&lt;/FONT&gt; after "&lt;FONT face="courier new,courier"&gt;SPIDR = value",&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;thank you,mac&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2009 06:45:02 GMT</pubDate>
    <dc:creator>xiaolin_gao</dc:creator>
    <dc:date>2009-07-10T06:45:02Z</dc:date>
    <item>
      <title>S12 SPI read and write 93lc76c</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197064#M7843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to&amp;nbsp;clear SPISR_SPTEF&amp;nbsp;bit?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;DATASHHET the following description:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If set, this bit indicates that the transmit data register is empty. To clear&lt;BR /&gt;this bit and place data into the transmit data register, SPISR has to be read &lt;SPAN style="color: #ff0000;"&gt;with SPTEF = 1&lt;/SPAN&gt;, followed by a write&lt;BR /&gt;to SPIDR. Any write to the SPI Data Register without reading SPTEF = 1, is effectively ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can provide some routine? thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 10:58:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197064#M7843</guid>
      <dc:creator>xiaolin_gao</dc:creator>
      <dc:date>2009-07-08T10:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: S12 SPI read and write 93lc76c</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197065#M7844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SPTEF flag will be cleared and will then become set during the normal course of sending a byte.&amp;nbsp; You need to test the flag, to make sure it is set, prior to sending each byte.&amp;nbsp; More important is the clearing of the SPIF flag following the completion of each byte transfer.&amp;nbsp; The following code would be typical for the transfer of a single byte in both directions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;byte SPI_trans( byte value)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; while ((SPISR &amp;amp; 0x20) == 0);&amp;nbsp; // Wait until SPTEF flag is set&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; SPIDR = value;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; while ((SPISR &amp;amp; 0x80) == 0);&amp;nbsp; // Wait until SPIF flag is set&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; return SPIDR;&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; // Also clears flag&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 00:54:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197065#M7844</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-09T00:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: S12 SPI read and write 93lc76c</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197066#M7845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi mac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;thank your routine,but the SPTEF is not change too?&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by xiaolin.gao on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-08&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:52 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 12:52:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197066#M7845</guid>
      <dc:creator>xiaolin_gao</dc:creator>
      <dc:date>2009-07-09T12:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: S12 SPI read and write 93lc76c</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197067#M7846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When processing a single byte at a time, such as with the previous code snippet, the period that SPTEF flag remains low will be very short, typically a few bus cycles only.&amp;nbsp; During debug, it is therefore unlikely&amp;nbsp; that you would ever observe the flag being cleared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you should &lt;U&gt;not&lt;/U&gt; single step through the function for another reason.&amp;nbsp; The monitoring of the SPISR and SPIDR registers by the debugger can inadvertently cause the SPIF flag to be cleared prior to&amp;nbsp; the wait loop being exited.&amp;nbsp; The function will then never exit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:30:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197067#M7846</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-09T23:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: S12 SPI read and write 93lc76c</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197068#M7847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi mac,&lt;/P&gt;&lt;P&gt;i use oscilloscope track mosi pin and observe &lt;FONT face="courier new,courier"&gt;the data had outed&lt;/FONT&gt; after "&lt;FONT face="courier new,courier"&gt;SPIDR = value",&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;thank you,mac&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 06:45:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-SPI-read-and-write-93lc76c/m-p/197068#M7847</guid>
      <dc:creator>xiaolin_gao</dc:creator>
      <dc:date>2009-07-10T06:45:02Z</dc:date>
    </item>
  </channel>
</rss>

