Skip to content

Conversation

@LeeLeahy2
Copy link
Contributor

The MP_HEARTBEAT frame did not include the millis field. Add the millis field to the MP_HEARTBEAT frame to enable the clock to properly synchronize. Prior to adding this field the synchronization would be random and typically larger than 40 mSec. With the millis value in the HEARTBEAT frame the clock synchronization drops to less than 2 mSec.

Testing was done by modifying the discovery code to save the millis value when the code transitioned to the RADIO_MP_STANDBY state. In the RADIO_MP_STANDBY if the client had run more than 5 seconds then it would change states to RADIO_DISCOVER_BEGIN. A five minute log was captured and the following clock synchronization offsets were recorded:

759 uSec - from HEARTBEAT frame
431 uSec - from HEARTBEAT frame
405 uSec - from HEARTBEAT frame
240 uSec - from HEARTBEAT frame
258 uSec - from HEARTBEAT frame
79 uSec - from HEARTBEAT frame
145 uSec - from HEARTBEAT frame
663 uSec - from HEARTBEAT frame
131 uSec - from HEARTBEAT frame
370 uSec - from HEARTBEAT frame
410 uSec - from HEARTBEAT frame
438 uSec - from HEARTBEAT frame
344 uSec - from HEARTBEAT frame
564 uSec - from HEARTBEAT frame
668 uSec - from HEARTBEAT frame

The scope was setup to record 10 GSamples at 1 MHz. D0 and D2 are connected to the server and D1 and D3 are connected to the client.

The trigger parameters were:

triggerWidth = 10;
triggerWidthIsMultiplier = true;
triggerEnable = 127;

TRIGGER_TRANSACTION_COMPLETE, //14
TRIGGER_CHANNEL_TIMER_ISR, //24
TRIGGER_RX_SYNC_CLOCKS, //34
TRIGGER_TX_SYNC_CLOCKS, //44

TRIGGER_RX_HEARTBEAT, //54
TRIGGER_TX_HEARTBEAT, //64
TRIGGER_SYNC_CHANNEL_TIMER, //74

The MP_HEARTBEAT frame did not include the millis field.  Add the
millis field to the MP_HEARTBEAT frame to enable the clock to properly
synchronize.  Prior to adding this field the synchronization would be
random and typically larger than 40 mSec.  With the millis value in the
HEARTBEAT frame the clock synchronization drops to less than 2 mSec.

Testing was done by modifying the discovery code to save the millis
value when the code transitioned to the RADIO_MP_STANDBY state.  In the
RADIO_MP_STANDBY if the client had run more than 5 seconds then it would
change states to RADIO_DISCOVER_BEGIN.  A five minute log was captured
and the following clock synchronization offsets were recorded:

759 uSec - from HEARTBEAT frame
431 uSec - from HEARTBEAT frame
405 uSec - from HEARTBEAT frame
240 uSec - from HEARTBEAT frame
258 uSec - from HEARTBEAT frame
 79 uSec - from HEARTBEAT frame
145 uSec - from HEARTBEAT frame
663 uSec - from HEARTBEAT frame
131 uSec - from HEARTBEAT frame
370 uSec - from HEARTBEAT frame
410 uSec - from HEARTBEAT frame
438 uSec - from HEARTBEAT frame
344 uSec - from HEARTBEAT frame
564 uSec - from HEARTBEAT frame
668 uSec - from HEARTBEAT frame

The scope was setup to record 10 GSamples at 1 MHz.  D0 and D2 are
connected to the server and D1 and D3 are connected to the client.

The trigger parameters were:

triggerWidth = 10;
triggerWidthIsMultiplier = true;
triggerEnable = 127;

TRIGGER_TRANSACTION_COMPLETE, //14
TRIGGER_CHANNEL_TIMER_ISR, //24
TRIGGER_RX_SYNC_CLOCKS, //34
TRIGGER_TX_SYNC_CLOCKS, //44

TRIGGER_RX_HEARTBEAT, //54
TRIGGER_TX_HEARTBEAT, //64
TRIGGER_SYNC_CHANNEL_TIMER, //74
@nseidle nseidle merged commit df47f93 into sparkfun:release_candidate Mar 21, 2023
@LeeLeahy2 LeeLeahy2 deleted the heartbeat-sync branch September 3, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants