<?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: Clear a GPIO Pin in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254909#M11619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That did work for setting a bit. For clearing a bit I had to change the header file as CLRTJ_CLRTJ5_BITMASK was defined as 0x20 instead of 0xdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blake&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2013 18:10:21 GMT</pubDate>
    <dc:creator>blakehodder</dc:creator>
    <dc:date>2013-02-12T18:10:21Z</dc:date>
    <item>
      <title>Clear a GPIO Pin</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254905#M11615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using CW 10.3 for the MCF52255. When I attempt&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SETTJ_SETTJ5_BITMASK=1;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLRTJ_CLRTJ5_BITMASK=0;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the error "not an lvalue".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do set and clear this pin without using MQX.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Blake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 15:12:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254905#M11615</guid>
      <dc:creator>blakehodder</dc:creator>
      <dc:date>2013-02-11T15:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a GPIO Pin</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254906#M11616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to add, I can set or clear the entire port if I use SETTJ=1 or CLRTJ=0 but I cannot set a specific bit within that port.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hints on how to accomplish this or as to why it does not work?&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;Blake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 17:51:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254906#M11616</guid>
      <dc:creator>blakehodder</dc:creator>
      <dc:date>2013-02-11T17:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a GPIO Pin</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254907#M11617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a CodeWarrior question, so you could ask the question in that forum. You should also look for example code that uses those registers so you can copy working code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you're familiar with 8-bit CPUs that have bit-set and bit-clear instructions that work on I/O pins, and are looking for an equivalent instruction in this one? The ColdFire CPU does have BSET and BCLR instructions, but that is a slow way to change an I/O pin. The Port Set and Clear registers are a faster way to set and clear pins, that's why they're there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next thing you should when you get this sort of error from the compiler do is to search in the provided header files for the definition of "SETTJ_SETTJ5_BITMASK" to find out what actual code the preprocessor is generation. My guess (I don't have CodeWarrior) is that it will be defined to something like "(1 &amp;lt;&amp;lt; 5)" or 0x20. And because you have to write zeros to the bits in CLRTJ to clear bits (and ones to every other bit) I'd guess CLRTJ_CLRTJ5_BITMASK is defined as "~(1 &amp;lt;&amp;lt; 5)" or 0xdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read "15.6.3 Port Pin Data/Set Data Registers (PORTnP/SETn)" in the Reference Manual. In there it tells you to write an 8-bit value to the SETTJ port, and that bits written as "1" will set the port bits. Likewise 0's written to CLRTJ will clear a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So writing "1" to it should set the bottom bit, and not all 8. I'd guess the way you're meant to use those definitions is to write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SETTJ = SETTJ_SETTJ5_BITMASK;&lt;/P&gt;&lt;P&gt;CLRTJ = CLRTJ_CLRTJ5_BITMASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 22:44:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254907#M11617</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2013-02-11T22:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a GPIO Pin</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254908#M11618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the code I used in an actual CW project:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCF_GPIO_SETTJ = MCF_GPIO_PORTTJ_PORTTJ5 ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set a bit &lt;/P&gt;&lt;P&gt;MCF_GPIO_CLRTJ &amp;amp;= ~MCF_GPIO_PORTTJ_PORTTJ5 ;&amp;nbsp; // Clear the bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that was 10.2, not sure where your defines are coming from. These are from MCF52255_GPIO.h.&lt;/P&gt;&lt;P&gt;Also not sure why you would use a define like MCF_GPIO_PORTTJ_PORTTJ5 as it really has no logical meaning and it not any better than 0x20.&lt;/P&gt;&lt;P&gt;I would use somethhing like DATA_STROBE or what ever that line is doing in the design.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 01:16:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254908#M11618</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2013-02-12T01:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Clear a GPIO Pin</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254909#M11619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That did work for setting a bit. For clearing a bit I had to change the header file as CLRTJ_CLRTJ5_BITMASK was defined as 0x20 instead of 0xdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blake&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 18:10:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Clear-a-GPIO-Pin/m-p/254909#M11619</guid>
      <dc:creator>blakehodder</dc:creator>
      <dc:date>2013-02-12T18:10:21Z</dc:date>
    </item>
  </channel>
</rss>

