<?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: LPC11xx ADCInit confusion in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533656#M10686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tha on Tue Feb 12 13:54:37 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is mainly a coding choice.&amp;nbsp; Some people like to clear all the bits first before setting them.&amp;nbsp; This usually done for a just in case scenario.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:33:37 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:33:37Z</dc:date>
    <item>
      <title>LPC11xx ADCInit confusion</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533655#M10685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Tue Feb 12 10:01:01 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The below code snippet is from the ADCInit function in the adc example.&amp;nbsp; Don't understand why the first two instructions (&amp;amp;=, |=) exist.&amp;nbsp; Why not just do the =?&amp;nbsp; Is this just a copy and paste issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_IOCON-&amp;gt;R_PIO0_11 &amp;amp;= ~0x8F; /*&amp;nbsp; ADC I/O config */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_IOCON-&amp;gt;R_PIO0_11 |= 0x02;&amp;nbsp; /* ADC IN0 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_IOCON-&amp;gt;R_PIO0_11&amp;nbsp;&amp;nbsp; = 0x02;// Select AD0 pin function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533655#M10685</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11xx ADCInit confusion</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533656#M10686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tha on Tue Feb 12 13:54:37 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is mainly a coding choice.&amp;nbsp; Some people like to clear all the bits first before setting them.&amp;nbsp; This usually done for a just in case scenario.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533656#M10686</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11xx ADCInit confusion</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533657#M10687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Sat Feb 16 00:42:14 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;"|=" makes sure you are only touching the bits you are setting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"=" touches ALL the bits.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I personally use the |= to avoid accidental bit overwriting... It's a good practice and can save you tons of debugging...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533657#M10687</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11xx ADCInit confusion</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533658#M10688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Sat Feb 16 09:32:47 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course I understand specific bit manipulation.&amp;nbsp; My original query was to question why the the example code cleared the range (&amp;amp;= ~), set specific bits (|=), and then did an assignment (=) all on the same register.&amp;nbsp; I am new to the M0 and didn't know if there was some magical order things needed to be done.&amp;nbsp; I can see clearly now.&amp;nbsp; Thanks for the replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-ADCInit-confusion/m-p/533658#M10688</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:39Z</dc:date>
    </item>
  </channel>
</rss>

