2006-04-27 03:36 AM
2006-04-26 11:33 PM
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 all2006-04-27 03:36 AM
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) (coremailto: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