-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Working with sx127x radio. Unable to configure LoRa mode. Application sends SPI frames to configure LoRa by setting 0x01 register to 0xD3. It wirtes bit 7 to configure LoRa mode in addition to set bit 6, bit 4 (it shouldn't set this bit since it is a reserved one), and TX mode (bits 1:0)
Data: MOSI-DQ0 | MISO-DQ1, ...
Data: h01 | h00, h00 | h00,
Data: h81 | h00, h00 | h00, Write 0x01 --> Mode: Sleep before writing bit 7 to change to LoRa
Data: h01 | h00, h00 | h00,
Data: h81 | h00, hD3 | h00, Write 0x01 --> Mode: Transmitter mode (Tx), bit 4 reserved, Modulation scheme: changed from FSK to OOK, LongRangeMode changed from FSK/OOK to LoRa
Data: hC0 | h00, h00 | h00, h00 | h30,
Data: h86 | h00, hD9 | hD9, h13 | h13, h33 | h33,
Data: h09 | h00, h00 | h7E, h00 | h09,
Data: h4D | h00, h00 | h04,
Data: h89 | h00, h7E | h7E, h09 | h09,
Data: hCD | h00, h04 | h04,
Data: h1D | h00, h00 | h00, h00 | h00,
Data: h26 | h00, h00 | h08,
Data: h9D | h00, h72 | h00, hC0 | h00,
Data: hA6 | h00, h08 | h08,
Data: h31 | h00, h00 | h03,
Data: hB1 | h00, h03 | h03,
Data: hB7 | h00, h0A | h0A,
Data: h01 | h00, h00 | h43, Read 0x01 --> Changed from 0xD3. Bit 4 is read only and reserved but in changes from 0xC3 to 0x43: LongRangeMode from LORA to FSK/OOK mode. This bit can only be modified in sleep mode.
I modified sx127x_set_pkt_type function in order to write 0x01 with 0x80 value (only set bit 7) when okt_type is SX127X_PKT_TYPE_LORA and int seems to change to LoRa mode
Data: h01 | h00, h00 | h00,
Data: h01 | h00, h00 | h00,
Data: h81 | h00, h00 | h00, Sleep
Data: h01 | h00, h00 | h00,
Data: h81 | h00, h80 | h00, LoRa mode
Data: hC0 | h00, h00 | h00, h00 | h30,
Data: h86 | h00, hD9 | hD9, h06 | h13, h66 | h33,
Data: h09 | h00, h00 | h7E, h00 | h09,
Data: h4D | h00, h00 | h04,
Data: h89 | h00, h7E | h7E, h09 | h09,
Data: hCD | h00, h04 | h04,
Data: h1D | h00, h00 | h72, h00 | h70,
Data: h26 | h00, h00 | h04,
Data: h9D | h00, h72 | h72, hC0 | h70,
Data: hA6 | h00, h08 | h04,
Data: h31 | h00, h00 | hC3,
Data: hB1 | h00, h03 | hC3,
Data: hB7 | h00, h0A | h0A,
Data: h01 | h00, h00 | h80, Check radio is in LoRa mode
Data: h81 | h00, h01 | h80, For any reason library overrides LoRa mode in the next frame