<?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: MM9Z1_638 Microcontroller GPIOB Input Set Problem in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1344005#M6705</link>
    <description>&lt;P&gt;Hello Muhammed,&lt;/P&gt;
&lt;P&gt;I asked our specialist for help. The result is:&lt;/P&gt;
&lt;P&gt;The port bit must be written together with their mask bit = 1.&lt;/P&gt;
&lt;P&gt;If the associated mask bit = 0, the write is not allowed.&lt;/P&gt;
&lt;P&gt;The masked bits (e.g. GPIO...PE1M and GPIO...PE1) have to be written in a single access. In this case as 16bit write. Please see the attached gpio.h file also for this example:&lt;/P&gt;
&lt;P&gt;//-------------------------------------------------&lt;/P&gt;
&lt;P&gt;// enable PTB1 as output&lt;/P&gt;
&lt;P&gt;B_GPIO_CTL = GPIO_CTL_PTB1_ENABLE | GPIO_CTL_PTB1_OUTPUT;&lt;BR /&gt;B_GPIO_OUT1 = OUT_PTBx;&lt;BR /&gt;&lt;BR /&gt;// set PTB1&lt;BR /&gt;B_GPIO_OUT1 = OUT_PTBx;&lt;BR /&gt;// clear PTB1&lt;BR /&gt;B_GPIO_OUT1 = 0;&lt;/P&gt;
&lt;P&gt;//----------------------------------------------------&lt;/P&gt;
&lt;P&gt;Please see also this AN for this product:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12301.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN12301.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope it could help you with your task.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stano.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 12:18:46 GMT</pubDate>
    <dc:creator>StanoA</dc:creator>
    <dc:date>2021-09-22T12:18:46Z</dc:date>
    <item>
      <title>MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342703#M6699</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'am programming MM9Z1_638 microcontroller. I set output and input PORTA, but i don't set input GPIOB.&lt;/P&gt;&lt;P&gt;I wrote this function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;void GPIOB_Init(void)&lt;BR /&gt;{&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE1M_MASK |0);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE2M_MASK |0);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE3M_MASK |0);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE4M_MASK |0);&lt;BR /&gt;&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE1M_MASK |0);&lt;BR /&gt;&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_DIR2M_MASK|0);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE2M_MASK |B_GPIO_CTL_PE2_MASK);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_DIR3M_MASK|0);&lt;BR /&gt;B_GPIO_CTL = (B_GPIO_CTL_PE3M_MASK |B_GPIO_CTL_PE3_MASK);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_1-1632134275182.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156504i9CD7439680AD8A44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_1-1632134275182.png" alt="mfatihkoseoglu_1-1632134275182.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_2-1632134289064.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156505i1C4DBFCCE30E28CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_2-1632134289064.png" alt="mfatihkoseoglu_2-1632134289064.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i wath B_GPIO register and B_GPIO_CTL register is 0x0000.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why cant i set port and how can i use this port?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_0-1632134256163.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156503i180093A00507C206/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_0-1632134256163.png" alt="mfatihkoseoglu_0-1632134256163.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 21:32:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342703#M6699</guid>
      <dc:creator>mfatihkoseoglu</dc:creator>
      <dc:date>2026-02-03T21:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342796#M6700</link>
      <description>&lt;P&gt;Hello Muhammed,&lt;/P&gt;
&lt;P&gt;No problem, just note the B_GPIO_CTL register has different bit’s meaning from the commonly used standards.&lt;/P&gt;
&lt;P&gt;The *_MASK bits block (“0”) or allow (“1”) to write value into data bit. So if you want to have all port’s bits accessible you need use:&lt;/P&gt;
&lt;P&gt;void GPIOB_Init(void)&lt;BR /&gt;{&lt;BR /&gt;B_GPIO_CTLH = (B_GPIO_CTLH_PE1M_MASK |&amp;nbsp;&amp;nbsp; // enable write to PE1;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_PE2M_MASK |&amp;nbsp;&amp;nbsp; // enable write to PE2;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_PE3M_MASK |&amp;nbsp;&amp;nbsp; // enable write to PE3;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_PE4M_MASK |&amp;nbsp;&amp;nbsp; // enable write to PE4;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR1M_MASK |&amp;nbsp;&amp;nbsp; // enable write to DIR1;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR2M_MASK |&amp;nbsp;&amp;nbsp; // enable write to DIR2;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR3M_MASK);&amp;nbsp;&amp;nbsp; // enable write to DIR3;&lt;/P&gt;
&lt;P&gt;// and then write values to low byte of B_GPIO_CTLL register;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLL = (B_GPIO_CTLL_PE1_MASK |&amp;nbsp;&amp;nbsp; // PE1 enabled;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLL_PE2_MASK |&amp;nbsp;&amp;nbsp; // PE2 enabled;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLL_PE3_MASK |&amp;nbsp; &amp;nbsp;// PE3 enabled;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR1_MASK |&amp;nbsp;&amp;nbsp; // PE1 as output;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR2_MASK |&amp;nbsp;&amp;nbsp; // PE2 as output;&lt;/P&gt;
&lt;P&gt;B_GPIO_CTLH_DIR3_MASK );&amp;nbsp;&amp;nbsp; &amp;nbsp;// PE3 as output;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;Sorry I don’t have the board with MCU for test, but I hope my suggestion could help you.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 14:05:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342796#M6700</guid>
      <dc:creator>StanoA</dc:creator>
      <dc:date>2021-09-20T14:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342804#M6701</link>
      <description>&lt;P&gt;Hello StanoA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the way you said but it is not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My init function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not: I want to use input GPIOB pins.&amp;nbsp;&lt;/P&gt;&lt;P&gt;void GPIOB_Init(void)&lt;BR /&gt;{&lt;BR /&gt;B_GPIO_CTLH = (B_GPIO_CTLH_PE1M_MASK | B_GPIO_CTLH_PE2M_MASK | B_GPIO_CTLH_PE3M_MASK | B_GPIO_CTLH_PE4M_MASK&lt;BR /&gt;| B_GPIO_CTLH_DIR1M_MASK | B_GPIO_CTLH_DIR2M_MASK | B_GPIO_CTLH_DIR2M_MASK);&lt;BR /&gt;B_GPIO_CTLL = (B_GPIO_CTLL_PE1_MASK | B_GPIO_CTLL_PE2_MASK | B_GPIO_CTLL_PE3_MASK | B_GPIO_CTLL_PE4_MASK);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;After the work, B_GPIO_C register value is 0x0000.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_0-1632148309820.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156516i2F5960577C24B4A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_0-1632148309820.png" alt="mfatihkoseoglu_0-1632148309820.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My init function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_1-1632148344518.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156517iAEE595480915A974/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_1-1632148344518.png" alt="mfatihkoseoglu_1-1632148344518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 14:32:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1342804#M6701</guid>
      <dc:creator>mfatihkoseoglu</dc:creator>
      <dc:date>2021-09-20T14:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1343382#M6702</link>
      <description>&lt;P&gt;Hello Muhammed,&lt;/P&gt;
&lt;P&gt;Please reset the MCU in debug mode, set the breakpoint to line “for(;;) { …” and run the code. When it will stop on breakpoint read the variables:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;value&lt;/EM&gt; and &lt;EM&gt;value2.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This means select them in window:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StanoA_0-1632239299914.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156618iE9FBFB24D109D6B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StanoA_0-1632239299914.png" alt="StanoA_0-1632239299914.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And check the values.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 15:48:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1343382#M6702</guid>
      <dc:creator>StanoA</dc:creator>
      <dc:date>2021-09-21T15:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1343788#M6703</link>
      <description>&lt;P&gt;Hello StanoA,&lt;/P&gt;&lt;P&gt;I reset mcu in debug mode and set break point in for loop, i see the all values is 0.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_0-1632295513346.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156706i805F722042A807B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_0-1632295513346.png" alt="mfatihkoseoglu_0-1632295513346.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mfatihkoseoglu_1-1632295558725.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156707i00EFDCE4B9A45FD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mfatihkoseoglu_1-1632295558725.png" alt="mfatihkoseoglu_1-1632295558725.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 07:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1343788#M6703</guid>
      <dc:creator>mfatihkoseoglu</dc:creator>
      <dc:date>2021-09-22T07:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: MM9Z1_638 Microcontroller GPIOB Input Set Problem</title>
      <link>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1344005#M6705</link>
      <description>&lt;P&gt;Hello Muhammed,&lt;/P&gt;
&lt;P&gt;I asked our specialist for help. The result is:&lt;/P&gt;
&lt;P&gt;The port bit must be written together with their mask bit = 1.&lt;/P&gt;
&lt;P&gt;If the associated mask bit = 0, the write is not allowed.&lt;/P&gt;
&lt;P&gt;The masked bits (e.g. GPIO...PE1M and GPIO...PE1) have to be written in a single access. In this case as 16bit write. Please see the attached gpio.h file also for this example:&lt;/P&gt;
&lt;P&gt;//-------------------------------------------------&lt;/P&gt;
&lt;P&gt;// enable PTB1 as output&lt;/P&gt;
&lt;P&gt;B_GPIO_CTL = GPIO_CTL_PTB1_ENABLE | GPIO_CTL_PTB1_OUTPUT;&lt;BR /&gt;B_GPIO_OUT1 = OUT_PTBx;&lt;BR /&gt;&lt;BR /&gt;// set PTB1&lt;BR /&gt;B_GPIO_OUT1 = OUT_PTBx;&lt;BR /&gt;// clear PTB1&lt;BR /&gt;B_GPIO_OUT1 = 0;&lt;/P&gt;
&lt;P&gt;//----------------------------------------------------&lt;/P&gt;
&lt;P&gt;Please see also this AN for this product:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12301.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN12301.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope it could help you with your task.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 12:18:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MM9Z1-638-Microcontroller-GPIOB-Input-Set-Problem/m-p/1344005#M6705</guid>
      <dc:creator>StanoA</dc:creator>
      <dc:date>2021-09-22T12:18:46Z</dc:date>
    </item>
  </channel>
</rss>

