From 688c6ee114d22ec60d8ea4693fbae0c8a131561c Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 15 Jul 2017 12:08:10 +0200 Subject: [PATCH] TSCH: comment on how the TSCH base drift is computed --- arch/platform/cc2538dk/contiki-conf.h | 9 ++++++++- arch/platform/jn516x/platform-conf.h | 12 +++++++++--- arch/platform/openmote-cc2538/contiki-conf.h | 9 ++++++++- arch/platform/srf06-cc26xx/contiki-conf.h | 9 ++++++++- arch/platform/zoul/contiki-conf.h | 9 ++++++++- 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/arch/platform/cc2538dk/contiki-conf.h b/arch/platform/cc2538dk/contiki-conf.h index 307b015fe..a3ef81196 100644 --- a/arch/platform/cc2538dk/contiki-conf.h +++ b/arch/platform/cc2538dk/contiki-conf.h @@ -47,7 +47,14 @@ typedef uint32_t rtimer_clock_t; #define RADIO_DELAY_BEFORE_DETECT 0 #ifndef TSCH_CONF_BASE_DRIFT_PPM /* The drift compared to "true" 10ms slots. - * Enable adaptive sync to enable compensation for this. */ + * Enable adaptive sync to enable compensation for this. + * Slot length 10000 usec + * 328 ticks + * Tick duration 30.517578125 usec + * Real slot duration 10009.765625 usec + * Target - real duration = -9.765625 usec + * TSCH_CONF_BASE_DRIFT_PPM -977 + */ #define TSCH_CONF_BASE_DRIFT_PPM -977 #endif /*---------------------------------------------------------------------------*/ diff --git a/arch/platform/jn516x/platform-conf.h b/arch/platform/jn516x/platform-conf.h index 703826ce7..3caadae2f 100644 --- a/arch/platform/jn516x/platform-conf.h +++ b/arch/platform/jn516x/platform-conf.h @@ -110,9 +110,15 @@ typedef uint32_t rtimer_clock_t; /* If the timer base a binary 32kHz clock, compensate for this base drift */ #if RTIMER_USE_32KHZ && JN516X_EXTERNAL_CRYSTAL_OSCILLATOR -/* Drift calculated using this formula: -* ((US_TO_TICKS(10000) * 100) - RTIMER_SECOND) * 1e6 = 976.5625 ppm -*/ +/* The drift compared to "true" 10ms slots. + * Enable adaptive sync to enable compensation for this. + * Slot length 10000 usec + * 328 ticks + * Tick duration 30.517578125 usec + * Real slot duration 10009.765625 usec + * Target - real duration = -9.765625 usec + * TSCH_CONF_BASE_DRIFT_PPM -977 + */ #define TSCH_CONF_BASE_DRIFT_PPM -977 #endif diff --git a/arch/platform/openmote-cc2538/contiki-conf.h b/arch/platform/openmote-cc2538/contiki-conf.h index d28a85ba3..5e7e967da 100644 --- a/arch/platform/openmote-cc2538/contiki-conf.h +++ b/arch/platform/openmote-cc2538/contiki-conf.h @@ -86,7 +86,14 @@ typedef uint32_t rtimer_clock_t; #define RADIO_DELAY_BEFORE_DETECT 0 #ifndef TSCH_CONF_BASE_DRIFT_PPM /* The drift compared to "true" 10ms slots. - * Enable adaptive sync to enable compensation for this. */ + * Enable adaptive sync to enable compensation for this. + * Slot length 10000 usec + * 328 ticks + * Tick duration 30.517578125 usec + * Real slot duration 10009.765625 usec + * Target - real duration = -9.765625 usec + * TSCH_CONF_BASE_DRIFT_PPM -977 + */ #define TSCH_CONF_BASE_DRIFT_PPM -977 #endif /*---------------------------------------------------------------------------*/ diff --git a/arch/platform/srf06-cc26xx/contiki-conf.h b/arch/platform/srf06-cc26xx/contiki-conf.h index bb51131e9..4f464809a 100644 --- a/arch/platform/srf06-cc26xx/contiki-conf.h +++ b/arch/platform/srf06-cc26xx/contiki-conf.h @@ -280,7 +280,14 @@ typedef uint32_t rtimer_clock_t; #ifndef TSCH_CONF_BASE_DRIFT_PPM /* The drift compared to "true" 10ms slots. - * Enable adaptive sync to enable compensation for this. */ + * Enable adaptive sync to enable compensation for this. + * Slot length 10000 usec + * 328 ticks + * Tick duration 30.517578125 usec + * Real slot duration 10009.765625 usec + * Target - real duration = -9.765625 usec + * TSCH_CONF_BASE_DRIFT_PPM -977 + */ #define TSCH_CONF_BASE_DRIFT_PPM -977 #endif diff --git a/arch/platform/zoul/contiki-conf.h b/arch/platform/zoul/contiki-conf.h index 38b34e5ad..a67e37e2c 100644 --- a/arch/platform/zoul/contiki-conf.h +++ b/arch/platform/zoul/contiki-conf.h @@ -84,7 +84,14 @@ typedef uint32_t rtimer_clock_t; #define RADIO_DELAY_BEFORE_DETECT 0 #ifndef TSCH_CONF_BASE_DRIFT_PPM /* The drift compared to "true" 10ms slots. - * Enable adaptive sync to enable compensation for this. */ + * Enable adaptive sync to enable compensation for this. + * Slot length 10000 usec + * 328 ticks + * Tick duration 30.517578125 usec + * Real slot duration 10009.765625 usec + * Target - real duration = -9.765625 usec + * TSCH_CONF_BASE_DRIFT_PPM -977 + */ #define TSCH_CONF_BASE_DRIFT_PPM -977 #endif /*---------------------------------------------------------------------------*/