Skip to main content
himmet
Visitor II
October 22, 2012
Question

High Speed IO?? Is it really true?

  • October 22, 2012
  • 1 reply
  • 703 views
Posted on October 22, 2012 at 13:20

Hi all,

I bougth a STM32F2 evulation board and iam trying to use high speed IO's but i didnt succes. here is the code;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);

  /* Configure PG6 and PG8 in output pushpull mode */

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_8;

  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(GPIOF, &GPIO_InitStructure);

 while(1)

{

/* Set PG6 and PG8 */

    GPIOF->BSRRL = GPIO_Pin_6 | GPIO_Pin_8;

    /* Reset PG6 and PG8 */

    GPIOF->BSRRH = GPIO_Pin_6 | GPIO_Pin_8;

}

And i set the PCLK1 to 30, PCLK2 to 60MHz. My HSE is 25MHz and i see it on the MCO1 pin.

Anyway when i measure the PG6 and PG8 its frequency is just 10MHz. But i expect little higher value? Is this frequency normal? Because in the datasheet it wrotes like this;

Up to 140 I/O ports with interrupt capability:

  • Up to 136 fast I/Os up to 60 MHz

How can i get the 60MHz signal on the any GPIO pins?

Regards. 
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    October 22, 2012
    Posted on October 22, 2012 at 13:46

    You'd use a timer, or hardware resource to drive the pin.

    The GPIO isn't going to be better than 1/4 of the bus speed. You're certainly dreaming if you think you'll drive 60 MHz via software toggling.

    Speed will depend on the job the compiler does with the code, and if it optimizes well. Use efficient assembler to get the fastest most predictable timing.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..