<?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>8-bit Microcontrollers中的主题 how to define a byte data for bit addressable?</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138269#M4935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;hi all,&lt;/DIV&gt;&lt;DIV&gt;i am the newbie of the Freescale MCU and trying to learn it base on the DEMO9S08QQ8 demo board.&lt;/DIV&gt;&lt;DIV&gt;how to define a byte that stores the status(or control)&amp;nbsp;flag and access the bit independently?&lt;/DIV&gt;&lt;DIV&gt;like Bit7=LED7,Bit6=LED6...&lt;/DIV&gt;&lt;DIV&gt;then&lt;/DIV&gt;&lt;DIV&gt;LED7=1&lt;/DIV&gt;&lt;DIV&gt;LED6=0....etc..&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thank you for your kindly help.&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by eos33 on &lt;SPAN class="date_text"&gt;06-05-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:15 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jun 2006 09:13:45 GMT</pubDate>
    <dc:creator>eos33</dc:creator>
    <dc:date>2006-06-06T09:13:45Z</dc:date>
    <item>
      <title>how to define a byte data for bit addressable?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138269#M4935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;hi all,&lt;/DIV&gt;&lt;DIV&gt;i am the newbie of the Freescale MCU and trying to learn it base on the DEMO9S08QQ8 demo board.&lt;/DIV&gt;&lt;DIV&gt;how to define a byte that stores the status(or control)&amp;nbsp;flag and access the bit independently?&lt;/DIV&gt;&lt;DIV&gt;like Bit7=LED7,Bit6=LED6...&lt;/DIV&gt;&lt;DIV&gt;then&lt;/DIV&gt;&lt;DIV&gt;LED7=1&lt;/DIV&gt;&lt;DIV&gt;LED6=0....etc..&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thank you for your kindly help.&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by eos33 on &lt;SPAN class="date_text"&gt;06-05-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:15 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2006 09:13:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138269#M4935</guid>
      <dc:creator>eos33</dc:creator>
      <dc:date>2006-06-06T09:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to define a byte data for bit addressable?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138270#M4936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Are you working in C or assembly?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2006 10:28:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138270#M4936</guid>
      <dc:creator>rhinoceroshead</dc:creator>
      <dc:date>2006-06-06T10:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to define a byte data for bit addressable?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138271#M4937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;If you were assembly programming, there are instructions to do bit manipulations directly, however I assume you will be working in C where the situation is a little more complex.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Firstly, if you are referencing any of the defined I/O registers for the device, CW has already done the preparation (within the file MC9S08QG8.h), so the following would work -&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;#define LED6&amp;nbsp; PTBD_PTBD6&lt;BR /&gt;#define LED7&amp;nbsp; PTBD_PTBD7&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LED6 = 1;&lt;BR /&gt;LED7 = 0;&lt;BR /&gt;if (LED6 == 1) {&lt;BR /&gt;&lt;BR /&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;etc.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;If you are creating your own&amp;nbsp;status register in RAM, you will need to do the setup yourself.&amp;nbsp; The following example uses a similar method to the CW header file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;/* LDSTAT - LED Status register */&lt;BR /&gt;typedef union {&lt;BR /&gt;&amp;nbsp;byte Byte;&lt;BR /&gt;&amp;nbsp;struct {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte LED6&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte LED7&amp;nbsp;&amp;nbsp; :1;&lt;BR /&gt;&amp;nbsp;} Bits;&lt;BR /&gt;} LDSTATSTR;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LDSTATSTR _LEDSTAT;&lt;BR /&gt;#define LDSTAT&amp;nbsp;&amp;nbsp;_LDSTAT.Byte&lt;BR /&gt;#define LED6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_LDSTAT.Bits.LED6&lt;BR /&gt;#define LED7&amp;nbsp;&amp;nbsp;&amp;nbsp; _LDSTAT.Bits.LED7&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Arial"&gt;Regards,&lt;BR /&gt;Mac&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2006 11:34:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138271#M4937</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-06-06T11:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to define a byte data for bit addressable?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138272#M4938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;hi all,&lt;/DIV&gt;&lt;DIV&gt;i am working in C.&lt;/DIV&gt;&lt;DIV&gt;refer to bigmac's example i have done it and really works fine.&lt;/DIV&gt;&lt;DIV&gt;thank you..&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:26:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/how-to-define-a-byte-data-for-bit-addressable/m-p/138272#M4938</guid>
      <dc:creator>eos33</dc:creator>
      <dc:date>2006-06-07T14:26:21Z</dc:date>
    </item>
  </channel>
</rss>

