You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SynchronizationClock.md
+53-22Lines changed: 53 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,60 @@
1
1
<imgsrc="./assets/HarpLogo.svg"width="200">
2
2
3
-
# Synchronization Clock Protocol (1.0)
3
+
# Synchronization Clock Protocol
4
4
5
-
## Introduction
6
-
The Harp Synchronization Clock is a dedicated bus that disseminates the current time to/across Harp devices. It is a serial communication protocol that relays time information. The last byte in each message can be used as a trigger, and allows a Device to align itself with the current Harp time.
5
+
This document provides the specification for the Harp Synchronization Clock, a dedicated bus used to synchronize the current time across Harp devices with sub-millisecond accuracy.
7
6
8
-
## Serial configuration
7
+
## Requirements Language
9
8
10
-
* The Baud rate used is 100kbps;
11
-
* The last byte starts *exactly* 672 us before the elapse of the current second (e.g.:)
9
+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
* The packet is composed of 6 bytes (`header[2]` and `timestamp_s[4]`):
16
-
-`header[2] = {0xAA, 0xAF)`
17
-
-`timestamp_s` is of type U32, little-endian, and contains the previous elapsed second.
13
+
The Harp Synchronization Clock is a serial communication protocol for relaying time information over RS-232. Each message transmits the current timestamp, in whole seconds. The transmission of the last byte in each message is used as a synchronization signal, allowing Harp devices to align their clocks with sub-millisecond accuracy.
Example of a microcontroller C code dispatching the serialized data:
57
+
Example microcontroller C code dispatching the serialized data:
25
58
26
59
```C
27
60
@@ -56,7 +89,8 @@ ISR(TCD0_OVF_vect, ISR_NAKED)
56
89
}
57
90
```
58
91
59
-
Example of a microcontroller C++ code for converting the four received encoded bytes to the timestamp:
92
+
Example of microcontroller C++ code for converting the four received encoded bytes to the timestamp:
93
+
60
94
````C
61
95
#define HARP_SYNC_OFFSET_US (672)
62
96
@@ -72,28 +106,25 @@ Example of a microcontroller C++ code for converting the four received encoded b
72
106
73
107
A full example demonstrating a state machine receiving the 6-byte sequence can be found in the [Pico Core](https://github.com/harp-tech/core.pico/blob/main/firmware/src/harp_synchronizer.cpp).
74
108
75
-
---
76
-
77
-
78
-
## Physical connection
109
+
## Physical Connection
79
110
80
-
The physical connection is made by a simple 3.5mm audio cable.
111
+
The physical connection for transmission of the Harp Synchronization Clock SHOULD be made by a 3.5 mm audio cable.
81
112
82
113
The connector pinout for a device *receiving* the timestamp is shown below:
> The device *sending* the timestamp isolates each clock output port, preventing ground loops from forming when connecting the audio jack between sender and receiver.
127
+
> The device *sending* the timestamp SHOULD isolate each clock output port, preventing ground loops from forming when connecting the audio jack between sender and receiver.
97
128
98
129
A supplementary PDF [example](./assets/PhysicalConnector.pdf) of the sender and the receiver is also available.
99
130
The connector used is from `Switchcraft Inc.` with PartNo. `35RASMT2BHNTRX`.
0 commit comments