cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 How to get 50MHz on GPIO

SRobs.1
Associate II

I can only get the GPIO pin to toggle at 8MHz but datasheet indicates 108MHz is possible.

I tried changing OSPEEDRy[1:0] but this did not help, I only get the default 8MHz.

20 REPLIES 20
TDK
Guru

Use a timer in PWM mode to toggle it at that high of a rate.

If you feel a post has answered your question, please click "Accept as Solution".
SRobs.1
Associate II

Thanks for the swift response, but actually, I want to stream a pattern to several GPIO pins not just create a clock signal.

I'd be happy getting frequency up to 25MHz but also want to get variable lower frequencies.

You can try to use DMA, but 50MHz is probably beyond its capabilities. Or you could write your code in assembly, if that’s even possible to do in your case, to control exactly the number of cycles.
If you feel a post has answered your question, please click "Accept as Solution".
Uwe Bonnes
Principal III

Put code in the ITCM and preload adresses to write to in registers. If some address must be loaded from flash, flash wait cycles come into account

I thought I could simply change the max speed with the OSPEEDR[1:0] setting. What is it's purpose if not to allow the higher frequncies ?

Your code runs at the cpu clock speed. The ospeedr controls the drive strength on the gpio pins. Faster edges with higher speeds at the cost of more power.
If you feel a post has answered your question, please click "Accept as Solution".

I don't think I understand. I'm not accessing any memory so I don't know why the ITCM helps me. My application is to send data patterns via USB and output on GPIO.

Yes, I think I noticed a slight change in the edges but not the frequency.

Datasheet simply indicates fast I/Os up to 108MHz is possible so I assumed one clock to set and one to clear the state of the pin.

But I only get 8MHz but can get lower with clock dividers.

Am I missing something ?

Yes, it sounds like you are missing quite a bit of background and understanding in how cpus run code and how compilers and optimization work. That’s all a bit beyond the scope of a forum post.
If you feel a post has answered your question, please click "Accept as Solution".