From a9d1814e8d1dc9d7480c67a1eb1145d07b10218e Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Fri, 14 Apr 2017 21:51:18 -0300 Subject: [PATCH 01/12] Update date of the firmware --- SerialPort.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SerialPort.cpp b/SerialPort.cpp index 4cfb633..3f370c1 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -69,9 +69,9 @@ const uint8_t MMDVM_DEBUG4 = 0xF4U; const uint8_t MMDVM_DEBUG5 = 0xF5U; #if defined(ADF7021_N_VER) -#define DESCRIPTION "MMDVM_HS-ADF7021N 20170325 (D-Star/DMR/YSF/P25)" +#define DESCRIPTION "MMDVM_HS-ADF7021N 20170414 (D-Star/DMR/YSF/P25)" #else -#define DESCRIPTION "MMDVM_HS-ADF7021 20170325 (D-Star/DMR/YSF/P25)" +#define DESCRIPTION "MMDVM_HS-ADF7021 20170414 (D-Star/DMR/YSF/P25)" #endif #define concat(a, b, c) a " (Build: " b " " c ")" From 1e6f3c7c9956a58b229a97c52675d025bac20618 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sat, 15 Apr 2017 16:26:30 -0300 Subject: [PATCH 02/12] Change default DMO slot to 2 --- DMRDMOTX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DMRDMOTX.cpp b/DMRDMOTX.cpp index ccf24a2..9933688 100644 --- a/DMRDMOTX.cpp +++ b/DMRDMOTX.cpp @@ -57,12 +57,12 @@ void CDMRDMOTX::process() createCACH(m_poBuffer + 0U, 0U); for (unsigned int i = 0U; i < DMR_FRAME_LENGTH_BYTES; i++) - m_poBuffer[i + 3U] = m_fifo.get(); + m_poBuffer[i + 3U] = m_idle[i]; createCACH(m_poBuffer + 36U, 1U); for (unsigned int i = 0U; i < DMR_FRAME_LENGTH_BYTES; i++) - m_poBuffer[i + 39U] = m_idle[i]; + m_poBuffer[i + 39U] = m_fifo.get(); m_poLen = 72U; } From 9696ea5458e3de9cea6518aa73cb5f846862949a Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 11:50:35 -0300 Subject: [PATCH 03/12] Adding GPIO sequence to init bootloader mode for ZUMSpot (Pi) --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index fbab264..deda73c 100644 --- a/Makefile +++ b/Makefile @@ -181,6 +181,9 @@ serial: serial-bl: $(STM32FLASH) -v -w STM32F10X_Lib/utils/bootloader/generic_boot20_pc13.bin -g 0x0 $(devser) $(STM32FLASH) -v -w bin/$(BINBIN) -g 0x0 -S 0x08002000 $(devser) + +zumspot-pi: + $(STM32FLASH) -v -w bin/$(BINBIN) -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 dfu: ifdef devser From b4ddedcf2af5af85a0e0f6d130b16aa2fc360db4 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 16:07:44 -0300 Subject: [PATCH 04/12] Reverting TX continuous mode in DMR DMO --- DMRDMOTX.cpp | 70 ++++---------------------------------------------- DMRDMOTX.h | 5 ---- SerialPort.cpp | 1 - 3 files changed, 5 insertions(+), 71 deletions(-) diff --git a/DMRDMOTX.cpp b/DMRDMOTX.cpp index 9933688..c4426a0 100644 --- a/DMRDMOTX.cpp +++ b/DMRDMOTX.cpp @@ -22,18 +22,6 @@ #include "Config.h" #include "Globals.h" -#include "DMRSlotType.h" - -// The PR FILL and Data Sync pattern. -const uint8_t IDLE_DATA[] = - {0x53U, 0xC2U, 0x5EU, 0xABU, 0xA8U, 0x67U, 0x1DU, 0xC7U, 0x38U, 0x3BU, 0xD9U, - 0x36U, 0x00U, 0x0DU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xD0U, 0x03U, 0xF6U, - 0xE4U, 0x65U, 0x17U, 0x1BU, 0x48U, 0xCAU, 0x6DU, 0x4FU, 0xC6U, 0x10U, 0xB4U}; - -const uint8_t EMPTY_SHORT_LC[] = - {0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U}; - -const uint8_t DMR_SYNC = 0x5FU; CDMRDMOTX::CDMRDMOTX() : m_fifo(), @@ -53,18 +41,12 @@ void CDMRDMOTX::process() m_poLen = m_txDelay; } else { m_delay = false; - - createCACH(m_poBuffer + 0U, 0U); + + for (unsigned int i = 0U; i < 72U; i++) + m_poBuffer[m_poLen++] = 0x00U; for (unsigned int i = 0U; i < DMR_FRAME_LENGTH_BYTES; i++) - m_poBuffer[i + 3U] = m_idle[i]; - - createCACH(m_poBuffer + 36U, 1U); - - for (unsigned int i = 0U; i < DMR_FRAME_LENGTH_BYTES; i++) - m_poBuffer[i + 39U] = m_fifo.get(); - - m_poLen = 72U; + m_poBuffer[i] = m_fifo.get(); } m_poPtr = 0U; @@ -76,7 +58,7 @@ void CDMRDMOTX::process() while (space > 8U) { if (m_delay) { m_poPtr++; - writeByte(DMR_SYNC); + writeByte(0U); } else writeByte(m_poBuffer[m_poPtr++]); @@ -132,45 +114,3 @@ void CDMRDMOTX::setTXDelay(uint8_t delay) { m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay } - - -void CDMRDMOTX::createCACH(uint8_t* buffer, uint8_t slotIndex) -{ - if (m_cachPtr >= 12U) - m_cachPtr = 0U; - - ::memcpy(buffer, EMPTY_SHORT_LC + m_cachPtr, 3U); - - bool at = true; - bool tc = slotIndex == 1U; - bool ls0 = true; // For 1 and 2 - bool ls1 = true; - - if (m_cachPtr == 0U) // For 0 - ls1 = false; - else if (m_cachPtr == 9U) // For 3 - ls0 = false; - - bool h0 = at ^ tc ^ ls1; - bool h1 = tc ^ ls1 ^ ls0; - bool h2 = at ^ tc ^ ls0; - - buffer[0U] |= at ? 0x80U : 0x00U; - buffer[0U] |= tc ? 0x08U : 0x00U; - buffer[1U] |= ls1 ? 0x80U : 0x00U; - buffer[1U] |= ls0 ? 0x08U : 0x00U; - buffer[1U] |= h0 ? 0x02U : 0x00U; - buffer[2U] |= h1 ? 0x20U : 0x00U; - buffer[2U] |= h2 ? 0x02U : 0x00U; - - m_cachPtr += 3U; -} - -void CDMRDMOTX::setColorCode(uint8_t colorCode) -{ - ::memcpy(m_idle, IDLE_DATA, DMR_FRAME_LENGTH_BYTES); - - CDMRSlotType slotType; - slotType.encode(colorCode, DT_IDLE, m_idle); -} - diff --git a/DMRDMOTX.h b/DMRDMOTX.h index d4e3ef7..ce8459a 100644 --- a/DMRDMOTX.h +++ b/DMRDMOTX.h @@ -36,8 +36,6 @@ public: void setTXDelay(uint8_t delay); uint16_t getSpace() const; - - void setColorCode(uint8_t colorCode); private: CSerialRB m_fifo; @@ -47,10 +45,7 @@ private: uint16_t m_txDelay; uint32_t m_count; bool m_delay; - uint8_t m_idle[DMR_FRAME_LENGTH_BYTES]; - uint8_t m_cachPtr; - void createCACH(uint8_t* buffer, uint8_t slotIndex); void writeByte(uint8_t c); }; diff --git a/SerialPort.cpp b/SerialPort.cpp index 3f370c1..8a33f19 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -236,7 +236,6 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length) dmrDMOTX.setTXDelay(txDelay); dmrDMORX.setColorCode(colorCode); - dmrDMOTX.setColorCode(colorCode); io.setLoDevYSF(ysfLoDev); From c1847e8f8d36bb3223fd86abf2384db59e7995d3 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Mon, 17 Apr 2017 00:36:38 -0300 Subject: [PATCH 05/12] Removing invalid characters from Makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index deda73c..ff712be 100644 --- a/Makefile +++ b/Makefile @@ -53,17 +53,17 @@ else DFU_RST=./STM32F10X_Lib/utils/linux64/upload-reset DFU_UTIL=./STM32F10X_Lib/utils/linux64/dfu-util ST_FLASH=./STM32F10X_Lib/utils/linux64/st-flash - STM32FLASH=./STM32F10X_Lib/utils/linux64/stm32flash + STM32FLASH=./STM32F10X_Lib/utils/linux64/stm32flash else ifeq ($(shell uname -m),armv7l) DFU_RST=./STM32F10X_Lib/utils/rpi32/upload-reset DFU_UTIL=./STM32F10X_Lib/utils/rpi32/dfu-util ST_FLASH=./STM32F10X_Lib/utils/rpi32/st-flash - STM32FLASH=./STM32F10X_Lib/utils/rpi32/stm32flash + STM32FLASH=./STM32F10X_Lib/utils/rpi32/stm32flash else DFU_RST=./STM32F10X_Lib/utils/linux/upload-reset DFU_UTIL=./STM32F10X_Lib/utils/linux/dfu-util ST_FLASH=./STM32F10X_Lib/utils/linux/st-flash - STM32FLASH=./STM32F10X_Lib/utils/linux/stm32flash + STM32FLASH=./STM32F10X_Lib/utils/linux/stm32flash endif endif @@ -71,7 +71,7 @@ else DFU_RST=./STM32F10X_Lib/utils/macosx/upload-reset DFU_UTIL=./STM32F10X_Lib/utils/macosx/dfu-util ST_FLASH=./STM32F10X_Lib/utils/macosx/st-flash - STM32FLASH=./STM32F10X_Lib/utils/macosx/stm32flash + STM32FLASH=./STM32F10X_Lib/utils/macosx/stm32flash endif endif From b7b82bf0ebb7716df0290a1fa7d7d684b34ec68b Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Mon, 17 Apr 2017 14:26:41 -0300 Subject: [PATCH 06/12] Changing stm32flash path to point to the the local binary for zumspot-pi uploading method --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ff712be..a2b2d06 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,13 @@ serial-bl: $(STM32FLASH) -v -w bin/$(BINBIN) -g 0x0 -S 0x08002000 $(devser) zumspot-pi: - $(STM32FLASH) -v -w bin/$(BINBIN) -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 +ifneq ($(wildcard /usr/local/bin/stm32flash),) + /usr/local/bin/stm32flash -v -w bin/$(BINBIN) -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 +endif + +ifneq ($(wildcard /usr/bin/stm32flash),) + /usr/bin/stm32flash -v -w bin/$(BINBIN) -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 +endif dfu: ifdef devser From 2584d2e455ec74e7aeab818ec18a56422d9d5427 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 19 Apr 2017 00:02:23 -0300 Subject: [PATCH 07/12] Adding building instructions for Raspberry Pi with ZUMSpot Pi --- BUILD.txt | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 BUILD.txt diff --git a/BUILD.txt b/BUILD.txt new file mode 100644 index 0000000..ca9ed9b --- /dev/null +++ b/BUILD.txt @@ -0,0 +1,77 @@ +Building instructions: + +1) Raspberry Pi with ZUMSpot Pi: + +* Download latest Raspbian image and install to a micro SD +- See: https://www.raspberrypi.org/documentation/installation/installing-images/ +- Configure your SD before booting. Useful article: + https://styxit.com/2017/03/14/headless-raspberry-setup.html +- Boot your Raspberry Pi +- Run raspi-config and configure according your preferences: +sudo raspi-config +(at least expand filesystem and change default password. It's a good idea to enable "Wait +for Network at Boot" and disable Desktop GUI if you don't plan to use it) + +* Enable serial port /dev/ttyAMA0 (Raspberry Pi 3 or Pi Zero W only): +- Edit /boot/cmdline.txt +sudo nano /boot/cmdline.txt +(remove the text: console=serial0,115200) + +- Disable services: +sudo systemctl disable serial-getty@ttyAMA0.service +sudo systemctl disable bluetooth.service + +- Edit /boot/config.txt +sudo nano /boot/config.txt +(add the following lines): +enable_uart=1 +dtoverlay=pi3-disable-bt + +- Reboot the RPi: +sudo reboot + +* Build de firmware and upload to ZUMSpot: +cd ~ +- Install the necessary software tools: +sudo apt-get update +sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi +git clone https://git.code.sf.net/p/stm32flash/code stm32flash +cd stm32flash +make +sudo make install +cd ~ + +- Download the sources: +git clone https://github.com/juribeparada/MMDVM_HS +cd MMDVM_HS/ +git clone https://github.com/juribeparada/STM32F10X_Lib + +- Edit Config.h +nano Config.h +(and enable): +#define PI_HAT_7021_REV_03 +#define ENABLE_ADF7021 +#define ADF7021_N_VER (only if your board uses ADF7021N) +#define BIDIR_DATA_PIN +#define ADF7021_14_7456 +#define STM32_USART1_HOST +#define ENABLE_SCAN_MODE + +- Build the firmware: +make + +- Upload the firmware to ZUMSpot Pi board: +sudo make zumspot-pi + +* Install MMDVMHost: +cd ~ +git clone https://github.com/g4klx/MMDVMHost/ +cd MMDVMHost/ +make + +- Edit MMDVM.ini according your preferences +nano MMDVM.ini +(use Port=/dev/ttyAMA0 in [Modem]) + +- Execute MMDVMHost: +./MMDVMHost MMDVM.ini From 14cbd3422138d263e2e25775948866c368561343 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 19 Apr 2017 01:20:46 -0300 Subject: [PATCH 08/12] Updating BUILD.txt for Raspberry Pi 2 --- BUILD.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BUILD.txt b/BUILD.txt index ca9ed9b..2c1e8cd 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -30,6 +30,17 @@ dtoverlay=pi3-disable-bt - Reboot the RPi: sudo reboot +* Enable serial port /dev/ttyAMA0 (Raspberry Pi 2 only): +- Edit /boot/cmdline.txt +sudo nano /boot/cmdline.txt +(remove the text: console=serial0,115200) + +- Disable services: +sudo systemctl disable serial-getty@ttyAMA0.service + +- Reboot the RPi: +sudo reboot + * Build de firmware and upload to ZUMSpot: cd ~ - Install the necessary software tools: From 9344e86b973ee6e6d210af453ba2e84c51731644 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 19 Apr 2017 17:38:13 -0300 Subject: [PATCH 09/12] Adding more documentation (Makefile options) --- BUILD.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/BUILD.txt b/BUILD.txt index 2c1e8cd..320d264 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -86,3 +86,64 @@ nano MMDVM.ini - Execute MMDVMHost: ./MMDVMHost MMDVM.ini + +2) ZUMSpot USB: + +* Windows: +coming soon... + +* Linux: +coming soon... + +3) Makefile options: + +make clean: delete all objects files *.o, for starting a new firmware building. + +make: it builds a standard firmware (without USB bootloader support). + +make bl: it builds a firmware with USB bootloader support. + +make zumspot-pi: upload the firmware to a ZUMSpot Pi version (using internal RPi serial port) + +make dfu [devser=/dev/ttyXXX]: upload firmware using USB bootloader. "devser" is optional, +and it corresponds to the USB serial port device name. This option permits to perform a reset +to enter to booloader mode (DFU). If you don't use "devser", you have to press the reset button +of the ZUMSpot just before using this command. + +make serial devser=/dev/ttyXXX: upload standard firmware using serial port bootloader method. + +make serial-bl devser=/dev/ttyXXX: upload firmware with USB bootloader support using serial +port bootloader method. + +make stlink: upload standard firmware using ST-Link interface. + +make stlink-bl: upload firmware with USB bootloader support using ST-Link interface. + +make ocd: upload standard firmware using ST-Link interface. This method uses a local +openocd installation. + +make ocd-bl: upload firmware with USB bootloader support using ST-Link interface. This +method uses a local openocd installation. + +* Common Makefile commands: +- Serial programming (first programming, transfer the USB bootloader): +make clean +make bl +sudo make serial-bl devser=/dev/ttyUSB0 + +- USB programming (you have already transfered the USB bootloader): +make clean +make bl +sudo make dfu (reset ZUMSpot before) or +sudo make dfu devser=/dev/ttyACM0 (/dev/ttyACM0 is the device name of ZUMSpot USB under +Raspbian) + +- ZUMSpot Pi (no USB support needed): +make clean +make +sudo make zumspot-pi + +4) Config.h options: + +coming soon... + From 3657d0c0389043f05261e45c0250483b3607b038 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sat, 22 Apr 2017 00:28:33 -0300 Subject: [PATCH 10/12] Adding DMR SYNC to DMO --- DMRDMOTX.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DMRDMOTX.cpp b/DMRDMOTX.cpp index c4426a0..88f06d3 100644 --- a/DMRDMOTX.cpp +++ b/DMRDMOTX.cpp @@ -23,6 +23,8 @@ #include "Config.h" #include "Globals.h" +const uint8_t DMR_SYNC = 0x5FU; + CDMRDMOTX::CDMRDMOTX() : m_fifo(), m_poBuffer(), @@ -43,7 +45,7 @@ void CDMRDMOTX::process() m_delay = false; for (unsigned int i = 0U; i < 72U; i++) - m_poBuffer[m_poLen++] = 0x00U; + m_poBuffer[m_poLen++] = DMR_SYNC; for (unsigned int i = 0U; i < DMR_FRAME_LENGTH_BYTES; i++) m_poBuffer[i] = m_fifo.get(); @@ -58,7 +60,7 @@ void CDMRDMOTX::process() while (space > 8U) { if (m_delay) { m_poPtr++; - writeByte(0U); + writeByte(DMR_SYNC); } else writeByte(m_poBuffer[m_poPtr++]); From aa3b285e5c7fa587ef2ba7ec8bd7fbca9ecadbb0 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 26 Apr 2017 23:38:54 -0300 Subject: [PATCH 11/12] Adding test modes for ADF7021 (only for debugging) --- ADF7021.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ADF7021.cpp b/ADF7021.cpp index 472a67c..ac5d5fe 100644 --- a/ADF7021.cpp +++ b/ADF7021.cpp @@ -251,6 +251,10 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset) ADF7021_TX_REG0 |= (uint32_t) N_divider << 19; // frequency; ADF7021_TX_REG0 |= (uint32_t) F_divider << 4; // frequency; +#if defined(TEST_TX) + modemState = STATE_DSTAR; +#endif + switch (modemState) { case STATE_DSTAR: // Dev: 1200 Hz, symb rate = 4800 @@ -377,8 +381,12 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset) AD7021_control_word = ADF7021_REG2; Send_AD7021_control(); - // TEST MODE (disabled) (15) - AD7021_control_word = 0x000E000F; + // TEST DAC (14) +#if defined(TEST_DAC) + AD7021_control_word = 0x0000001E; +#else + AD7021_control_word = 0x0000000E; +#endif Send_AD7021_control(); // AGC (auto, defaults) (9) @@ -400,7 +408,18 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset) // 3FSK/4FSK DEMOD (13) AD7021_control_word = ADF7021_REG13; Send_AD7021_control(); - + +#if defined(TEST_TX) + PTT_pin(HIGH); + AD7021_control_word = ADF7021_TX_REG0; + Send_AD7021_control(); + // TEST MODE (TX carrier only) (15) + AD7021_control_word = 0x000E010F; +#else + // TEST MODE (disabled) (15) + AD7021_control_word = 0x000E000F; +#endif + Send_AD7021_control(); } void CIO::interrupt() From afc6cb6c47d4d7b39eebe98850f1127f6b8f3105 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 26 Apr 2017 23:40:50 -0300 Subject: [PATCH 12/12] Removing 19.68 MHz TCXO support and adding test modes support --- ADF7021.h | 94 +++++++++++++------------------------------------------ Config.h | 2 -- 2 files changed, 22 insertions(+), 74 deletions(-) diff --git a/ADF7021.h b/ADF7021.h index df187d1..c8a56a1 100644 --- a/ADF7021.h +++ b/ADF7021.h @@ -34,6 +34,14 @@ http://www.analog.com/en/products/rf-microwave/integrated-transceivers-transmitt www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf */ +/***** Test modes ****/ +// Enable SWD pin to access the demodulator output signal +// See application note AN-852 and ADF7021 datasheet, page 60 +// #define TEST_DAC + +// Transmit the carrier frequency +// #define TEST_TX + /****** Support for 14.7456 MHz TCXO (modified RF7021SE boards) ******/ #if defined(ADF7021_14_7456) @@ -55,9 +63,15 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf // TX/RX CLOCK register (REG 03) #define ADF7021_REG3_DSTAR 0x2A4C4193 +#if defined(TEST_DAC) +#define ADF7021_REG3_DMR 0x2A4C04D3 +#define ADF7021_REG3_YSF 0x2A4C04D3 +#define ADF7021_REG3_P25 0x2A4C04D3 +#else #define ADF7021_REG3_DMR 0x2A4C80D3 #define ADF7021_REG3_YSF 0x2A4C80D3 #define ADF7021_REG3_P25 0x2A4C80D3 +#endif // Discriminator bandwith, demodulator (REG 04) // Bug in ADI evaluation software, use datasheet formula (4FSK) @@ -69,7 +83,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf // Post demodulator bandwith (REG 04) #define ADF7021_POST_BW_DSTAR 10U -#define ADF7021_POST_BW_DMR 65U +#define ADF7021_POST_BW_DMR 100U #define ADF7021_POST_BW_YSF 20U #define ADF7021_POST_BW_P25 6U @@ -104,76 +118,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf #define AFC_OFFSET_P25 0 #endif -/****** Support for 19.6800 MHz TCXO (original RF7021SE boards) ******/ -#elif defined(ADF7021_19_6800) - -// R = 4 -#define ADF7021_PFD 4920000.0 - -// PLL (REG 01) -#define ADF7021_REG1_VHF1 0x021F5041 -#define ADF7021_REG1_VHF2 0x021F5041 -#define ADF7021_REG1_UHF1 0x00575041 -#define ADF7021_REG1_UHF2 0x00535041 - -// Deviation of modulator (REG 02) -#define ADF7021_DEV_DSTAR 32U -#define ADF7021_DEV_DMR 17U -#define ADF7021_DEV_YSF_L 14U -#define ADF7021_DEV_YSF_H 27U -#define ADF7021_DEV_P25 16U - -// TX/RX CLOCK register (REG 03) -#define ADF7021_REG3_DSTAR 0x2B1449E3 -#define ADF7021_REG3_DMR 0x2B148123 -#define ADF7021_REG3_YSF 0x2B148123 -#define ADF7021_REG3_P25 0x2B148123 - -// Discriminator bandwith, demodulator (REG 04) -// Bug in ADI evaluation software, use datasheet formula (4FSK) -#define ADF7021_DISC_BW_DSTAR 597U // K=85 -#define ADF7021_DISC_BW_DMR 393U // K=32 -#define ADF7021_DISC_BW_YSF_L 394U // K=32 -#define ADF7021_DISC_BW_YSF_H 344U // K=28 -#define ADF7021_DISC_BW_P25 394U // K=32 - -// Post demodulator bandwith (REG 04) -#define ADF7021_POST_BW_DSTAR 10U -#define ADF7021_POST_BW_DMR 65U -#define ADF7021_POST_BW_YSF 20U -#define ADF7021_POST_BW_P25 6U - -// IF filter (REG 05) -#define ADF7021_REG5 0x00003155 - -// IF CAL (coarse cal, defaults) (REG 06) -#define ADF7021_REG6 0x050972C6 - -// AFC (REG 10) -#define ADF7021_REG10_DSTAR 0x0C96355A - -#if defined(ADF7021_ENABLE_4FSK_AFC) -#define ADF7021_REG10_DMR 0x01FE355A -#define ADF7021_REG10_YSF 0x01FE355A -#define ADF7021_REG10_P25 0x01FE355A -#if defined(ADF7021_AFC_POS) -#define AFC_OFFSET_DMR -250 -#define AFC_OFFSET_YSF -250 -#define AFC_OFFSET_P25 -250 -#else -#define AFC_OFFSET_DMR 250 -#define AFC_OFFSET_YSF 250 -#define AFC_OFFSET_P25 250 -#endif -#else -#define ADF7021_REG10_DMR 0x049E354A -#define ADF7021_REG10_YSF 0x049E354A -#define ADF7021_REG10_P25 0x049E354A -#define AFC_OFFSET_DMR 0 -#define AFC_OFFSET_YSF 0 -#define AFC_OFFSET_P25 0 -#endif - /****** Support for 12.2880 MHz TCXO ******/ #elif defined(ADF7021_12_2880) @@ -195,9 +139,15 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf // TX/RX CLOCK register (REG 03) #define ADF7021_REG3_DSTAR 0x29EC4153 +#if defined(TEST_DAC) +#define ADF7021_REG3_DMR 0x29EC0493 +#define ADF7021_REG3_YSF 0x29EC0493 +#define ADF7021_REG3_P25 0x29EC0493 +#else #define ADF7021_REG3_DMR 0x29ECA093 #define ADF7021_REG3_YSF 0x29ECA093 #define ADF7021_REG3_P25 0x29ECA093 +#endif // Discriminator bandwith, demodulator (REG 04) // Bug in ADI evaluation software, use datasheet formula (4FSK) @@ -209,7 +159,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf // Post demodulator bandwith (REG 04) #define ADF7021_POST_BW_DSTAR 10U -#define ADF7021_POST_BW_DMR 65U +#define ADF7021_POST_BW_DMR 100U #define ADF7021_POST_BW_YSF 20U #define ADF7021_POST_BW_P25 6U diff --git a/Config.h b/Config.h index 7364f84..11b9714 100644 --- a/Config.h +++ b/Config.h @@ -41,8 +41,6 @@ #define ADF7021_14_7456 // For 12.2880 MHz: // #define ADF7021_12_2880 -// Original 19.68 MHz, not working, only for experimentation: -// #define ADF7021_19_6800 // AFC is enabled by default in D-Star