1
\$\begingroup\$

I'm trying to send CW (like hello world) with the SX1278 on ttgo t-beam. I've read the datasheet and some examples and come to this code:

  sx1278my.writeRegister(REG_OP_MODE, FSK_SLEEP_MODE);
  sx1278my.writeRegister(REG_OP_MODE, FSK_STANDBY_MODE);  
  //433500000MHz
  sx1278my.writeRegister(REG_FRF_MSB, 0x6c);
  sx1278my.writeRegister(REG_FRF_MID, 0x60);
  sx1278my.writeRegister(REG_FRF_LSB, 0x00);  
  delay(10);

  sx1278my.writeRegister(REG_DIOMAPPING1, 0x00 );
  sx1278my.writeRegister(REG_FDEVMSB, 0x00);
  sx1278my.writeRegister(REG_FDEVLSB, 0x00);
  sx1278my.writeRegister(REG_BITRATEMSB, 0x00);
  sx1278my.writeRegister(REG_BITRATELSB, 0x00);

  sx1278my.writeRegister(REG_PACKETCONFIG1, 0x80); //variable length
  sx1278my.writeRegister(REG_PACKETCONFIG2, 0x00);

  // Disable radio interrupts
  sx1278my.writeRegister(REG_DIO_MAPPING1, 0x00);
  delay(10);
  //sx1278my.writeRegister(REG_OP_MODE, 0x00100011); //continuous mode, TX
  sx1278my.writeRegister(REG_OP_MODE, 0b00100011);

AFAIK it shall transmit now, however it does not. The Serial.print("REG_OP_MODE:"); Serial.println(sx1278my.readRegister(REG_OP_MODE), HEX); gives 0x01 which is stadby mode. gives 0x23 but no carrier is to be seen with rtl_sdr&gqrx. Any tips?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

While I don't have any experience with this particular device, I can offer some basic guidance when dealing with a new device. You want to make sure that your read and write function calls are working properly. In the spirit of divide-and-conquer, the goal is to determine if the problem is due to the communication or due to unexpected behavior in the device.

I suggest that you first verify that you can reliably write to the device by putting a readRegister call after each writeRegister and comparing the read and write values.

In this specific case, your last line of code is:

sx1278my.writeRegister(REG_OP_MODE, 0x00100011); //continuous mode, TX

You're attempting to write a 32 bit value to an 8 bit register. Did you mean to write:

sx1278my.writeRegister(REG_OP_MODE, 0x23); //continuous mode, TX

\$\endgroup\$
1
  • \$\begingroup\$ Stupid me, I wanted 0b00100011 \$\endgroup\$ Commented Nov 18, 2019 at 13:39
0
\$\begingroup\$

Ok, for a reason I don't understand The PaSelect bit(7) in REG_PA_CONFIG has to be set:

sx1278my.writeRegister(REG_PA_CONFIG, 0b10100000);

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It's not that it has to be set, it's that the output appears on a different pin of the IC depending on if it is or is not set. You probably told the output to go to one pin, but looked at the other. Very weak leakage would not be surprising, but then transmitting without a load isn't a great idea either. \$\endgroup\$ Commented Nov 18, 2019 at 16:20
  • \$\begingroup\$ I see, the PaSelect is switching the output through pin PA_BOOST(27) on SX1276 chip. The HPD13a board expose just this pin. The RFO_LF is probably not exposed and good shielded under metal case. That's why I was not receiving anything. \$\endgroup\$ Commented Nov 19, 2019 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.