<?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 Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608056#M35883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These functions come from inside the MKL03Z4_extension.h file which is found in the C:\Freescale\KSDK_1.3.0\platform\devices\MKL03Z4\include directory. The way I understand it, these are the functions that you use if you don’t want to use the predefined higher level functions and would rather update the registers and bits yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that the BWR and BRD uses the BME macros to set the register instead of a direct setting of the register. Not sure what the difference is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara Stout-Grandy, M.Eng., Ph.D., P.Eng.&lt;/P&gt;&lt;P&gt;Senior Hardware Designer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20 Angus Morton Dr., Bedford,&lt;/P&gt;&lt;P&gt;NS, Canada, B4B 0L9&lt;/P&gt;&lt;P&gt;902-450-1700, x278&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Mar 2017 13:41:48 GMT</pubDate>
    <dc:creator>sarastout-grand</dc:creator>
    <dc:date>2017-03-03T13:41:48Z</dc:date>
    <item>
      <title>FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608054#M35881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In writing to the various registers, there appears to be two ways to do it, using BWR and WR. The same is true when reading from them. An example:&lt;/P&gt;&lt;P&gt;TPM_BWR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;TPM_WR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between these two lines? I don't see a difference in the debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 21:25:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608054#M35881</guid>
      <dc:creator>sarastout-grand</dc:creator>
      <dc:date>2017-02-28T21:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608055#M35882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sar Stout-Grandy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Could you tell me where you find these two lines? The official code?&lt;/P&gt;&lt;P&gt;TPM_BWR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;TPM_WR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;You can open the function definition to check the difference.&lt;/P&gt;&lt;P&gt;You also can post these two function definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Mar 2017 02:25:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608055#M35882</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-03T02:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608056#M35883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These functions come from inside the MKL03Z4_extension.h file which is found in the C:\Freescale\KSDK_1.3.0\platform\devices\MKL03Z4\include directory. The way I understand it, these are the functions that you use if you don’t want to use the predefined higher level functions and would rather update the registers and bits yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that the BWR and BRD uses the BME macros to set the register instead of a direct setting of the register. Not sure what the difference is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara Stout-Grandy, M.Eng., Ph.D., P.Eng.&lt;/P&gt;&lt;P&gt;Senior Hardware Designer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20 Angus Morton Dr., Bedford,&lt;/P&gt;&lt;P&gt;NS, Canada, B4B 0L9&lt;/P&gt;&lt;P&gt;902-450-1700, x278&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Mar 2017 13:41:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608056#M35883</guid>
      <dc:creator>sarastout-grand</dc:creator>
      <dc:date>2017-03-03T13:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608057#M35884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sara Stout-Grandy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now let me tell you the details:&lt;/P&gt;&lt;P&gt;TPM_BWR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;TPM_WR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;All the above code is used to set the CSOO bit to a new value.&lt;/P&gt;&lt;P&gt;(1)TPM_WR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;#define TPM_WR_CONF_CSOO(base, value) (TPM_WR_CONF(base, (TPM_RD_CONF(base) &amp;amp; ~TPM_CONF_CSOO_MASK) | TPM_CONF_CSOO(value)))&lt;/P&gt;&lt;P&gt;#define TPM_WR_CONF(base, value) (TPM_CONF_REG(base) = (value))&lt;/P&gt;&lt;P&gt;Use normal C code to define the TPMx_CONF[CSOO] bit to a new value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2)TPM_WR_CONF_CSOO(tpmbase, 0);&lt;/P&gt;&lt;P&gt;#define TPM_BWR_CONF_CSOO(base, value) (BME_BFI32(&amp;amp;TPM_CONF_REG(base), ((uint32_t)(value) &amp;lt;&amp;lt; TPM_CONF_CSOO_SHIFT), TPM_CONF_CSOO_SHIFT, TPM_CONF_CSOO_WIDTH))&lt;/P&gt;&lt;P&gt;#define BME_BFI32(addr, wdata, bit, width) (*(volatile uint32_t*)((uintptr_t)addr | BME_BFI_MASK(bit,width)) = wdata)&lt;/P&gt;&lt;P&gt;Use the BME code BFI function to define TPMx_CONF[CSOO] bit to a new value.&lt;/P&gt;&lt;P&gt;Normally, use BME code will caused less time than the Normal C code, you can run the KL25 BME code find the detail difference:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/assets/downloads/data/en/lab-test-software/KL25_SC.exe" title="http://www.nxp.com/assets/downloads/data/en/lab-test-software/KL25_SC.exe"&gt;http://www.nxp.com/assets/downloads/data/en/lab-test-software/KL25_SC.exe&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Folder: kl25_sc_rev10\klxx-sc-baremetal\build\iar\LQRUG_bme_ex1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14720i03969604B88C2D23/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can find, use the normally C, the same function will caused 0x1b systick counts, but use the BFI code, it only caused 0x16 sysick counts.&lt;/P&gt;&lt;P&gt;In conclusion, BME code save cpu execution time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 03:05:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608057#M35884</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-06T03:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608058#M35885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kerry, that helps greatly! I now understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara Stout-Grandy, M.Eng., Ph.D., P.Eng.&lt;/P&gt;&lt;P&gt;Senior Hardware Designer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20 Angus Morton Dr., Bedford,&lt;/P&gt;&lt;P&gt;NS, Canada, B4B 0L9&lt;/P&gt;&lt;P&gt;902-450-1700, x278&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 13:14:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608058#M35885</guid>
      <dc:creator>sarastout-grand</dc:creator>
      <dc:date>2017-03-06T13:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z in KDS: Difference between BWR &amp; WR?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608059#M35886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sara Stout-Grandy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; OK, if your question is solved, please help to mark the correct answer, just to close this question.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 01:44:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-in-KDS-Difference-between-BWR-WR/m-p/608059#M35886</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-07T01:44:25Z</dc:date>
    </item>
  </channel>
</rss>

