From b40b2dc6f1590f8d3e57e859e25e576430505d5d Mon Sep 17 00:00:00 2001 From: roncarr880 Date: Sat, 13 Apr 2019 20:33:08 -0400 Subject: [PATCH] Changed eeprom save to the 1st freq transmitted instead of the last. This change allows using the wsjt frequency hopping feature on Tx without wearing out the eeprom. --- QRP_LABS_WSPR.ino | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/QRP_LABS_WSPR.ino b/QRP_LABS_WSPR.ino index 138c1bd..f90f14a 100644 --- a/QRP_LABS_WSPR.ino +++ b/QRP_LABS_WSPR.ino @@ -5,10 +5,11 @@ // The CAT emulation is TenTec Argonaut V at 1200 baud. -// To set a new operation frequency for stand alone Frame Mode, start wsjt-x or HRD. +// To set a new operation frequency for stand alone Frame Mode, restart the Arduino, start wsjt-x or HRD. // Tune to one of the magic WSPR frequencies and toggle TX (tune in wsjt will work). // The new frequency will be stored in EEPROM. -// If using the band hopping feature of WSJT, disable the EEPROM writes, function ee_save(). +// If using the band hopping feature of WSJT, make sure the first transmit is on the band you wish for +// the default. Only one save is performed per Arduino reset. // // A 4:1 frequency relationship between the tx freq and the rx clock is maintained using the // R dividers in the SI5351. Dividers 1 - rx and 4 - tx will cover 1mhz to 30mhz @@ -101,14 +102,15 @@ void ee_save(){ uint8_t i; static uint8_t last_i = 255; - // return; // uncomment if using the frequency hopping feature and transmitting on more than one band - // to avoid wearing out the eeprom + if( last_i != 255 ) return; // save only the freq of the 1st time transmitting after reset for( i = 0; i < 10; ++i ){ if( freq == magic_freq[i] ) break; } if( i == 10 ) return; // not a wspr frequency - if( i == last_i ) return; // already wrote this one + // if( i == last_i ) return; // already wrote this one. ( redundant - only saving 1st power up tx freq now + // instead of the last transmit freq. This allows wsjt band hopping tx + // without wearing out the eeprom last_i = i; EEPROM.put(0,Rdiv); // put does not write if data matches