AnsweredAssumed Answered

RT1050-EVK GPIO fast pin toggel

Question asked by danielbuergin on Jan 29, 2018
Latest reply on Feb 6, 2018 by Artur Petukhov

Hi Guys, I try to get familiar with my i.MX RT1050 EVK Board (what a beast...).

 

For that i would like to toggle a pin (GPIO_AD_B1_08) as fast as possible. With the following code i get to ~4.4Mhz.

What can i expect ?  

Is my configuration ok, or did i miss something ?

And maybe i already didn't understand bit manipulation or why does bit toggling with "GPIO1->DR ^= (24U)" not working ?

 

#include "board.h"
#include "fsl_gpio.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_common.h"
#include "fsl_iomuxc.h"

int main(void)
{
   gpio_pin_config_t tst_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};

   BOARD_ConfigMPU();
   BOARD_BootClockRUN();

   /* Init Test-Port GPIO1 Pin 24 (GPIO_AD_B1_08) */
   GPIO_PinInit(GPIO1, (24U), &tst_config);

   IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_08_GPIO1_IO24, 0xB0E9u);
   /* 0xB0E9u:
   Slew Rate Field: Fast Slew Rate
   Drive Strength Field: R0/5
   Speed Field: max(200MHz)
   Open Drain Enable Field: Open Drain Disabled
   Pull / Keep Enable Field: Pull/Keeper Enabled
   Pull / Keep Select Field: Pull
   Pull Up / Down Config. Field: 100K Ohm Pull Up
   Hyst. Enable Field: Hysteresis Disabled
   */

   while (1)
   {
      // GPIO1->DR ^= (24U); // Does not work ??
      GPIO1->DR |= (1U << (24U)); // Low
      GPIO1->DR &= ~(1U << (24U)); // High
   }
}

Any hint would be great.

 

Regards, Daniel

 

 

Outcomes