<?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>Kinetis MicrocontrollersのトピックRe: GPCLR_WR does not work???</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377008#M19856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pietro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPCLR is define the bits[15:0] of PORTx_PCRn, it includes pin mux control , pull select, pull enable,etc.&lt;/P&gt;&lt;P&gt;Did you configure your PTC7,PTC8,PTC9 as GPIO(MUX = 1), please check the according register:PORTC_PCR7,PORTC_PCR8,PORTC_PCT9.&lt;/P&gt;&lt;P&gt;Besides, check your GPIOC_PDDR, GPIOC_PDOR, whether you configure it as the output, and the pin out voltage is correct or not.&lt;/P&gt;&lt;P&gt;please give me your register debug picture, and your testing project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jingjing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jan 2015 03:36:03 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2015-01-28T03:36:03Z</dc:date>
    <item>
      <title>GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377005#M19853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning.&lt;/P&gt;&lt;P&gt;I am trying to use the&amp;nbsp; &lt;SPAN style="font-size: 13.63636302948px;"&gt;HW_PORT_GPCLR_WR without success.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In this stub of code the &lt;SPAN style="font-size: 13.63636302948px;"&gt;kGpioEncMux2 &lt;SPAN style="font-size: 13.63636302948px;"&gt;kGpioEncMux1 &lt;SPAN style="font-size: 13.63636302948px;"&gt;kGpioEncMux0 are the bit 9 8 7 of the PORTC.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="font-size: 13.63636302948px;"&gt;GPIO_HAL_WritePinOutput&amp;nbsp; works, but if I try to use the &lt;SPAN style="font-size: 13.63636302948px;"&gt;HW_PORT_GPCLR_WR it does not...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The bit of the register appear to be correct, but the output is different.&lt;/P&gt;&lt;P&gt;Suggestions???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef union _mux_bits_t&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t sp : 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t mux : 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t sp2 : 22;&lt;/P&gt;&lt;P&gt;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t sp3 : 23;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t muxact : 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t sp4 : 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t val;&lt;/P&gt;&lt;P&gt;} avago_mux_bits_t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avago_mux_bits_t mux_bits = { 0 };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void inline static avago_mux_out( uint8_t muxval )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; muxval ^= 0xFF; // just negate for the ULN open collector&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; mux_bits.mux = muxval;&lt;/P&gt;&lt;P&gt;&amp;nbsp; mux_bits.muxact = 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp; HW_PORT_GPCLR_WR( g_portBaseAddr[ GPIO_EXTRACT_PORT(kGpioEncMux2) ], mux_bits.val );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_HAL_WritePinOutput( g_gpioBaseAddr[ GPIO_EXTRACT_PORT( kGpioEncMux2 ) ], GPIO_EXTRACT_PIN( kGpioEncMux2 ), muxval &amp;amp; 4 );&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_HAL_WritePinOutput( g_gpioBaseAddr[ GPIO_EXTRACT_PORT( kGpioEncMux1 ) ], GPIO_EXTRACT_PIN( kGpioEncMux1 ), muxval &amp;amp; 2 );&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_HAL_WritePinOutput( g_gpioBaseAddr[ GPIO_EXTRACT_PORT( kGpioEncMux0 ) ], GPIO_EXTRACT_PIN( kGpioEncMux0 ), muxval &amp;amp; 1 );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 13:49:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377005#M19853</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-01-26T13:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377006#M19854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pietro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could you tell me the full name of your chp and where&amp;nbsp; you get the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can control the PORTx_GPCLR and PORTx_GPCHR register directly,&amp;nbsp; this will work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Waiting for your reply!&lt;/P&gt;&lt;P&gt;Jingjing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 05:25:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377006#M19854</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2015-01-27T05:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377007#M19855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hei Jingjing&lt;/P&gt;&lt;P&gt;Thank You for follow up.&lt;/P&gt;&lt;P&gt;I am using the FRDM K64. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope You can solve the arcan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 07:24:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377007#M19855</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-01-27T07:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377008#M19856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pietro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPCLR is define the bits[15:0] of PORTx_PCRn, it includes pin mux control , pull select, pull enable,etc.&lt;/P&gt;&lt;P&gt;Did you configure your PTC7,PTC8,PTC9 as GPIO(MUX = 1), please check the according register:PORTC_PCR7,PORTC_PCR8,PORTC_PCT9.&lt;/P&gt;&lt;P&gt;Besides, check your GPIOC_PDDR, GPIOC_PDOR, whether you configure it as the output, and the pin out voltage is correct or not.&lt;/P&gt;&lt;P&gt;please give me your register debug picture, and your testing project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jingjing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 03:36:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377008#M19856</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2015-01-28T03:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377009#M19857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pietro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I check your code which you past,&lt;/P&gt;&lt;P&gt;&amp;nbsp; HW_PORT_GPCLR_WR( g_portBaseAddr[ GPIO_EXTRACT_PORT(kGpioEncMux2) ], mux_bits.val );&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is not correct, because HW_PORT_GPCLR_WR definition is like following in our KSDK:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define HW_PORT_GPCLR_ADDR(x)&lt;/TD&gt;&lt;TD&gt;((uint32_t)(x) + 0x80U)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define HW_PORT_GPCLR(x)&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;(*(__O hw_port_gpclr_t *) HW_PORT_GPCLR_ADDR(x))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#define HW_PORT_GPCLR_RD(x)&lt;/TD&gt;&lt;TD&gt;(HW_PORT_GPCLR(x).U)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;#define HW_PORT_GPCLR_WR(x, v)&amp;nbsp; (HW_PORT_GPCLR(x).U = (v))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x: is the base address of PORTC, it is&amp;nbsp; 0x4004_B000. then x+0x80 =0x4004_B080&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/49698iAA2DBC946C833791/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you should configure it like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp; HW_PORT_GPCLR_WR(PORTC_BASE,0X03800103 );&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will configure the PORTC_PCR7, PORTC_PCR8 and PORTC_PCR9.&lt;/P&gt;&lt;P&gt;I test it, it can works ok on my side with &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;HW_PORT_GPCLR_WR(PORTC_BASE,0X03800103 ); &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Following are my test result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;(1)Before run :&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;HW_PORT_GPCLR_WR(PORTC_BASE,0X03800103 );&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="3.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/49699iD9EDDCC379E02EF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.jpg" alt="3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(2) After run :&lt;SPAN style="color: #000000;"&gt;:&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;HW_PORT_GPCLR_WR(PORTC_BASE,0X03800103 );&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="4.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/49700i77E477E3F7D08FBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.jpg" alt="4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, please modify your code and test again.&lt;/P&gt;&lt;P&gt;Any question, please contact me!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&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>Wed, 28 Jan 2015 05:13:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377009#M19857</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2015-01-28T05:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: GPCLR_WR does not work???</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377010#M19858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appreciate the effort. I am not able to make it work. I need to give up for now I can live with normal writing.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 09:58:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPCLR-WR-does-not-work/m-p/377010#M19858</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-01-28T09:58:24Z</dc:date>
    </item>
  </channel>
</rss>

