cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO signal freq

francesco23
Associate II
Posted on April 27, 2006 at 12:36

GPIO signal freq

2 REPLIES 2
francesco23
Associate II
Posted on April 27, 2006 at 08:33

Hi to all,

how can I reach the maximum frequency on GPIO single signal?

In other words, if I control a LED with a GPIO signal through HIGH and LOW state for a determinate times, for reach a max frequency, which is the best instructions sequence and clock setting?

There is a other solution also without GPIO use?

I tried by setting max clock frequency and a while cycle with the below body:

{

GPIO_BitWrite(GPIO0, 0, LOW);

GPIO_BitWrite(GPIO0, 0, HIGH);

}

By this way, I reached a max frequency about 400KHz.

Thanks to all

planeetmaa
Associate II
Posted on April 27, 2006 at 12:36

Hi,

few comments,

first of all, check your compiler output. Maybe that bitwrite function generates some huge output...?

IO is located in APB bus. Check the clock frequence of that bus. There is a nice tool available for configuring clock bits (you can verify your bit setup from clock out pin of your micro):

http://mcu.st.com/mcu/download2.php?file=an2046.zip&info=STR710FZ2%20Application%20Note%20AN2046&url=http://www.st.com/stonline/products/support/micro/files/an2046.zip

Writing several IO toggle commands in series did not generate symmertrical signal for me. It seems to be, that every second write to the APB generates some additional wait cycles (around 10 according my test) (core

mailto:bus@48MHz

,

mailto:APB@24MHz

). And between these longer waits you can put some code without speed penalty.

Its your choice, but I reccommend using asm for time critical stuff.

BR, Madis