Skip to main content
sholojda
Associate III
August 13, 2024
Solved

STM32 CPU clock vs GPIO clock

  • August 13, 2024
  • 4 replies
  • 1443 views

Hi

what is the relationship between the speed of the CPU and the GPIO response. for example, I have a CPU clock of 72MHz and a GPIO clock of 36MHz and I set the pull-up when is this pull-up visible to the CPU because e.g. I would like to read the port value?

 

This topic has been closed for replies.
Best answer by Tesla DeLorean

Notwithstanding the bus access is going to be the order of 4 cycles.

You aren't going to be able to read the GPIO approaching 36 MHz. It does impact the resynchronizer on the pin, to pull it into that domain.

How fast the pull-up acts will depend on the capacitive load on the pin, and the size of the pull-up resistor.

You could have a more aggressive pull-up externally, and use the pin in Open-Drain

4 replies

TDK
August 13, 2024

Did you try it? Depends on the capacitance on the line, but generally it should take effect immediately.

"If you feel a post has answered your question, please click ""Accept as Solution""."
sholojda
sholojdaAuthor
Associate III
August 19, 2024

I think I was misunderstood.

I had something like that in mind for examle:
 
1. Port was set as output
2 Change port to input
3. Read input port.
 
And now ic CPU clock is  twice as fast as peripheral clock, can I read the value from the port?
 
 
 
 
 

 

 
 
 
TDK
August 19, 2024

If your question is "will be pin still be driven as output when I read the value in step 3?" then the answer is no. It may still have the same value, but the pin is now in input mode and is floating, or affected by pull resistors, or whatever else is present on the line.

I don't see the usefulness of this scenario here, but I assume this is tangential to what you're trying to achieve. If you put a sufficiently slow RC circuit on the pin, the signal will take time to change.

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