SX126x

来自Jack's Lab
2020年12月24日 (四) 17:26Comcat (讨论 | 贡献)的版本

跳转到: 导航, 搜索

目录

1 Overview

  • SX1262: (+22dBm), 150-960 MHz (e.g. 430/490MHz, 868/915MHz), Rx Current 4.6mA, QFN 4x4mm
  • SX1261: (+15dBm), 150-960 MHz (e.g. 430/490MHz, 868/915MHz), Rx Current 4.6mA, QFN 4x4mm
  • SX1268: (+22dBm), 410-810 MHz, Rx Current 4.6mA, QFN 4x4mm


  • 4.2 mA of active receive current consumption
  • 25 mA TX @ 14dbm
  • Programmable bit rate up to 62.5 kbps LoRa and 300 kbps FSK
  • High sensitivity: down to -148 dBm
  • 1.8 ~ 3.7V (3.9 max)


https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262


2 Notes

2.1 调试笔记

  • 2020/12/22: 弃用串口的 RX pin 后,校准 hung 问题解决
  • 2020/12/22: 电压一致后,get_status 终于返回 0x22 (avr + sx126x 返回 0x2A)
  • 2020/12/23: SPI 读写调整后,重用串口的 RX pin 为 Busy line,居然也没有 hung 问题了,怀疑是 RX 中断没那么频繁了



2.2 Busy Ctrl Line

Used to indicate the status of the internal state machine.

The amount of time the BUSY line is stay HIGH.

When the BUSY line is held low, it indicates that the internal state machine is in idle mode and that the radio is ready to accept a command from the host controller.

The BUSY line is set back to zero once the chip has reached a stable mode and it's ready for a new command


2.3 RF Switch

  • DIO2 控制 RF Switch 之 ctrl,用于切换 RF1 (RF_OUT) 还是 RF2 (RF_IN) 连接到 RFC (ANT)


对于 RF switch PE4259:

  • Pin 6 (~CTRL) = VDD (3.3V Max), Pin 4 (CTRL) = High ------> RF1 (RFO, Pin1) -> RFC
  • Pin 6 (~CTRL) = VDD (3.3V Max), Pin 4 (CTRL) = Low ------> RF2 (RFI, Pin3) -> RFC

PE4259.pinmap.png


2.4 SetModulationParams

  • cmd opcode: 0x8B
  • cmd format: 0x8B param1 param2 ... param4
  • param1: SF
    • 0xA (SF10)
    • 0xC (SF12)
  • param2: BW
    • 0x04 (BW125KHz)
    • 0x05 (BW250KHz)
    • 0x06 (BW500KHz)
  • param3: CR
    • 0x01 (CR 4/5)
    • 0x02 (CR 4/6)
  • param4: LowDataRateOptimize
    • 0x00: Off
    • 0x01: On

  • LowDataRateOptimize -----> 1: Enabled; mandated for when the symbol length exceeds 16ms
  • AgcAutoOn -----> 1: LNA gain set by the internal AGC loop


2.5 SetPacketParams

  • cmd opcode: 0x8C
  • cmd format: 0x8C param1 param2 ... param6
  • param1 & param2: PreambleLength, 0x1 ~ 0xFFFF
  • param3: HeaderType
    • 0x0: variable length packet (explicite header)
    • 0x1: fixed length packet (implicite header)
  • param4: PayloadLength: 0x0 - 0xFF
  • param5: CRC Type
    • 0x0: CRC off
    • 0x1: CRC on
  • param6: InvertQ
    • 0x0: standard IQ setup
    • 0x1: Inverted IQ setup


3 命令接口

3.1 查询接口

  • get_status()
    • opcode = 0xC0, NOP
    • return: RFU, Status
  • get_dev_errors()
    • opcode = 0x17, NOP, NOP, NOP
    • return: RFU, Status, OpError(15:8), OpError(7:0)
  • get_irq_status()
    • opcode = 0x12, NOP, NOP, NOP
    • return: RFU, Status, IrqStatus(15:8), IrqStatus(7:0)
  • get_rxbuf_status()
  • get_pkt_status()
  • get_packet_type()
  • get_stats()
  • get_rssi_inst()


3.2 设置接口

  • set_standby()
  • set_regulator_mode()
  • set_dio3_as_tcxo_ctrl()
  • set_dio2_as_rfswitch_ctrl()
  • set_packet_type()
    • opc = 0x8A, pkt_type
    • pkt_type: 0x1 lora, 0x0 gfsk
  • set_buffer_base_addr()
    • opc = 0x8F, tx_addr, rx_addr
  • set_tx_params()
    • opc = 0x8E, power, ramp_time
    • power: -9 (0xF7) ~ +22 (0x16) dBm
    • ramp_time: TCXO: 200us (0x4); XTAL: 20us (0x1)
    • set_packet_params()
    • opc = 0x8C, param1, param2 ... param9
    • param1: Preamble_Len[15:8]
    • param2: Preamble_Len[7:0]
    • param3: Header_Type, 0x0: explicit header
    • param4: Payload_Len, 0 ~ 0xFF
    • param5: CRC_Type, 0x0: off; 0x1: on
    • param6: Invert_IQ, 0x0: standard; 0x1: Inverted
  • set_tx()
    • opc = 0x83, timeout[23:16], timeout[15:8], timeout[7:0]
    • timeout = 0: Timeout disable, Tx single mode, the device will stay in TX mode utile the the packet is transmitted and returns in STBY_RC mode upon completion
    • timeout = others: Timeout active, the device remains in Tx mode it returns automatically to STBY_RC mode on timer end-of-count or when a packet has been transmitted. The maximum timeout is then 262s.
    • A TIMEOUT IRQ is triggered if the TX_DONE IRQ is not generated within the given timeout period
    • The chip goes back to STBY_RC mode after a TIMEOUT IRQ or a TX_DONE IRQ




3.3 读写接口

  • read_reg()
    • opc = 0x1D, addr[15:8], addr[7:0], NOP, 0, 0 ...
    • return: RFU, Status, Status, Status, data[0], data[1] ...
    • 读多少字节,NOP 后就跟几个 0
  • write_reg()
    • opc = 0x0D, addr[15:8], addr[7:0], data[0], data[1] ...
    • return: RFU, Status, Status, Status, Status ...
    • 写多少字节,addr 后就跟几个字节
  • read_buf()
    • opc = 0x1E, Offset, NOP, 0, 0 ...
    • return: RFU, Status, Status, data[0], data[1] ...
    • 读多少字节,NOP 后就跟几个 0
  • write_buf()
    • opc = 0x0E, Offset, data[0], data[1] ...
    • return: RFU, Status, Status, Status, Status ...
    • 写多少字节,offset 后就跟几个字节


4 Pinmap

Sx126x.pinmap.png


5 Application Schematics

5.1 Power

Sx126x-power.png


5.2 TCXO

Sx126x-TXCO-ctrl-block.png


5.3 参考实现

  • DC-DC 使用常用的 Option C
  • XTAL 使用的是非温补晶振,现在基本都使用 TCXO 了,这个要注意一下,实现的时候替换为 TCXO

Sx126x.app.sch.png


6 Module Pinmap

Sx126x-pinmap.jpg


7 ASR6500

ASR6500s 有三个子型号,分别是 ASR6500SL,ASR6500SLT,ASR6500SHT。

  • ASR6500SL 内部是 32M XO 晶振
  • ASR6500SLT 和 ASR6500SHT 内部是 32M TCXO 晶振。

TCXO 晶振需要在软件初始化时配置 DIO3 为 TCXO 控制引脚,并校准。同时 TCXO 唤醒时间配置为 5ms


8 Reference



个人工具
名字空间

变换
操作
导航
工具箱