2012-10-22 04:20 AM
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:
2012-10-22 04:46 AM
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.