cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing the clocks of two STM32s

coderduder
Associate

Hello,

I have two stm32f411e-disco cards. I want to synchronize the clocks of these cards. In other words, I want the clock of one of them to run synchronously with the clock in the other stm. How can I follow a way. As an example, I can say the following application. For example, when I install parallel code on two stm32s, I want the separate leds on the two stm32s to flash synchronously.

2 REPLIES 2
SofLit
ST Employee

Hello @coderduder and welcome to the community.

Not sure what do you want to do with this, but you can use MCO output of one STM32 MCU to feed other STM32 HSE in Bypass mode.

Is turning LEDs needs that synchronization? at which level of precision? hard timing?

In your case I don't think you need hard timing, you can synchronize that by using EXTI for each MCU and connecting them together. In the EXTI handler you can turn on the LED.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

@coderduder wrote:

I want to synchronize the clocks of these cards. In other words, I want the clock of one of them to run synchronously with the clock in the other stm. 


The easiest way to do that would be to simply feed both MCUs from the same clock source.

But why do you think you need to do this?

Synchronising the clocks of the processors won't necessarily guarantee that the operation of the software running on them is synchronised...

 


@coderduder wrote:

 For example, when I install parallel code on two stm32s, I want the separate leds on the two stm32s to flash synchronously.


You don't need to synchronise the clocks to do that - you need to synchronise the operation of your code.

In fact, synchronising the clocks is rather unlikely to achieve that!