<?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 S12G SPI polarity control in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370720#M10695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SPI MOSI pin defaults to high. So when no data is being sent, it goes high. I would like it to be low.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I had a look at the Port Integration section of the Reference Manual, and it seemed this should be possible. The settings would be: wire-or mode, pull enabled, pulldown i.e. for MOSI on port 0:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WOMS &amp;amp;= ~0b00100000;&amp;nbsp; // set PS5 to wire-or mode&lt;/P&gt;&lt;P&gt;PERS&amp;nbsp; |= 0b00100000; // enable pull resistor on PS5&lt;/P&gt;&lt;P&gt;PPSS |= 0b0010000; // pull down&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm afraid this doesn't work. I assume that is because these configuration bits do not apply when using the pins as SPI.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or have I made an error? &lt;/P&gt;&lt;P&gt;Any other way to make the default state of MOSI low?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 19:14:01 GMT</pubDate>
    <dc:creator>DustyStew</dc:creator>
    <dc:date>2014-12-22T19:14:01Z</dc:date>
    <item>
      <title>S12G SPI polarity control</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370720#M10695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SPI MOSI pin defaults to high. So when no data is being sent, it goes high. I would like it to be low.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I had a look at the Port Integration section of the Reference Manual, and it seemed this should be possible. The settings would be: wire-or mode, pull enabled, pulldown i.e. for MOSI on port 0:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WOMS &amp;amp;= ~0b00100000;&amp;nbsp; // set PS5 to wire-or mode&lt;/P&gt;&lt;P&gt;PERS&amp;nbsp; |= 0b00100000; // enable pull resistor on PS5&lt;/P&gt;&lt;P&gt;PPSS |= 0b0010000; // pull down&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm afraid this doesn't work. I assume that is because these configuration bits do not apply when using the pins as SPI.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or have I made an error? &lt;/P&gt;&lt;P&gt;Any other way to make the default state of MOSI low?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 19:14:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370720#M10695</guid>
      <dc:creator>DustyStew</dc:creator>
      <dc:date>2014-12-22T19:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: S12G SPI polarity control</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370721#M10696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;how have you configure the SPI module (SPICR1, SPICR2, SPIBR...) ?&lt;/P&gt;&lt;P&gt;your problem must be in the configuration of the module. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:01:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370721#M10696</guid>
      <dc:creator>steph</dc:creator>
      <dc:date>2015-01-08T15:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: S12G SPI polarity control</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370722#M10697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In SPICR1 after your SPI session is complete, set SPE to 0. This will take SPI off the buss and allow IO control over the pin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 17:30:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370722#M10697</guid>
      <dc:creator>davezawislak</dc:creator>
      <dc:date>2015-01-08T17:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: S12G SPI polarity control</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370723#M10698</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;David is right. You must disable the SPI. Also you should set the Port Data Direction Register (DDRS for example) as output. I've tested this on DEMOAX9S12XEP100 board. See screenshots below (click on them to enlarge):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Initial state. SPI module initialized, but not enabled yet. The yellow marked address in memory window shows Port S Data Register (PTS) at 0x0248, Port S Input Register (PTIS) at 0x0249 and Port S Data Direction Register (DDRS) at 0x024A address.&lt;/P&gt;&lt;P&gt;As you can see Port S is set as input and PTIS reflects the buffered state on the pin which is 0xFC (taken from the PTS register). The MOSI pin (PS5) is logic 1.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Initial Port S state.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44949i9E2BC3109BFF4DD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Initial Port S state.JPG" alt="Initial Port S state.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. SPI enabled. Port S dedicated to SPI module.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI enabled, Port S as input.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45541iA2D8E9B76A6A84F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI enabled, Port S as input.JPG" alt="SPI enabled, Port S as input.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Port S set as output. SPI still enabled. the PTIS reflect the 4 SPI pin status: MOSI and MISO are high.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PortS as output, SPI enabled.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45597iB9174DE0323ED4C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="PortS as output, SPI enabled.JPG" alt="PortS as output, SPI enabled.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. SPI disabled. Finally, PS5 (MOSI) pin is low as well as other Port S pins.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PortS as output, SPI disabled, pin low.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45730iBEE5C26BCB5E275D/image-size/large?v=v2&amp;amp;px=999" role="button" title="PortS as output, SPI disabled, pin low.JPG" alt="PortS as output, SPI disabled, pin low.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. SPI enabled again. Doublecheck the Port S status. MOSI/MISO pins are high again.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI enabled, MOSI pin high.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45855i176399E2FDDFF924/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI enabled, MOSI pin high.JPG" alt="SPI enabled, MOSI pin high.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;iggi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 14:35:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-SPI-polarity-control/m-p/370723#M10698</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2015-01-09T14:35:14Z</dc:date>
    </item>
  </channel>
</rss>

