From 9bb4224a9454e3d38d91592acff656fda20fbc71 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Wed, 27 Dec 2017 15:04:35 -0300 Subject: [PATCH 1/7] Updating revision --- version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.h b/version.h index 8b52f35..df4541c 100644 --- a/version.h +++ b/version.h @@ -23,8 +23,8 @@ #define VER_MAJOR "1" #define VER_MINOR "0" -#define VER_REV "3" -#define VERSION_DATE "20171226" +#define VER_REV "4" +#define VERSION_DATE "20171227" #if defined(ZUMSPOT_ADF7021) #define BOARD_INFO "ZUMspot" From 49e9377474f2746c427cbfb4240d9be094982a5f Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Thu, 28 Dec 2017 09:25:15 -0300 Subject: [PATCH 2/7] Fix typo --- ADF7021.cpp | 2 +- BUILD.md | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ADF7021.cpp b/ADF7021.cpp index cf44ab4..3bd478e 100644 --- a/ADF7021.cpp +++ b/ADF7021.cpp @@ -301,7 +301,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset) ADF7021_REG13 |= (uint32_t) ADF7021_SLICER_TH_DMR << 4; // slicer threshold ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5) - ADF7021_REG2 |= (uint32_t) (m_cwIdTXLevel / div2) << 19; // deviation + ADF7021_REG2 |= (uint32_t) (m_cwIdTXLevel / div2) << 19; // deviation ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK) break; diff --git a/BUILD.md b/BUILD.md index c7f7607..4c7eed4 100644 --- a/BUILD.md +++ b/BUILD.md @@ -71,7 +71,7 @@ Reboot your RPi: sudo reboot -### Build de firmware and upload to ZUMspot RPi +### Build the firmware and upload to ZUMspot RPi If you are using Pi-Star, expand filesystem (if you haven't done before): diff --git a/README.md b/README.md index 2c022e1..2ef415e 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ Reboot your RPi: sudo reboot -#### Build de firmware and upload to ZUMspot RPi +#### Build the firmware and upload to ZUMspot RPi If you are using Pi-Star, expand filesystem (if you haven't done before): From 97b443679647eb4b32d53e4cb0da7deeb7870d0a Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sat, 30 Dec 2017 00:34:06 -0300 Subject: [PATCH 3/7] Support for controlling RF power level --- ADF7021.cpp | 1 + IO.cpp | 8 +++++--- IO.h | 2 +- SerialPort.cpp | 11 ++++++++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ADF7021.cpp b/ADF7021.cpp index 3bd478e..647c4a4 100644 --- a/ADF7021.cpp +++ b/ADF7021.cpp @@ -867,6 +867,7 @@ void CIO::printConf() DEBUG1("MMDVM_HS FW configuration:"); DEBUG2I("TX freq (Hz):", TXfreq()); DEBUG2I("RX freq (Hz):", RXfreq()); + DEBUG2("Power set:", m_power); DEBUG2("D-Star dev (Hz):", devDSTAR()); DEBUG2("DMR +1 sym dev (Hz):", devDMR()); DEBUG2("YSF_H +1 sym dev (Hz):", devYSF_H()); diff --git a/IO.cpp b/IO.cpp index 4584f59..c04b7bc 100644 --- a/IO.cpp +++ b/IO.cpp @@ -266,17 +266,19 @@ bool CIO::hasRXOverflow() return m_rxBuffer.hasOverflowed(); } -uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx) +uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power) { - // power level - m_power = 0xFF; + // Configure power level + m_power = rf_power; + // Check frequency ranges if( !( ((frequency_rx >= VHF1_MIN)&&(frequency_rx < VHF1_MAX)) || ((frequency_tx >= VHF1_MIN)&&(frequency_tx < VHF1_MAX)) || \ ((frequency_rx >= UHF1_MIN)&&(frequency_rx < UHF1_MAX)) || ((frequency_tx >= UHF1_MIN)&&(frequency_tx < UHF1_MAX)) || \ ((frequency_rx >= VHF2_MIN)&&(frequency_rx < VHF2_MAX)) || ((frequency_tx >= VHF2_MIN)&&(frequency_tx < VHF2_MAX)) || \ ((frequency_rx >= UHF2_MIN)&&(frequency_rx < UHF2_MAX)) || ((frequency_tx >= UHF2_MIN)&&(frequency_tx < UHF2_MAX)) ) ) return 4U; + // Configure frequency m_frequency_rx = frequency_rx; m_frequency_tx = frequency_tx; diff --git a/IO.h b/IO.h index 69ce3a5..e366c36 100644 --- a/IO.h +++ b/IO.h @@ -91,7 +91,7 @@ public: void process(void); bool hasTXOverflow(void); bool hasRXOverflow(void); - uint8_t setFreq(uint32_t frequency_rx, uint32_t frequency_tx); + uint8_t setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power); void setMode(MMDVM_STATE modemState); void setDecode(bool dcd); void setLoDevYSF(bool ysfLoDev); diff --git a/SerialPort.cpp b/SerialPort.cpp index e6edfcf..2c87a49 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -298,10 +298,19 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length) uint8_t CSerialPort::setFreq(const uint8_t* data, uint8_t length) { uint32_t freq_rx, freq_tx; + uint8_t rf_power; if (length < 9U) return 4U; + // Old MMDVMHost, set full power + if (length == 9U) + rf_power = 255U; + + // New MMDVMHost, set power from MMDVM.ini + if (length == 10U) + rf_power = data[9]; + freq_rx = data[1] * 1; freq_rx += data[2] * 256; freq_rx += data[3] * 65536; @@ -312,7 +321,7 @@ uint8_t CSerialPort::setFreq(const uint8_t* data, uint8_t length) freq_tx += data[7] * 65536; freq_tx += data[8] * 16777216; - return io.setFreq(freq_rx, freq_tx); + return io.setFreq(freq_rx, freq_tx, rf_power); } void CSerialPort::setMode(MMDVM_STATE modemState) From 840462fafec2e17f6e2dc85ba6b3d7cd5bf77e96 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sat, 30 Dec 2017 00:36:41 -0300 Subject: [PATCH 4/7] Restoring set config command length --- SerialPort.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPort.cpp b/SerialPort.cpp index 2c87a49..5d86f05 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -189,7 +189,7 @@ void CSerialPort::getVersion() uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length) { - if (length < 15U) + if (length < 13U) return 4U; bool ysfLoDev = (data[0U] & 0x08U) == 0x08U; From 00b58cf795bbfc12bec31737c12215c8d7759b4e Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 31 Dec 2017 18:22:29 -0300 Subject: [PATCH 5/7] Fix power level bit length for ADF7021 --- ADF7021.cpp | 17 ++++++++++------- IO.cpp | 2 +- IO.h | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ADF7021.cpp b/ADF7021.cpp index 647c4a4..dc4fa24 100644 --- a/ADF7021.cpp +++ b/ADF7021.cpp @@ -43,7 +43,7 @@ uint32_t ADF7021_REG1; uint32_t div2; uint32_t f_div; -static void Send_AD7021_control_shift() +static void Send_AD7021_control_shift() { int AD7021_counter; @@ -62,7 +62,7 @@ static void Send_AD7021_control_shift() io.SDATA_pin(LOW); } -static void Send_AD7021_control_slePulse() +static void Send_AD7021_control_slePulse() { io.SLE_pin(HIGH); io.dlybit(); @@ -626,9 +626,9 @@ void CIO::ifConf2(MMDVM_STATE modemState) Send_AD7021_control2(); // MODULATION (2) - ADF7021_REG2 |= (uint32_t) 0b0010; // register 2 - ADF7021_REG2 |= (uint32_t) m_power << 13; // power level - ADF7021_REG2 |= (uint32_t) 0b110001 << 7; // PA + ADF7021_REG2 |= (uint32_t) 0b0010; // register 2 + ADF7021_REG2 |= (uint32_t) (m_power & 0x3F) << 13; // power level + ADF7021_REG2 |= (uint32_t) 0b110001 << 7; // PA AD7021_control_word = ADF7021_REG2; Send_AD7021_control2(); @@ -786,7 +786,6 @@ void CIO::interrupt2() } #endif -//====================================================================================================================== void CIO::setTX() { // PTT pin on (doing it earlier helps to measure timing impact) @@ -806,7 +805,6 @@ void CIO::setTX() while(CLK_pin()); } -//====================================================================================================================== void CIO::setRX(bool doSle) { // PTT pin off (doing it earlier helps to measure timing impact) @@ -827,6 +825,11 @@ void CIO::setRX(bool doSle) } } +void CIO::setPower(uint8_t power) +{ + m_power = power >> 2; +} + uint32_t CIO::RXfreq() { return (uint32_t)((float)(ADF7021_PFD / f_div) * ((float)((32768 * m_RX_N_divider) + m_RX_F_divider) / 32768.0)) + 100000; diff --git a/IO.cpp b/IO.cpp index c04b7bc..ea0f491 100644 --- a/IO.cpp +++ b/IO.cpp @@ -269,7 +269,7 @@ bool CIO::hasRXOverflow() uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power) { // Configure power level - m_power = rf_power; + setPower(rf_power); // Check frequency ranges if( !( ((frequency_rx >= VHF1_MIN)&&(frequency_rx < VHF1_MAX)) || ((frequency_tx >= VHF1_MIN)&&(frequency_tx < VHF1_MAX)) || \ diff --git a/IO.h b/IO.h index e366c36..a52db83 100644 --- a/IO.h +++ b/IO.h @@ -92,6 +92,7 @@ public: bool hasTXOverflow(void); bool hasRXOverflow(void); uint8_t setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power); + void setPower(uint8_t power); void setMode(MMDVM_STATE modemState); void setDecode(bool dcd); void setLoDevYSF(bool ysfLoDev); From 7ce1d91bc73d6ee919d60505a97720599e89bb51 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 31 Dec 2017 18:23:57 -0300 Subject: [PATCH 6/7] Change revision --- version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.h b/version.h index df4541c..23acfaf 100644 --- a/version.h +++ b/version.h @@ -23,8 +23,8 @@ #define VER_MAJOR "1" #define VER_MINOR "0" -#define VER_REV "4" -#define VERSION_DATE "20171227" +#define VER_REV "5" +#define VERSION_DATE "20171231" #if defined(ZUMSPOT_ADF7021) #define BOARD_INFO "ZUMspot" From 40cb087e9ef1087ccb24e0543f894c980c95ec5a Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sat, 6 Jan 2018 12:45:27 -0300 Subject: [PATCH 7/7] Preparing release v1.1.0 --- scripts/install_fw_duplex.sh | 2 +- scripts/install_fw_hshat.sh | 2 +- scripts/install_fw_librekit.sh | 2 +- scripts/install_fw_rpi.sh | 2 +- scripts/install_fw_usb.sh | 2 +- version.h | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install_fw_duplex.sh b/scripts/install_fw_duplex.sh index 5c09313..3299efb 100755 --- a/scripts/install_fw_duplex.sh +++ b/scripts/install_fw_duplex.sh @@ -17,7 +17,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Configure latest version -FW_VERSION="v1.0.2" +FW_VERSION="v1.1.0" # Change USB-serial port name ONLY in macOS MAC_DEV_USB_SER="/dev/cu.usbmodem1441" diff --git a/scripts/install_fw_hshat.sh b/scripts/install_fw_hshat.sh index 4aa8773..dbddc39 100755 --- a/scripts/install_fw_hshat.sh +++ b/scripts/install_fw_hshat.sh @@ -17,7 +17,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Configure latest version -FW_VERSION="v1.0.2" +FW_VERSION="v1.1.0" # Change USB-serial port name ONLY in macOS MAC_DEV_USB_SER="/dev/cu.usbmodem1441" diff --git a/scripts/install_fw_librekit.sh b/scripts/install_fw_librekit.sh index 5b15e22..db21526 100755 --- a/scripts/install_fw_librekit.sh +++ b/scripts/install_fw_librekit.sh @@ -17,7 +17,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Configure latest version -FW_VERSION="v1.0.2" +FW_VERSION="v1.1.0" # Change USB-serial port name ONLY in macOS MAC_DEV_USB_SER="/dev/cu.usbmodem1441" diff --git a/scripts/install_fw_rpi.sh b/scripts/install_fw_rpi.sh index e5b0b21..69d5534 100755 --- a/scripts/install_fw_rpi.sh +++ b/scripts/install_fw_rpi.sh @@ -17,7 +17,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Configure latest version -FW_VERSION="v1.0.2" +FW_VERSION="v1.1.0" # Change USB-serial port name ONLY in macOS MAC_DEV_USB_SER="/dev/cu.usbmodem1441" diff --git a/scripts/install_fw_usb.sh b/scripts/install_fw_usb.sh index 0c64096..1e2f494 100755 --- a/scripts/install_fw_usb.sh +++ b/scripts/install_fw_usb.sh @@ -17,7 +17,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Configure latest version -FW_VERSION="v1.0.2" +FW_VERSION="v1.1.0" # Change USB-serial port name ONLY in macOS MAC_DEV_USB_SER="/dev/cu.usbmodem1441" diff --git a/version.h b/version.h index 23acfaf..4bab86d 100644 --- a/version.h +++ b/version.h @@ -22,9 +22,9 @@ #include "Config.h" #define VER_MAJOR "1" -#define VER_MINOR "0" -#define VER_REV "5" -#define VERSION_DATE "20171231" +#define VER_MINOR "1" +#define VER_REV "0" +#define VERSION_DATE "20180106" #if defined(ZUMSPOT_ADF7021) #define BOARD_INFO "ZUMspot"