<?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 Fastest GPT and GPIO for Cortex-M4 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Fastest-GPT-and-GPIO-for-Cortex-M4/m-p/1432711#M188529</link>
    <description>&lt;P&gt;What's the fastest timer and gpio-toggle I should be able to set on the M4 on an Imx8MM?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fastest seems to be 704 khz.&amp;nbsp; In my ISR, I change the state.&amp;nbsp; The fastest I can toggle my gpio seems to be about 460 ns.&amp;nbsp; That seems slow.&amp;nbsp; The core clock states to be 4Mhz.&amp;nbsp; Is there a dedicated clock that controls gpio?&lt;/P&gt;&lt;P&gt;My timer init is below:&lt;/P&gt;&lt;P&gt;gpt_config_t gptConfig;&lt;BR /&gt;uint32_t gptFreq;&lt;BR /&gt;&lt;BR /&gt;CLOCK_SetRootMux(kCLOCK_RootGpt1, kCLOCK_GptRootmuxSysPll1Div2); /* Set GPT1 source to SYSTEM PLL1 DIV2 400MHZ */&lt;BR /&gt;CLOCK_SetRootDivider(kCLOCK_RootGpt1, 1U, 4U); /* Set root clock to 400MHZ / 4 = 100MHZ */&lt;/P&gt;&lt;P&gt;GPT_GetDefaultConfig(&amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Initialize GPT module */&lt;BR /&gt;GPT_Init(GPT1, &amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Divide GPT clock source frequency by 3 inside GPT module */&lt;BR /&gt;GPT_SetClockDivider(GPT1, 3);&lt;/P&gt;&lt;P&gt;/* Get GPT clock frequency */&lt;BR /&gt;gptFreq = EXAMPLE_GPT_CLK_FREQ_GPT1;&lt;BR /&gt;//100,000,000 Mhz&lt;/P&gt;&lt;P&gt;/* GPT frequency is divided by 3 inside module */&lt;BR /&gt;gptFreq /= 3;&lt;BR /&gt;PRINTF("%s gptFreq %d.\r\n", __func__, gptFreq);&lt;BR /&gt;// 500 us&lt;BR /&gt;gptFreq = USEC_TO_COUNT(250, gptFreq); /* FreeRTOS tick is 1 kHz */&lt;BR /&gt;&lt;BR /&gt;//PRINTF("Starting %s %d.\r\n", __func__, gptFreq);&lt;BR /&gt;&lt;BR /&gt;/* Set both GPT modules to 1 second duration */&lt;BR /&gt;GPT_SetOutputCompareValue(GPT1, kGPT_OutputCompare_Channel1, gptFreq);&lt;/P&gt;&lt;P&gt;/* Enable GPT Output Compare1 interrupt */&lt;BR /&gt;GPT_EnableInterrupts(GPT1, kGPT_OutputCompare1InterruptEnable);&lt;/P&gt;&lt;P&gt;/* Enable at the Interrupt */&lt;BR /&gt;EnableIRQ(GPT1_IRQn);&lt;BR /&gt;&lt;BR /&gt;/* Start Timer */&lt;BR /&gt;PRINTF("\r\nStarting GPT timer ...");&lt;BR /&gt;GPT_StartTimer(GPT1);&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 15:56:11 GMT</pubDate>
    <dc:creator>ddeyo1</dc:creator>
    <dc:date>2022-03-23T15:56:11Z</dc:date>
    <item>
      <title>Fastest GPT and GPIO for Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Fastest-GPT-and-GPIO-for-Cortex-M4/m-p/1432711#M188529</link>
      <description>&lt;P&gt;What's the fastest timer and gpio-toggle I should be able to set on the M4 on an Imx8MM?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fastest seems to be 704 khz.&amp;nbsp; In my ISR, I change the state.&amp;nbsp; The fastest I can toggle my gpio seems to be about 460 ns.&amp;nbsp; That seems slow.&amp;nbsp; The core clock states to be 4Mhz.&amp;nbsp; Is there a dedicated clock that controls gpio?&lt;/P&gt;&lt;P&gt;My timer init is below:&lt;/P&gt;&lt;P&gt;gpt_config_t gptConfig;&lt;BR /&gt;uint32_t gptFreq;&lt;BR /&gt;&lt;BR /&gt;CLOCK_SetRootMux(kCLOCK_RootGpt1, kCLOCK_GptRootmuxSysPll1Div2); /* Set GPT1 source to SYSTEM PLL1 DIV2 400MHZ */&lt;BR /&gt;CLOCK_SetRootDivider(kCLOCK_RootGpt1, 1U, 4U); /* Set root clock to 400MHZ / 4 = 100MHZ */&lt;/P&gt;&lt;P&gt;GPT_GetDefaultConfig(&amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Initialize GPT module */&lt;BR /&gt;GPT_Init(GPT1, &amp;amp;gptConfig);&lt;/P&gt;&lt;P&gt;/* Divide GPT clock source frequency by 3 inside GPT module */&lt;BR /&gt;GPT_SetClockDivider(GPT1, 3);&lt;/P&gt;&lt;P&gt;/* Get GPT clock frequency */&lt;BR /&gt;gptFreq = EXAMPLE_GPT_CLK_FREQ_GPT1;&lt;BR /&gt;//100,000,000 Mhz&lt;/P&gt;&lt;P&gt;/* GPT frequency is divided by 3 inside module */&lt;BR /&gt;gptFreq /= 3;&lt;BR /&gt;PRINTF("%s gptFreq %d.\r\n", __func__, gptFreq);&lt;BR /&gt;// 500 us&lt;BR /&gt;gptFreq = USEC_TO_COUNT(250, gptFreq); /* FreeRTOS tick is 1 kHz */&lt;BR /&gt;&lt;BR /&gt;//PRINTF("Starting %s %d.\r\n", __func__, gptFreq);&lt;BR /&gt;&lt;BR /&gt;/* Set both GPT modules to 1 second duration */&lt;BR /&gt;GPT_SetOutputCompareValue(GPT1, kGPT_OutputCompare_Channel1, gptFreq);&lt;/P&gt;&lt;P&gt;/* Enable GPT Output Compare1 interrupt */&lt;BR /&gt;GPT_EnableInterrupts(GPT1, kGPT_OutputCompare1InterruptEnable);&lt;/P&gt;&lt;P&gt;/* Enable at the Interrupt */&lt;BR /&gt;EnableIRQ(GPT1_IRQn);&lt;BR /&gt;&lt;BR /&gt;/* Start Timer */&lt;BR /&gt;PRINTF("\r\nStarting GPT timer ...");&lt;BR /&gt;GPT_StartTimer(GPT1);&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:56:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Fastest-GPT-and-GPIO-for-Cortex-M4/m-p/1432711#M188529</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-03-23T15:56:11Z</dc:date>
    </item>
  </channel>
</rss>

