Repository navigation
[FSK] Separate preamble length from preamble detector length #1933
moshe-braner
started this conversation in
Ideas
Replies: 1 comment 3 replies
|
This has been added by @StevenCellist in 24f2385 |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In RadioLib there is one function call, setPreambleLength(), and it affects both the transmitted preamble length and the receiver preamble detector length. But one may want a longer preamble transmitted (to maximize the chance that other receivers, some of different designs, will receive what is sent), and a shorter preamble detector length (to maximize the chance that this receiver will receive what is sent by others).
For the sx1262 the RadioLib code is:
SX126x::setPreambleLength(size_t preambleLength) {
...
this->preambleLengthFSK = preambleLength;
// maximum preamble detector length is limited by sync word length
// for details, see the note in SX1261 datasheet, Rev 2.1, section 6.2.2.1, page 45
uint8_t maxDetLen = RADIOLIB_MIN(this->syncWordLength, this->preambleLengthFSK);
this->preambleDetLength = ... (a code for one of the values 0, 8, 16, 24, 32)
return(setPacketParamsFSK(this->preambleLengthFSK, this->preambleDetLength, ...
Thus RadioLib forces the preamble detector length to be the same as the preambleLength (as long as that is no longer than the sync word). The RadioLib user cannot choose a smaller detector length, which defeats the purpose of having that as a separate parameters in the chip config?
This deficiency propagates to the LR1110 (same code). And to the LR2021, where RadioLib uses this code:
LR2021::setPreambleLength(size_t preambleLength) {
...
this->preambleLengthGFSK = preambleLength;
this->preambleDetLength = (preambleLength / 8) << 3;
return(setGfskPacketParams(this->preambleLengthGFSK, this->preambleDetLength, ...
There the preambleDetLength is set to the largest multiple of 8 within the preambleLength, i.e., same as the preambleLength if the preambleLength is already a multiple of 8. One can force some difference between the two by passing, e.g., 7, or 15, then the detector length would be 0, or 8.
Lacking the ability to separate these things pushes me to re-set the preambleLength for each tx and then again when going back to rx.
All reactions