<?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: spi data transmission</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135096#M2172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;It sounds to me like your receiver is not waiting for the new byte to show up before writing it to the array.&amp;nbsp; Are you polling the SPIF bit to see when there is a new byte received?&amp;nbsp; Or are you using an interrupt?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you post your receiver's code?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To answer your question,&amp;nbsp; no, you should not have to clear the data register.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Which chip are you using?&lt;/DIV&gt;&lt;P&gt;Message Edited by rhinoceroshead on &lt;SPAN class="date_text"&gt;05-07-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:04 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 May 2006 11:02:31 GMT</pubDate>
    <dc:creator>rhinoceroshead</dc:creator>
    <dc:date>2006-05-08T11:02:31Z</dc:date>
    <item>
      <title>spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135095#M2171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;when i transmit an array of data through the spi the value of the first entry of the array shows up on the receiver for all the array entries. When i use break points the data is transmitted fine, and does what i mentioned earlier when the code is ran at speed. Ive tried delays but it doesnt work. Does anyone know if i have to clear the data register before i use it each time or if there is a trick that i am missing like reading from the register twice. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 07:34:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135095#M2171</guid>
      <dc:creator>lssuer</dc:creator>
      <dc:date>2006-05-08T07:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135096#M2172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;It sounds to me like your receiver is not waiting for the new byte to show up before writing it to the array.&amp;nbsp; Are you polling the SPIF bit to see when there is a new byte received?&amp;nbsp; Or are you using an interrupt?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you post your receiver's code?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To answer your question,&amp;nbsp; no, you should not have to clear the data register.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Which chip are you using?&lt;/DIV&gt;&lt;P&gt;Message Edited by rhinoceroshead on &lt;SPAN class="date_text"&gt;05-07-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:04 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 11:02:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135096#M2172</guid>
      <dc:creator>rhinoceroshead</dc:creator>
      <dc:date>2006-05-08T11:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135097#M2173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi issuer,&lt;/P&gt;&lt;P&gt;The first thing I would do is send a smaller array.&lt;BR /&gt;If the receivers array is still&amp;nbsp;FULL of the first byte, then you have probably got something like what rhino is describing. At least this should start you down the path to locating the problem.&lt;/P&gt;&lt;P&gt;There has been many threads on this topic recently. Probably a good idea to search them out (8 and 16 bit forums)&lt;/P&gt;&lt;P&gt;Regards Peg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 11:22:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135097#M2173</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-05-08T11:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135098#M2174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Issuer,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Is your "receiver" the master or slave device?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 16:57:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135098#M2174</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-05-08T16:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135099#M2175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;heres my reciever code and my reciever is the slave, also i am using the MC9S12DP256 micro. thanks for any help you can provide.&lt;BR /&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;for (i = 0; i5; i++){PTM |= 0x40;while(!(SPI0SR &amp;amp; 0x80));switch(i){case 0:port_enable = SPI0DR;port_enable = SPI0DR;break;case 1:display_port = SPI0DR;display_port = SPI0DR;break;case 2:sample_rate = SPI0DR;sample_rate = SPI0DR;break;case 3:module_number = SPI0DR;module_number = SPI0DR;break;case 4:last_flg = SPI0DR;last_flg = SPI0DR;break;default:temp = SPI0DR;temp = SPI0DR;}for (l=0; l200000; l++){PTM &amp;amp;= 0xBF;}}&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;FONT size="1"&gt;(Alban changed code format using "SRC" button)&lt;/FONT&gt;&lt;P&gt;Message Edited by Alban on &lt;SPAN class="date_text"&gt;05-09-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:56 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 00:11:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135099#M2175</guid>
      <dc:creator>lssuer</dc:creator>
      <dc:date>2006-05-09T00:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135100#M2176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;What you have here looks fine to me, except the for loops - which I assume got formatted incorrectly by the forum.&amp;nbsp; You shouldn't need to read SPI0DR twice, but that shouldn't hurt anything either.&amp;nbsp; I'm&amp;nbsp;also curious about the way you're manipulating port M6.&amp;nbsp; Is this connected to SS on the transmitter?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It would be interesting to see the way your SPI is configured on both the transmitter and receiver.&amp;nbsp; Do you have the mode fault detection enabled?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 06:02:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135100#M2176</guid>
      <dc:creator>rhinoceroshead</dc:creator>
      <dc:date>2006-05-09T06:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: spi data transmission</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135101#M2177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Issuer,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;For the slave device, the /SS input will need to be driven from the master, or alternatively&amp;nbsp;might be tied permanently active low.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;However,&amp;nbsp;if the latter case is used, the setting&amp;nbsp;CPHA = 1 is required (it will not work for CPHA = 0). The settings for both CPHA and CPOL must be identical for master and slave.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Your Port M output would seem unnecessary for the slave end.&amp;nbsp; At the &lt;U&gt;master&lt;/U&gt; end, if the /SS pin is configured as&amp;nbsp; /SS input, this should be tied to Vdd.&amp;nbsp; However, if configured as a /SS output, it could be connected to /SS input at the slave.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 15:27:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/spi-data-transmission/m-p/135101#M2177</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-05-09T15:27:51Z</dc:date>
    </item>
  </channel>
</rss>

