AnsweredAssumed Answered

High frequency GPIO

Question asked by fast.andslow on Dec 3, 2013
Latest reply on Dec 5, 2013 by Clive One
Hello, i'm using STM32F4 Discovery board. I need a GPIO pin oscillating as fast as possible.
With the code bellow I get just 3 Mhz (measured with digital probe), but I suppose there are ways to get it to much higher frequencies. Please advice !!!!



  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

  uint16_t pin = GPIO_Pin_7;

  GPIO_InitStructure.GPIO_Pin = pin;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOD, &GPIO_InitStructure);

  while (1)
  {

    GPIO_SetBits(GPIOD, pin);
    GPIO_ResetBits(GPIOD, pin);
    
  }


Outcomes