<?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 setting up a register in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/setting-up-a-register/m-p/1328895#M18982</link>
    <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I'm having a problem with a very simple thing - I don't know how to set up a register.&lt;/P&gt;&lt;P&gt;I need to set CAN_CTRL2[EACEN] - in CAN control register to 1.&lt;/P&gt;&lt;P&gt;The MPC5748g.h defines this register as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define CAN_CTRL2_EACEN(x)                       (((uint32_t)(((uint32_t)(x)) &amp;lt;&amp;lt; CAN_CTRL2_EACEN_SHIFT)) &amp;amp; CAN_CTRL2_EACEN_MASK)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unfortunately, I don't understand how to use the (x) here...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The manual says that the register is at FFEC_0034h, so I figured out that the workaround could be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    //set the CAN_CTRL2_EACEN to '1'
    uint32_t *reg_ptr;
    reg_ptr = 0xFFEC0034; //point to the register
    *reg_ptr = *reg_ptr | 0x1000; //set the 15th bit to '1'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Am I doing it correctly? Is there a better way to do it?&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 20:56:43 GMT</pubDate>
    <dc:creator>pmrlcbtcphtzjdq</dc:creator>
    <dc:date>2021-08-24T20:56:43Z</dc:date>
    <item>
      <title>setting up a register</title>
      <link>https://community.nxp.com/t5/MPC5xxx/setting-up-a-register/m-p/1328895#M18982</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I'm having a problem with a very simple thing - I don't know how to set up a register.&lt;/P&gt;&lt;P&gt;I need to set CAN_CTRL2[EACEN] - in CAN control register to 1.&lt;/P&gt;&lt;P&gt;The MPC5748g.h defines this register as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define CAN_CTRL2_EACEN(x)                       (((uint32_t)(((uint32_t)(x)) &amp;lt;&amp;lt; CAN_CTRL2_EACEN_SHIFT)) &amp;amp; CAN_CTRL2_EACEN_MASK)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unfortunately, I don't understand how to use the (x) here...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The manual says that the register is at FFEC_0034h, so I figured out that the workaround could be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    //set the CAN_CTRL2_EACEN to '1'
    uint32_t *reg_ptr;
    reg_ptr = 0xFFEC0034; //point to the register
    *reg_ptr = *reg_ptr | 0x1000; //set the 15th bit to '1'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Am I doing it correctly? Is there a better way to do it?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 20:56:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/setting-up-a-register/m-p/1328895#M18982</guid>
      <dc:creator>pmrlcbtcphtzjdq</dc:creator>
      <dc:date>2021-08-24T20:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: setting up a register</title>
      <link>https://community.nxp.com/t5/MPC5xxx/setting-up-a-register/m-p/1329117#M18986</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;it is just register mask definition. You can use&lt;/P&gt;&lt;P&gt;CAN_0-&amp;gt;CTRL2 |= CAN_CTRL2_EACEN(1);&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;CAN_0-&amp;gt;CTRL2 |= 0x10000;&lt;/P&gt;&lt;P&gt;to simply set EACEN bit.&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 05:36:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/setting-up-a-register/m-p/1329117#M18986</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2021-08-25T05:36:16Z</dc:date>
    </item>
  </channel>
</rss>

