Files
DIY-Multiprotocol-TX-Module/Multiprotocol
Raphael Coeffic d3293afdab HoTT, XN297 emu: compute the hop and CRC xorout tables (-1.2 KB) (#1199)
* HoTT: compute the hop table from the hop value (-1 KB)

The 16 hop tables are generated from the 16 bit value sent in packet[0..1]:
the C library rand() LCG (low 16 bits: x = x * 0x4E6D + 0x3039) seeded with
it drives forward Fisher-Yates shuffles, first of the order of the 5 bands of
15 channels, then of the channels of each band, hop i being in the band at
position i%5. This gives back the 16 tables bit for bit, and for any seed a
75 channel permutation with the same band structure.

* XN297 emu: compute the CRC xorout instead of the 4 tables

The XN297 CRC is CRC-16/CCITT with init 0xFFFF and xorout 0xFFFF over the
unscrambled address, pcf and payload, sent scrambled. The emulation computes
it from 0xB5D2 over the bits as sent, so the xorout for a CRC over n bits is
CRC(init 0xFFFF^0xB5D2) of n scramble (or zero) bits, xor 0xFFFF, xor the 16
scramble bits at the CRC. The scramble bits come from the LFSR behind
xn297_scramble[] (1110001, then s[i] = s[i-7] ^ s[i-3]), which also covers
the last enhanced entries, past the end of that table. It is the generator
Goebish gave for the scramble sequence in a comment on
https://mcumix.blogspot.com/2016/07/reverse-engineering-24ghz-rf-chip-xn297.html
(seed 0x71, feedback bit 6 ^ bit 2, MSB first).

All the entries of the 4 tables are given back but two: entry 0 (3 byte
address, no payload) was a 0 placeholder, and scrambled entry 1 (3 byte
address, 1 byte payload) was 0x3448 where the formula gives 0xE348.
2026-10-23 12:02:20 +02:00
..
2026-08-19 22:50:05 +02:00
2024-01-30 12:06:37 +01:00
2026-09-22 11:48:21 -04:00
2020-12-10 16:52:34 +01:00
2026-08-04 00:28:44 +02:00
2024-01-30 14:42:24 +01:00
2021-02-09 18:23:33 +01:00
2021-08-25 19:05:24 +02:00
2023-12-22 21:01:15 +01:00
2021-03-17 17:05:42 +01:00
2021-02-12 11:21:42 +01:00
2021-03-17 17:19:41 +01:00
2021-01-09 18:39:31 +01:00
2021-03-17 17:05:42 +01:00
2024-05-04 11:34:59 +02:00
2026-09-22 11:57:43 -04:00
2024-03-26 14:37:26 +01:00
2023-12-22 21:01:15 +01:00
2021-11-13 19:08:38 +01:00
2021-02-24 10:26:58 +01:00
2026-07-14 18:44:41 +02:00
2024-02-28 10:46:10 +01:00
2021-02-12 11:21:42 +01:00
2021-02-17 10:26:38 +01:00
2021-02-12 11:21:42 +01:00
2026-07-16 20:18:54 +02:00
2023-08-26 00:04:36 +02:00
2021-03-02 12:01:23 +01:00
2021-02-12 11:21:42 +01:00
2021-03-17 17:19:41 +01:00
2025-01-28 17:51:06 +01:00
2021-04-02 17:42:44 +02:00
2026-07-14 19:26:55 +02:00
2021-11-13 19:08:38 +01:00
2017-02-06 18:46:34 +01:00
2026-08-03 23:51:35 +02:00
2020-07-03 19:51:22 +02:00
2024-05-04 11:34:59 +02:00
2021-03-05 19:57:33 +01:00
2025-02-22 11:48:03 +01:00
2026-08-13 20:20:53 +02:00
2024-02-15 20:52:01 +01:00
2025-02-27 16:56:58 +01:00
2021-02-12 11:21:42 +01:00
2021-03-17 17:05:42 +01:00
2025-03-20 17:28:33 +01:00
2026-08-12 11:10:59 +02:00
2021-06-17 15:42:09 +02:00
2026-08-19 12:57:37 +02:00
2026-08-19 12:57:37 +02:00
2026-09-22 11:48:21 -04:00
2026-08-13 20:20:53 +02:00
2026-08-03 23:51:35 +02:00
2021-03-17 17:05:42 +01:00
2020-06-06 01:57:52 +02:00
2021-10-24 11:04:57 +02:00
2021-03-17 17:19:41 +01:00
2021-03-17 17:19:41 +01:00
2022-06-27 16:59:48 +02:00
2026-08-16 11:43:27 +02:00
2025-02-24 17:04:07 +01:00
2026-08-03 23:51:35 +02:00
2021-01-18 15:51:35 +01:00
2025-02-19 17:16:04 +01:00
2021-02-12 11:21:42 +01:00
2025-04-16 07:53:47 +02:00
2026-08-19 22:50:05 +02:00
2021-03-01 13:48:23 +01:00
2025-03-10 17:38:37 +01:00
2026-07-14 18:46:40 +02:00
2026-08-21 13:23:57 +02:00
2021-02-12 11:21:42 +01:00
2025-02-06 11:57:40 +01:00
2021-03-17 17:19:41 +01:00