2021-12-14 06:30 AM
Hello everyone,
I have used 2 Stm32f7 nucleo boards to read the data of 8 incremental encoders.
for this purpose, I have used timers. I can read the data of encoders correctly but there is a little bit time difference between timers. it means I need to Synchronize timers of stm32 boards and also 2 boards together.
could you please help me? How can I do that?
2021-12-14 01:42 PM
What is "time difference between timers"? If timers are in encoder mode, they don't measure *time*.
Please elaborate.
JW
2021-12-14 02:42 PM
Thanks for your reply.
I have connected an encoder to the two timers of two separate STM boards. For example, the first one shows the encoder value 20 in time 50ms, and the second one shows this value in time 51ms. Because their clock is not synchrony.
2021-12-14 03:38 PM
Can the boards share a common clock (HSE)?
Can the boards share a common synchronization pulse? 1PPS ?
Encoders should be able to latch the CNT value into CCR3 or CCR4 based on a common external input, or some internal sources.
2021-12-14 03:45 PM
Are the encoder pulses in your 50/51 ms case actually phase aligned? And at a frequency in sync with the sampling? Are you sure that's not a fence-posting issue?
The same clocks divided down may not be phase aligned, the prescaler isn't guaranteed to be in the same initial state, and can be complicated if the encoder signal can rotate in either direction.
2021-12-15 12:11 AM
O.K.
Yes, they are Nucleo Boards and I can use HSE.
I try to use an external oscillator and see what happens. Maybe with the same oscillator, they work correctly.
Then I will use common synchronization pulse to synchronize the timers in a board together.
2021-12-16 03:31 AM
Hi,
I have a Stm32f091rc and 2 F767zi nucleo board. I want to use the f091rc as external clock source. (MCO)
As you see in data sheet it is written I need to remove jumpers SB112 and SB149 and solder a jumper on SB148. It is written also : SB8 and SB9 removed. What does it mean? there is nothing on SB8 and SB9.
2021-12-16 04:00 AM
For an asynchronous measurement, always expect +/- 1 uncertainty!
2021-12-16 04:07 AM
Yes exactly I have 1 ms difference. But it is not allowed in my project. So I wanna synchronize the clock. Maybe it solved the problem.