Posts

Showing posts with the label CFM

Some ideas about decoding TETRA with TI CC1120 and Arduino Due

https://www.rtl-sdr.com/decoding-tetra-voice-on-a-retevis-c62-handheld-with-custom-openrtx-firmware/ TI CC1120 has a mode called CFM. The CC1120 receives Custom Frequency Modulation (CFM) / Analog FM by bypassing its packet handler and continuously reading the instantaneous frequency offset from the CFM_RX_DATA_OUT register over SPI. This mode is designed for demodulating e.g. custom FSK modes. To configure the CC1120 for CFM, apply std RF settings (frequency, ch filter bw and AGC) and modify the following extended registers: Enable CFM Mode (CFM_DATA_CFG at 0x2F09) Bypass Packet Handling (PKT_CFG2 at 0x0026) Disable Sync Word Qualification (SYNC_CFG1 at 0x0008) Set RX Filter bw (CHAN_BW at 0x0010): Match the channel filter bandwidth to 25 kHz. Reading demodulated data (CFM_RX_DATA_OUT) Once the chip enters RX state via the SRX command strobe, your microcontroller must sample the demodulated frequency offset at regular intervals. Data format: register returns a signed 8-bit integer (tw...

CC1120/Arduino - CFM for nFSK

Image
 28.1.2021 CC1120/Arduino - CFM for nFSK Arduino Due + CC1120 CFM CFM data output for 4-FSK. Possibly CFM could be used for demodulating N-FSK systems.   #include <SPI.h> #include "cc1120.h" #define PRINT_INFO    1 volatile uint8_t cfmData  = 0; volatile bool mChg        = false; void setup() {   Serial.begin(115200);   pinMode(RESET_PIN, OUTPUT);   pinMode(SS_PIN, OUTPUT);   pinMode(GDO0_PIN, INPUT);   pinMode(GDO3_PIN, INPUT);   digitalWrite(SS_PIN, HIGH);   digitalWrite(RESET_PIN, HIGH);     SPI.begin();   strobeSPI(SNOP);   // Preamble off   uint8_t v = readSPI(PREAMBLE_CFG0);   bitClear(v, 5);   writeSPI(PREAMBLE_CFG0, v);   // Sync off   v = readSPI(SYNC_CFG0);   v &= B11100011;   writeSPI(SYNC_CFG0, v);   // CRC off   v = readSPI(PKT_CFG1);   v &= B11110011;   writeSPI(PKT_CFG1, v);   writ...

CC1120 CFM RX+TX

Image
  21.6.2021 CC1120 CFM RX+TX CC1120 + Arduino Due   #include <SPI.h> #include "cc1120.h" #define PRINT_INFO  1 #define RX_ARR_SIZE 1536 #define RX_OK       "RX done" #define TX_OK       "TX done" #define TX          "TX" #define RX          "RX" #define TX_WAIT     "Waiting for 4 seconds" volatile int8_t rx_arr[RX_ARR_SIZE]; volatile uint16_t rx_arr_index = 0; volatile uint8_t radio_state = 0; void setup() {   Serial.begin(9600);   pinMode(RESET_PIN, OUTPUT);   pinMode(SS_PIN, OUTPUT);   pinMode(GDO0_PIN, INPUT);   pinMode(GDO3_PIN, INPUT);   digitalWrite(SS_PIN, HIGH);   digitalWrite(RESET_PIN, HIGH);     SPI.begin();   strobeSPI(SNOP);   // Preamble off   uint8_t v = readSPI(PREAMBLE_CFG0);   bitClear(v, 5);   writeSPI(PREAMBLE_...

CC1120 - tx CTCSS in CFM mode

Image
29.11.2020 CC1120 - tx CTCSS in CFM mode CC1120 - MikroElektronika ccRF3 click board Arduino Due CC1120 custom frequency modulation mode (CFM) From CC1120 datasheet: CFM_TX_DATA_IN value 9 with deviation value 0.736237 kHz = ~100 Hz (CTCSS channel 12)   #include <SPI.h> #include "cc1120.h" #define PRINT_INFO  1 uint8_t cfmValue = 9; void setup() {   Serial.begin(9600);   pinMode(RESET_PIN, OUTPUT);   pinMode(SS_PIN, OUTPUT);   pinMode(CFM_TX_DATA_CLK_PIN, INPUT);   digitalWrite(SS_PIN, HIGH);   digitalWrite(RESET_PIN, HIGH);     SPI.begin();   strobeSPI(SNOP);   // Preamble off   uint8_t v = readSPI(PREAMBLE_CFG0);   bitClear(v, 5);   writeSPI(PREAMBLE_CFG0, v);   // Sync off   v = readSPI(SYNC_CFG0);   v &= B11100011;   writeSPI(SYNC_CFG0, v);   // CRC off   v = readSPI(PKT_CFG1);   v &= B11110011;   writeSPI(PKT_CFG1, v);   writeSPI(IOCFG0, CFM_TX_DATA_...

Arduino Due - CC1120 CFM rx

10.12.2020 Arduino Due - CC1120 CFM rx #include <SPI.h> #include "cc1120.h" #define PRINT_INFO    1 #undef PRINT_INFO #define F_DEV         2494 volatile uint8_t cfmData  = 0; volatile bool mChg        = false; void setup() {   Serial.begin(250000);   pinMode(RESET_PIN, OUTPUT);   pinMode(SS_PIN, OUTPUT);   pinMode(GDO0_PIN, INPUT);   pinMode(GDO3_PIN, INPUT);   digitalWrite(SS_PIN, HIGH);   digitalWrite(RESET_PIN, HIGH);     SPI.begin();   strobeSPI(SNOP);   // Preamble off   uint8_t v = readSPI(PREAMBLE_CFG0);   bitClear(v, 5);   writeSPI(PREAMBLE_CFG0, v);   // Sync off   v = readSPI(SYNC_CFG0);   v &= B11100011;   writeSPI(SYNC_CFG0, v);   // CRC off   v = readSPI(PKT_CFG1);   v &= B11110011;   writeSPI(PKT_CFG1, v);   writeSPI(IOCFG0, CARRIER_SENSE);   writ...

CC1120 - CFM demodulate experiment

Image
29.9.2020 CC1120 - CFM demodulate experiment Arduino Uno & CC1120 CCRF3 Click https://www.mikroe.com/ccrf-3-click Arduino Uno digital pin 2 connected to GDO0 (CLKEN_CFM), digital pin 3 connected to GDO2 (CARRIER_SENSE) and digital pin 4 connected to piezo buzzer Test TX device: PMR446, channel 2 When PMR446 PTT pushed flat tone (CC1120 carrier sense acts like squelch, AGC_CS_THR) is heard from piezo buzzer, when talking lots of alternating noise ... CC1120 Custom frequency modulation (CFM) and transparent serial modes enabled. * CFM_RX_DATA_OUT register value is in two's complement format. Negative value conversion to positive decimal format:       if (bitRead(cfmData, 7)) {         cfmData = ~cfmData;         cfmData += 1;       } * #include <SPI.h> #include "cc1120.h" #define PRINT_INFO    1 #define EXT      ...