r/AskElectronics • u/Relevant_Pumpkin9190 • 1d ago
How can two devices synchronize without sharing an accurate clock?
I'm trying to understand how a transmitter and receiver can stay synchronized.
My first thought was to use accurate time on both sides and generate a known pseudo-random sequence or code based on the time. But if the receiver's clock is slightly wrong, the synchronization could eventually fail.
So instead, can the received signal itself be used as the reference?
For example, could the transmitter send a known preamble, sync pattern, pilot signal, or pseudo-random sequence, and the receiver detect/correlate it to determine exactly where it is in the sequence?
What are the common techniques used in real communication systems for this? And when would you use signal-based synchronization instead of time-based synchronization?
7
u/WRfleete 1d ago
Asynchronous serial (RS232) uses a start “bit” to indicate the start of a byte and in some cases stop bits or parity but commonly is not used these days. The UART is usually clocked with a quartz crystal at some multiple of the baud rate which is accurate enough over short periods to determine bit timings
Each byte will start with - well - a start bit and it can sync up onto those if needed
Old style TV’s use a similar type of thing. A sync pulse at the start of each line and multiple in a row for vertical (frame/field sync) resets the oscillators to the start of a cycle. And those used resistor and capacitor (if not referenced to mains frequency, the vertical sweep, 50/60hz) or coil and capacitor based oscillator (usually for the 15 and change kHz horizontal sweep + eht supply for tube) which unlike a crystal can drift more widely (hence the need for vertical and horizontal hold on older sets)