Giter VIP home page Giter VIP logo

sx1276fsk's Introduction

SX1276 FSK-mode driver

This driver uses the sx1276 "LoRa" radio in FSK mode in order to communicate mostly with RFM69 radios. It uses the JeeLabs packet format, as follows:

 byte: content
    0: packet length N = 2..65
    1: group parity (b7..6), dest id (b5..0)
    2: flags (b7..6), src id (b5..0)
    3..(N-1): payload data (max 63 bytes)
    N..(N+1): 16-bit crc

This driver is geared towards the ESP32. For other uC's the attachInterrupt calls probably have to be tweaked.

Interrupts

This driver is designed to use interrupts, but it can also function without. The main reason to use interrupts is that it avoids SPI accesses to the radio while the radio is in RX mode and that lowers the noise floor. This adds ~9dB of SNR when in LoRa mode and is bound to also help a little in FSK mode, although FSK mode can't RX below the noise floor, so it's perhaps less important.

Ideally both DIO0 and DIO4 are connected to gpio pins for the following reasons:

  • DIO0 is used to get a payload-ready interrupt, which means the esp32 doesn't need to continuously poll the radio while it's receiving.
  • DIO4 is used to get a preamble-detect interrupt, which is used to capture the RSSI, AFC, and AGC settings, this means the esp32 doesn't have to continuously poll while the radio is listening for a signal.

The driver works fine with neither interrupt lines oir with only one.

RSSI, AGC, AFC

Like seemingly all Semtech packet radios the SX1276 has its ugly quirks when it comes to RSSI measurements as well as AGC/AFC. (The LoRa mode fixes this crap.) Here are my notes:

  • The RSSI value register is "free running" and not frozen when the packet is received. It is most accurate during the preamble period after AFC/AGC happen. This means it has to be captured early in the packet and is invalid by the time payload-ready is signaled.
  • The AGC/AFC process has a flaw, which is that it is not automatically restarted if packet reception times out. The driver configures the radio to do AGC/AFC when it detects a preamble and what happens is that if sync address match does not occur (e.g. because the signal is too low) then AGC/AFC remain locked in until some future packet is received.
  • To fix the locked AFC/AGC issue the drive interrupts on preamble-detect, sets a timer, and then restarts RX if no sync-address match occurs within a couple of milliseconds.
  • From the point of view of capturing RSSI/AFC/AGC it would be possible to use sync-address match interrupt on DIO2, however this doesn't provide an opportunity to fix the locked AFC/AGC issue.

Reset

Connecting the radio's reset pin is not strictly required as it has a proper power-on reset. However, while experiementing, it is possible to get the radio into odd non-functional states that can only be cleared by a hardware reset. If the driver is used without modification the probably that this occurs is very small.

sx1276fsk's People

Contributors

tve avatar sevenw avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.