<?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: How to initialize the spi2 function of the MC9S12XEP100?</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-spi2-function-of-the-MC9S12XEP100/m-p/802012#M15726</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;Please refer to&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-95116"&gt;S12X Examples Pack&lt;/A&gt;. There are the examples for the S12XEP100 - SPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2018 14:36:33 GMT</pubDate>
    <dc:creator>dianabatrlova</dc:creator>
    <dc:date>2018-09-11T14:36:33Z</dc:date>
    <item>
      <title>How to initialize the spi2 function of the MC9S12XEP100?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-spi2-function-of-the-MC9S12XEP100/m-p/802011#M15725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to initialize the spi2 function of the MC9S12XEP100, I have initialized the initialization spi0 and spi1, but when I initialize spi2, there is no way to initialize successfully using the same method. I suspect that the values of some registers are not set, so I would like to consult. Below is my code.&lt;/P&gt;&lt;P&gt;void SPI2_Init(void)&lt;BR /&gt;{ &lt;BR /&gt; DDRT = 0xff;&lt;BR /&gt; DDRH_DDRH7 = 1;&lt;BR /&gt; MODRR_MODRR6 = 1; &lt;BR /&gt; SPI2CR1 = 0x5e; //使能SPI，禁止中断，时钟高有效，相位为0；&lt;BR /&gt; SPI2CR2 = 0x10; //SS管脚为普通I/O，双向模式,16bit；&lt;BR /&gt; SPI2BR = 0x42; //设置SPI时钟频率为42 1 41 2 40 4MHz; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;unsigned char SPI0_Read_Byte(void)&lt;BR /&gt;{ &lt;BR /&gt; while (!SPI2SR_SPTEF); //等待发送器空&lt;BR /&gt; (void)SPI2SR; &lt;BR /&gt; SPI2DRL = 0xff; &lt;BR /&gt; while (!SPI2SR_SPIF); //等待发送完成&lt;BR /&gt; (void)SPI2SR;&lt;BR /&gt; (void)SPI2DRL;&lt;BR /&gt; return SPI2DRL; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void SPI0_Send_Byte(unsigned char val)&lt;BR /&gt;{&lt;BR /&gt; while (!SPI2SR_SPTEF); //等待发送器空 &lt;BR /&gt; (void)SPI2SR; &lt;BR /&gt; SPI2DRL = val; &lt;BR /&gt; while (!SPI2SR_SPIF); //等待发送完成 &lt;BR /&gt; (void)SPI2SR;&lt;BR /&gt; (void)SPI2DRL; &lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2018 11:44:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-spi2-function-of-the-MC9S12XEP100/m-p/802011#M15725</guid>
      <dc:creator>于志明</dc:creator>
      <dc:date>2018-09-07T11:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the spi2 function of the MC9S12XEP100?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-spi2-function-of-the-MC9S12XEP100/m-p/802012#M15726</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;Please refer to&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-95116"&gt;S12X Examples Pack&lt;/A&gt;. There are the examples for the S12XEP100 - SPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 14:36:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-spi2-function-of-the-MC9S12XEP100/m-p/802012#M15726</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2018-09-11T14:36:33Z</dc:date>
    </item>
  </channel>
</rss>

