cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CPU clock vs GPIO clock

sholojda
Associate III

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4
TDK
Guru

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".

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?
 
 
 
 
 

 

 
 
 

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".

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..