Electronic – SX1276 LoRa – Implicit mode – Not knowing PayloadLength at reception

lorasx1276

I'm trying to use SX1276 in Implicit Header Mode, and extracting the PayloadLength after ValidHeader interrupts. The first byte is the payload length. The reception works OK 80% of the time. For the rest of the time, it just reads random data.

Config:

  • BW: 125khz or 500Khz – no influence
  • AFC BW: 250khz
  • CR: 4/8 or 4/5 – no influence
  • I have taken into account the Errata recommendations for SF6.
    For Explicit Header mode, SF7, its 100% reliable

Valid Header IRQ:

void RF_IRQ1_handler() {
    if (RF_module.config.modulation == Lora) {
        RF_write_reg(Lora_RegFifoRxBaseAddr, 0x00);
        RF_write_reg(Lora_RegPayloadLength, 0xFF); //Not to trigger TxDone based on last transmission
        uint8_t rx = RF_read_reg(Lora_RegFifoRxByteAddr);
        while (rx == RF_read_reg(Lora_RegFifoRxByteAddr)) { //It waits for 4ms for data to be written to FIFO
        }
        RF_write_reg(Lora_RegPayloadLength, RF_read_reg(Lora_RegFifo));         
    }
}

How can I improve my transfer rate?

Best Answer

After trial & error I found the issue: modem is sensitive to preamble length (I was using the minimum of 6). With preamble length=7 transmission is 100% reliable.