Fix two CC1101 SPI protocol bugs found in final datasheet review

Bug 1 — FLOOD mode TXFIFO_UNDERFLOW (config.h):
  JAM_FLOOD_PKT_BYTES was 64. RadioLib variable-length mode writes
  one length byte to the FIFO first (dataSent=1), then MIN(len, FIFO_SIZE-1)=63
  data bytes. CC1101 was told to send 64 bytes but only 63 were in the FIFO,
  causing TXFIFO_UNDERFLOW every packet. Changed to 61 bytes (safe margin).

Bug 2 — STATUS register read protocol (main.cpp):
  cc1101ReadRegister sent 0x80|addr for all addresses. Per SWRS061 §10.2,
  for addresses 0x30-0x3D burst-bit=0 selects a command strobe, NOT a
  register read. VERSION register (0x31) was actually triggering an SIDLE
  strobe and returning the status byte. Fixed: use 0xC0|addr (read+burst)
  for addr >= 0x30 to correctly access status registers.

Made-with: Cursor
This commit is contained in:
drjones
2026-04-02 13:26:13 -07:00
parent 9d36430474
commit a44462e905
4 changed files with 275 additions and 2 deletions

View File

@@ -58,7 +58,9 @@
#define JAM_PULSE_HZ 2000
// Flood jam: packet-mode random payloads (mcore1976-style bursty TX); deviation for symbol spread.
#define JAM_FLOOD_PKT_BYTES 64
// 61 bytes max: CC1101 64-byte FIFO minus 1 length byte (variable-length mode) minus 2 bytes margin.
// 64 caused TXFIFO_UNDERFLOW — RadioLib writes MIN(len, FIFO_SIZE-1)=63 bytes but CC1101 expects 64.
#define JAM_FLOOD_PKT_BYTES 61
#define JAM_FLOOD_DEV_R1_KHZ 140.0f
#define JAM_FLOOD_DEV_R2_KHZ 200.0f