Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FW-861 Enable FSK-FEC 25kbps for TSCH link using 120ms slot duration #492

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
16 changes: 15 additions & 1 deletion bsp/boards/openmote-b-subghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#define PORT_PIN_RADIO_RESET_HIGH() // nothing
#define PORT_PIN_RADIO_RESET_LOW() // nothing

#define SLOTDURATION 20 // in miliseconds
#define SLOTDURATION 160 // in miliseconds: default is 20 ms. Use 120 ms for SubGHz band with FSK.

//===== IEEE802154E timing

Expand Down Expand Up @@ -93,6 +93,20 @@
#define PORT_delayRx 0 // 0us (can not measure)
#endif

// experimental: relaxed estimations for fsk1 with fec 25kbps
#if SLOTDURATION==160
#define PORT_TsSlotDuration 5300 // 161ms

// execution speed related
#define PORT_maxTxDataPrepare 220
#define PORT_maxRxAckPrepare 250
#define PORT_maxRxDataPrepare 66
#define PORT_maxTxAckPrepare 250
// radio speed related
#define PORT_delayTx 100
#define PORT_delayRx 0
#endif

//===== adaptive_sync accuracy

#define SYNC_ACCURACY 1 // ticks
Expand Down
33 changes: 27 additions & 6 deletions openstack/02a-MAClow/IEEE802154E.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ static const uint8_t ebIEsBytestream[] = {
#define EB_SLOTFRAME_LEN_OFFSET 20
#define EB_SLOTFRAME_NUMLINK_OFFSET 22

#define EB_IE_LEN 28
/**
Set EB on minimal cell for 1/EB_PORTION portion.
Must be set to lower values for slower modulations. Otherwise, impossible to synchronize.
Default setting is 10 for 20 ms slot duration and 4 for 120 ms slot duration
*/
#define EB_PORTION 10

#define EB_IE_LEN 28
#define NUM_CHANNELS 16 // number of channels to channel hop on
#define TXRETRIES 15 // number of MAC retries before declaring failed
#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)
#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize
#define US_PER_TICK 30 // number of us per 32kHz clock tick
#define EB_PORTION 10 // set EB on minimal cell for 1/EB_PORTION portion
#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization.
#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.
#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection "large"
Expand Down Expand Up @@ -164,13 +169,33 @@ enum ieee154e_atomicdurations_enum {
TsLongGT = 36, // 1100us
TsTxAckDelay = 33, // 1000us
TsShortGT = 13, // 500us, The standardlized value for this is 400/2=200us(7ticks). Currectly 7 doesn't work for short packet, change it back to 7 when found the problem.
// radio watchdog
wdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)
wdDataDuration = 164, // 5000us (measured 4280us with max payload) >> Mina original is 164
wdAckDuration = 98, // 3000us (measured 1000us)>> Mina original 98
#endif
#if SLOTDURATION==20
TsTxOffset = 171, // 5215us
TsLongGT = 43, // 1300us
TsTxAckDelay = 181, // 5521us
TsShortGT = 16, // 500us
// radio watchdog
wdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)
wdDataDuration = 164, // 5000us (measured 4280us with max payload) >> Mina original is 164
wdAckDuration = 98, // 3000us (measured 1000us)>> Mina original 98
#endif
// experimental: relaxed estimations for fsk1 with fec 25kbps
#if SLOTDURATION==160
TsTxOffset = 360, // 5215us
TsLongGT = 240, // 1300us
TsTxAckDelay = 362, // 5521us
TsShortGT = 60, // 500us
// radio watchdog
wdRadioTx = 230, // 4500us delayTx+Tx time for 10 bytes( (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)
wdDataDuration = 2662, // 40320 us (measured with max payload) >> Mina original is 164
wdAckDuration = 600, // 8962us (measured)
#endif

TsSlotDuration = PORT_TsSlotDuration, // 10000us
// execution speed related
maxTxDataPrepare = PORT_maxTxDataPrepare,
Expand All @@ -180,10 +205,6 @@ enum ieee154e_atomicdurations_enum {
// radio speed related
delayTx = PORT_delayTx, // between GO signal and SFD
delayRx = PORT_delayRx, // between GO signal and start listening
// radio watchdog
wdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)
wdDataDuration = 164, // 5000us (measured 4280us with max payload)
wdAckDuration = 98, // 3000us (measured 1000us)
};

//shift of bytes in the linkOption bitmap: draft-ietf-6tisch-minimal-10.txt: page 6
Expand Down