https://github.com/ajorg/OpenGD77/tree/dcs
This implements DCS Tx and Rx. It correctly interprets Rx and Tx "tones" from the codeplug to distinguish from CTCSS and it uses the AT1846S chip to transmit and receive as is done with CTCSS.
The 83 standard codes are supported by the firmware but non-standard codes will also work if configured in the codeplug. See A Historical and Technical Overview of Tone Squelch Systems and DPL / DCS Information for why to stick to the 83 standard codes. In brief it's because the 83 codes can be uniquely identified from a number of positions in a stream of DCS data (which is streamed continuously during the entire call).
The AT1846S chip doesn't do Golay{23,12} encoding for you, so the ECC bits from the encoding are delivered as a lookup table. The table was computed using code from Using The Golay Error Detection And Correction Code by Hank Wallace:
Because only the ECC bits are stored in the table it takes 1kB of space in the binary.
The ECC bits get a binary 100
appended to it and then the actual DCS code to make up the full 23 bits. This encoding allows the receiver to miss up to 3 bits while still decoding correctly.
The AT1846S supports using different tones for CTCSS Tx and Rx, but for DCS it only supports using the same code for both. But the codeplug can store a CTCSS tone for Rx and a DCS code for Tx and whatever other combinations you might come up with, so configuring Tx tones and codes for analog has been moved to PTT.
The codeplug stored the code in binary-coded-octal (not binary-coded-decimal) so conversion routines were added. The high two bits in the tone field are a flag that indicates that the code is DCS and a flag to indicate if the inverted code should be used. These bits will never be set in a valid CTCSS code because they don't go that high.
References to "tones" in the codeplug have been left untouched even though the tone might be a code or None
. Some references to CTCSS have been changed to just CSS (Coded Squelch System, of which Carrier Tone is one).
The "None" value (0xFFFF
) has been moved out of the TRX_CTCSSTones array and one non-standard tone was removed from that array also. Other tones will still work, probably including completely random frequency choices, if present in the codeplug.
D023I
etc.) supportDCS_MASK
instead of ~CODEPLUG_DCS_FLAGS_MASK
and 0777
trx.c
to AT1846S.c
?