<?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のトピックFailed to write SCI register</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798254#M15686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm configuring the register of SCI about MC9S12G128 now. For easy to call the function of SCI0, SCI1 and SCI2, I declare a SCIx_TypeDef type of structure whose member variables are mapped with registers.&lt;BR /&gt; &lt;BR /&gt;/* SCIx register base address */&lt;BR /&gt;#define SCI0 ((SCIx_TypeDef*)(0x000000C8UL))&lt;BR /&gt;#define SCI1 ((SCIx_TypeDef*)(0x000000D0UL))&lt;BR /&gt;#define SCI2 ((SCIx_TypeDef*)(0x000000E8UL))&lt;BR /&gt; &lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;volatile SCIBDSTR _BD;&lt;BR /&gt;volatile SCIACR2STR _ACR2; &lt;BR /&gt;volatile SCICR2STR _CR2;&lt;BR /&gt;volatile SCISR1STR _SR1;&lt;BR /&gt;volatile SCISR2STR _SR2;&lt;BR /&gt;volatile SCIDRHSTR _DRH;&lt;BR /&gt;volatile SCIDRLSTR _DRL; &lt;BR /&gt;}SCIx_TypeDef;&lt;BR /&gt; &lt;BR /&gt;New a header file named SCI.h that is in the attachment, redeclare registers map that can be shared by SCI0, SCI1 and SCI2.&lt;BR /&gt; &lt;BR /&gt;Then I write three functions for the test and the debug result is shown in an attachment.&lt;BR /&gt; &lt;BR /&gt;void SCI_IrDAconfig_1(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD_IREN = 1;&lt;/P&gt;&lt;P&gt;SCIx-&amp;gt;BD_TNP0 = 1;&lt;BR /&gt;SCIx-&amp;gt;BD_TNP1 = 1; &lt;BR /&gt;}&lt;BR /&gt;void SCI_IrDAconfig_2(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD_IREN = 1;&lt;/P&gt;&lt;P&gt;SCIx-&amp;gt;BD_TNP = 0x3; &lt;BR /&gt;}&lt;BR /&gt;void SCI_IrDAconfig_3(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD = 0xe000; &lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;It seems that write a word(16-bit) or 2-bit operation is successful but write 1-bit operation is failed.&lt;BR /&gt;Why is that? Please give me some support. Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2018 14:08:09 GMT</pubDate>
    <dc:creator>jeffcharles</dc:creator>
    <dc:date>2018-06-19T14:08:09Z</dc:date>
    <item>
      <title>Failed to write SCI register</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798254#M15686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm configuring the register of SCI about MC9S12G128 now. For easy to call the function of SCI0, SCI1 and SCI2, I declare a SCIx_TypeDef type of structure whose member variables are mapped with registers.&lt;BR /&gt; &lt;BR /&gt;/* SCIx register base address */&lt;BR /&gt;#define SCI0 ((SCIx_TypeDef*)(0x000000C8UL))&lt;BR /&gt;#define SCI1 ((SCIx_TypeDef*)(0x000000D0UL))&lt;BR /&gt;#define SCI2 ((SCIx_TypeDef*)(0x000000E8UL))&lt;BR /&gt; &lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;volatile SCIBDSTR _BD;&lt;BR /&gt;volatile SCIACR2STR _ACR2; &lt;BR /&gt;volatile SCICR2STR _CR2;&lt;BR /&gt;volatile SCISR1STR _SR1;&lt;BR /&gt;volatile SCISR2STR _SR2;&lt;BR /&gt;volatile SCIDRHSTR _DRH;&lt;BR /&gt;volatile SCIDRLSTR _DRL; &lt;BR /&gt;}SCIx_TypeDef;&lt;BR /&gt; &lt;BR /&gt;New a header file named SCI.h that is in the attachment, redeclare registers map that can be shared by SCI0, SCI1 and SCI2.&lt;BR /&gt; &lt;BR /&gt;Then I write three functions for the test and the debug result is shown in an attachment.&lt;BR /&gt; &lt;BR /&gt;void SCI_IrDAconfig_1(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD_IREN = 1;&lt;/P&gt;&lt;P&gt;SCIx-&amp;gt;BD_TNP0 = 1;&lt;BR /&gt;SCIx-&amp;gt;BD_TNP1 = 1; &lt;BR /&gt;}&lt;BR /&gt;void SCI_IrDAconfig_2(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD_IREN = 1;&lt;/P&gt;&lt;P&gt;SCIx-&amp;gt;BD_TNP = 0x3; &lt;BR /&gt;}&lt;BR /&gt;void SCI_IrDAconfig_3(SCIx_TypeDef* SCIx)&lt;BR /&gt;{&lt;BR /&gt;SCIx-&amp;gt;BD = 0xe000; &lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;It seems that write a word(16-bit) or 2-bit operation is successful but write 1-bit operation is failed.&lt;BR /&gt;Why is that? Please give me some support. Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:08:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798254#M15686</guid>
      <dc:creator>jeffcharles</dc:creator>
      <dc:date>2018-06-19T14:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to write SCI register</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798255#M15687</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;Structs and bitfields are not portable. It seems&amp;nbsp;you like them so much, OK, but you forgot to copy paste few&amp;nbsp;important lines from mc9s12g128.h:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at top:&lt;/P&gt;&lt;P&gt;#pragma OPTION ADD V30toV31Compatible "-BfaGapLimitBits4294967295" /*this guarantee correct bitfield positions*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at bottom:&lt;/P&gt;&lt;P&gt;#ifndef __V30COMPATIBLE__&lt;BR /&gt;#pragma OPTION DEL V30toV31Compatible&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please add these to your sci.h and check if it helps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2018 08:45:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798255#M15687</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2018-06-21T08:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to write SCI register</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798256#M15688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Edward,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I tried to add them to my sci.h and the debug result accords with the expectation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2018 03:18:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Failed-to-write-SCI-register/m-p/798256#M15688</guid>
      <dc:creator>jeffcharles</dc:creator>
      <dc:date>2018-06-27T03:18:29Z</dc:date>
    </item>
  </channel>
</rss>

