<?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 Pot. problem in KSDK, fsl_gpio_driver.c, GPIO_DRV_OutputPinInit() in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Pot-problem-in-KSDK-fsl-gpio-driver-c-GPIO-DRV-OutputPinInit/m-p/402733#M1558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, found a problem in &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*FUNCTION**********************************************************************&lt;BR /&gt; *&lt;BR /&gt; * Function Name : GPIO_DRV_OutputPinInit&lt;BR /&gt; * Description&amp;nbsp;&amp;nbsp; : Initialize one GPIO output pin used by board.&lt;BR /&gt; *&lt;BR /&gt; *END**************************************************************************/&lt;BR /&gt;void GPIO_DRV_OutputPinInit(const gpio_output_pin_user_config_t *outputPin)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Get actual port and pin number.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t port = GPIO_EXTRACT_PORT(outputPin-&amp;gt;pinName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t pin = GPIO_EXTRACT_PIN(outputPin-&amp;gt;pinName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_Type * gpioBase = g_gpioBase[port];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_Type * portBase = g_portBase[port];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Un-gate port clock*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_EnablePortClock(port);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set current pin as gpio.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetMuxMode(portBase, pin, kPortMuxAsGpio);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //--- changed sequence (WritePinOutput-&amp;gt;SetPinDir) by JM 2015.10.15&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_WritePinOutput(gpioBase, pin, outputPin-&amp;gt;config.outputLogic);&lt;/P&gt;&lt;P&gt;//**** This will set output to "0" and therefore cause a glicth if configured to "1" ****//&lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set current pin as digital output.*/&lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_SetPinDir(gpioBase, pin, kGpioDigitalOutput);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Configure GPIO output features. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_WritePinOutput(gpioBase, pin, outputPin-&amp;gt;config.outputLogic);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_SLEW_RATE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetSlewRateMode(portBase, pin, outputPin-&amp;gt;config.slewRate);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetDriveStrengthMode(portBase, pin, outputPin-&amp;gt;config.driveStrength);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_OPEN_DRAIN&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetOpenDrainCmd(portBase, pin, outputPin-&amp;gt;config.isOpenDrainEnabled);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //**** This will finally set output pin - with programmed characteristics - to configured value ****//&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_SetPinDir(gpioBase, pin, kGpioDigitalOutput);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setting pin direction to output too early will cause a glitch to "0" if pin was configured to "1".&lt;BR /&gt;Also will set output not with programmed characteristics.&lt;BR /&gt;So, setting direction to output should be done at the end of this function, I think?&lt;BR /&gt;Best regards&lt;BR /&gt;Juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Oct 2015 05:46:47 GMT</pubDate>
    <dc:creator>jum</dc:creator>
    <dc:date>2015-10-16T05:46:47Z</dc:date>
    <item>
      <title>Pot. problem in KSDK, fsl_gpio_driver.c, GPIO_DRV_OutputPinInit()</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Pot-problem-in-KSDK-fsl-gpio-driver-c-GPIO-DRV-OutputPinInit/m-p/402733#M1558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, found a problem in &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*FUNCTION**********************************************************************&lt;BR /&gt; *&lt;BR /&gt; * Function Name : GPIO_DRV_OutputPinInit&lt;BR /&gt; * Description&amp;nbsp;&amp;nbsp; : Initialize one GPIO output pin used by board.&lt;BR /&gt; *&lt;BR /&gt; *END**************************************************************************/&lt;BR /&gt;void GPIO_DRV_OutputPinInit(const gpio_output_pin_user_config_t *outputPin)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Get actual port and pin number.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t port = GPIO_EXTRACT_PORT(outputPin-&amp;gt;pinName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t pin = GPIO_EXTRACT_PIN(outputPin-&amp;gt;pinName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_Type * gpioBase = g_gpioBase[port];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_Type * portBase = g_portBase[port];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Un-gate port clock*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_EnablePortClock(port);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set current pin as gpio.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetMuxMode(portBase, pin, kPortMuxAsGpio);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //--- changed sequence (WritePinOutput-&amp;gt;SetPinDir) by JM 2015.10.15&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_WritePinOutput(gpioBase, pin, outputPin-&amp;gt;config.outputLogic);&lt;/P&gt;&lt;P&gt;//**** This will set output to "0" and therefore cause a glicth if configured to "1" ****//&lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set current pin as digital output.*/&lt;BR /&gt;//****&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_SetPinDir(gpioBase, pin, kGpioDigitalOutput);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Configure GPIO output features. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_WritePinOutput(gpioBase, pin, outputPin-&amp;gt;config.outputLogic);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_SLEW_RATE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetSlewRateMode(portBase, pin, outputPin-&amp;gt;config.slewRate);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetDriveStrengthMode(portBase, pin, outputPin-&amp;gt;config.driveStrength);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #if FSL_FEATURE_PORT_HAS_OPEN_DRAIN&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetOpenDrainCmd(portBase, pin, outputPin-&amp;gt;config.isOpenDrainEnabled);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //**** This will finally set output pin - with programmed characteristics - to configured value ****//&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_SetPinDir(gpioBase, pin, kGpioDigitalOutput);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setting pin direction to output too early will cause a glitch to "0" if pin was configured to "1".&lt;BR /&gt;Also will set output not with programmed characteristics.&lt;BR /&gt;So, setting direction to output should be done at the end of this function, I think?&lt;BR /&gt;Best regards&lt;BR /&gt;Juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 05:46:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Pot-problem-in-KSDK-fsl-gpio-driver-c-GPIO-DRV-OutputPinInit/m-p/402733#M1558</guid>
      <dc:creator>jum</dc:creator>
      <dc:date>2015-10-16T05:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pot. problem in KSDK, fsl_gpio_driver.c, GPIO_DRV_OutputPinInit()</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Pot-problem-in-KSDK-fsl-gpio-driver-c-GPIO-DRV-OutputPinInit/m-p/402734#M1559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juergen,&lt;/P&gt;&lt;P&gt;Good observation and I think re-ordering the configuration could eliminate the glitch.&lt;/P&gt;&lt;P&gt;I have submitted this post to our KSDK development team for review.&lt;/P&gt;&lt;P&gt;Thank you for posting.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;P&gt;Reference:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="icon-success aui-icon" style="text-indent: -999em; color: #333333; font-family: Arial, sans-serif; background-position: no-repeat;"&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: Arial, sans-serif; background-color: #f3f9f4;"&gt;Issue &lt;/SPAN&gt;&lt;A class="issue-created-key issue-link" data-issue-key="KPSDK-7318" href="http://sw-jira.freescale.net/browse/KPSDK-7318" style="color: #3b73af; font-family: Arial, sans-serif;"&gt;KPSDK-7318 - fls_gpio_driver.c output pin enabling has glitch on pin&lt;/A&gt;&lt;SPAN style="color: #333333; font-family: Arial, sans-serif; background-color: #f3f9f4;"&gt; has been successfully created.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:41:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Pot-problem-in-KSDK-fsl-gpio-driver-c-GPIO-DRV-OutputPinInit/m-p/402734#M1559</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-10-16T14:41:16Z</dc:date>
    </item>
  </channel>
</rss>

