From 7d988ba8ba81387b9652293b9c0073f498dd7a45 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 12 May 2017 09:21:03 +0000 Subject: [PATCH 1/4] Resolve #23 --- SODA_POP/SODA_POP.ino | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/SODA_POP/SODA_POP.ino b/SODA_POP/SODA_POP.ino index 60facce..d77b3fa 100644 --- a/SODA_POP/SODA_POP.ino +++ b/SODA_POP/SODA_POP.ino @@ -969,26 +969,13 @@ void calibration_set_correction() */ void fetch_calibration_data() { - unsigned long temp = 0; - - temp = EEPROM.read(3); - IFfreq = IFfreq+temp; - IFfreq = IFfreq << 8; - temp = EEPROM.read(2); - IFfreq = IFfreq + temp; - IFfreq = IFfreq << 8; - temp = EEPROM.read(1); - IFfreq = IFfreq + temp; - IFfreq = IFfreq << 8; - temp = EEPROM.read(0); - IFfreq = IFfreq + temp; - - temp = 0; - temp = EEPROM.read(5); - cal_value = temp; - cal_value = cal_value <<8; - temp = EEPROM.read(4); - cal_value = cal_value + temp; + IFfreq = EEPROM.read(3); + IFfreq = (IFfreq << 8) + EEPROM.read(2); + IFfreq = (IFfreq << 8) + EEPROM.read(1); + IFfreq = (IFfreq << 8) + EEPROM.read(0); + + cal_value = EEPROM.read(5); + cal_value = (cal_value << 8) + EEPROM.read(4); } /** From 4e5760b4d7981edbb987604474920cf31fd5ae2c Mon Sep 17 00:00:00 2001 From: vk3il Date: Fri, 5 May 2017 15:39:28 +1000 Subject: [PATCH 2/4] Adding VK band plan Added VK band plan and handled special case of gapped 80m band. --- SODA_POP/SODA_POP.ino | 12 +++++++ SODA_POP/bands.h | 76 ++++++++++++++++++++++++++++++++++++++++++- SODA_POP/settings.h | 1 + 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/SODA_POP/SODA_POP.ino b/SODA_POP/SODA_POP.ino index d77b3fa..b84841b 100644 --- a/SODA_POP/SODA_POP.ino +++ b/SODA_POP/SODA_POP.ino @@ -1011,6 +1011,18 @@ void freq_adjust(long step) */ void fix_op_freq() { +#ifdef PLAN_VK + if (state.band == BAND_80) { + if (state.op_freq > BAND_80_LOW_TOP && state.op_freq < BAND_80_GAP_MIDDLE){ + state.op_freq = BAND_80_HIGH_BOTTOM; + return; + } + else if (state.op_freq < BAND_80_HIGH_BOTTOM && state.op_freq > BAND_80_GAP_MIDDLE) { + state.op_freq = BAND_80_LOW_TOP; + return; + } + } +#endif if (state.op_freq > BAND_LIMITS_HIGH[state.band]) state.op_freq = BAND_LIMITS_HIGH[state.band]; if (state.op_freq < BAND_LIMITS_LOW[state.band]) diff --git a/SODA_POP/bands.h b/SODA_POP/bands.h index a67294b..baa59a1 100644 --- a/SODA_POP/bands.h +++ b/SODA_POP/bands.h @@ -224,11 +224,85 @@ const unsigned long BAND_OP_FREQS[] = , DEFAULT_OP_FREQ_10 }; #else /* End of PLAN_IARU3 */ + +#ifdef PLAN_VK +enum band : unsigned char { + BAND_160, BAND_80, BAND_40, BAND_30, BAND_20, + BAND_17, BAND_15, BAND_12, BAND_10, + LAST_BAND, BAND_UNKNOWN = 0xff +}; +const unsigned char BAND_DIGITS_2[] = {1,8,4,3,2,1,1,1,1}; +const unsigned char BAND_DIGITS_1[] = {6,0,0,0,0,7,5,2,0}; +# ifndef DEFAULT_OP_FREQ_160 +# define DEFAULT_OP_FREQ_160 181500000 +# endif +# ifndef DEFAULT_OP_FREQ_80 +# define DEFAULT_OP_FREQ_80 353000000 +# endif +# ifndef DEFAULT_OP_FREQ_40 +# define DEFAULT_OP_FREQ_40 703200000 +# endif +# ifndef DEFAULT_OP_FREQ_30 +# define DEFAULT_OP_FREQ_30 1011600000 +# endif +# ifndef DEFAULT_OP_FREQ_20 +# define DEFAULT_OP_FREQ_20 1406200000 +# endif +# ifndef DEFAULT_OP_FREQ_17 +# define DEFAULT_OP_FREQ_17 1808600000 +# endif +# ifndef DEFAULT_OP_FREQ_15 +# define DEFAULT_OP_FREQ_15 2106200000u +# endif +# ifndef DEFAULT_OP_FREQ_12 +# define DEFAULT_OP_FREQ_12 2490600000u +# endif +# ifndef DEFAULT_OP_FREQ_10 +# define DEFAULT_OP_FREQ_10 2806000000u +# endif +const unsigned long BAND_LIMITS_LOW[] = + { 180000000 + , 350000000 + , 700000000 + , 1010000000 + , 1400000000 + , 1806800000 + , 2100000000u + , 2489000000u + , 2800000000u + }; +const unsigned long BAND_LIMITS_HIGH[] = + { 187500000 + , 380000000 + , 730000000 + , 1015000000 + , 1435000000 + , 1816800000 + , 2145000000u + , 2499000000u + , 2970000000u + }; +// Special definitions to support gapped 80m band in VK +#define BAND_80_LOW_TOP 370000000 +#define BAND_80_HIGH_BOTTOM 377600000 +#define BAND_80_GAP_MIDDLE (BAND_80_LOW_TOP+BAND_80_HIGH_BOTTOM)/2 +const unsigned long BAND_OP_FREQS[] = + { DEFAULT_OP_FREQ_160 + , DEFAULT_OP_FREQ_80 + , DEFAULT_OP_FREQ_40 + , DEFAULT_OP_FREQ_30 + , DEFAULT_OP_FREQ_20 + , DEFAULT_OP_FREQ_17 + , DEFAULT_OP_FREQ_15 + , DEFAULT_OP_FREQ_12 + , DEFAULT_OP_FREQ_10 + }; +#else /* End of PLAN_VK */ #error Please select a band plan using #define PLAN_... #endif #endif #endif #endif - +#endif // vim: tabstop=2 shiftwidth=2 expandtab: diff --git a/SODA_POP/settings.h b/SODA_POP/settings.h index 7afd8b3..df867b7 100644 --- a/SODA_POP/settings.h +++ b/SODA_POP/settings.h @@ -22,6 +22,7 @@ * - PLAN_IARU1 * - PLAN_IARU2 * - PLAN_IARU3 + * - PLAN_VK * It is possible to override the default operating frequency using: * #define DEFAULT_OP_FREQ_20 1405500000 * ... setting the default frequency to 14.055 MHz on 20m. From 373def47957fcc122e5890272f82cffa3e2daab8 Mon Sep 17 00:00:00 2001 From: vk3il Date: Fri, 5 May 2017 22:48:51 +1000 Subject: [PATCH 3/4] Set final values of default frequencies for VK SOTA Set the final values of the default frequencies aligned to common usage for SOTA in VK. --- SODA_POP/bands.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SODA_POP/bands.h b/SODA_POP/bands.h index baa59a1..f819089 100644 --- a/SODA_POP/bands.h +++ b/SODA_POP/bands.h @@ -234,10 +234,10 @@ enum band : unsigned char { const unsigned char BAND_DIGITS_2[] = {1,8,4,3,2,1,1,1,1}; const unsigned char BAND_DIGITS_1[] = {6,0,0,0,0,7,5,2,0}; # ifndef DEFAULT_OP_FREQ_160 -# define DEFAULT_OP_FREQ_160 181500000 +# define DEFAULT_OP_FREQ_160 183200000 # endif # ifndef DEFAULT_OP_FREQ_80 -# define DEFAULT_OP_FREQ_80 353000000 +# define DEFAULT_OP_FREQ_80 353200000 # endif # ifndef DEFAULT_OP_FREQ_40 # define DEFAULT_OP_FREQ_40 703200000 @@ -255,10 +255,10 @@ const unsigned char BAND_DIGITS_1[] = {6,0,0,0,0,7,5,2,0}; # define DEFAULT_OP_FREQ_15 2106200000u # endif # ifndef DEFAULT_OP_FREQ_12 -# define DEFAULT_OP_FREQ_12 2490600000u +# define DEFAULT_OP_FREQ_12 2490800000u # endif # ifndef DEFAULT_OP_FREQ_10 -# define DEFAULT_OP_FREQ_10 2806000000u +# define DEFAULT_OP_FREQ_10 2806200000u # endif const unsigned long BAND_LIMITS_LOW[] = { 180000000 From e7270cf6d935003fcfca13ca29d16868576d13fa Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 12 May 2017 09:26:38 +0000 Subject: [PATCH 4/4] Update readme for VK plan --- README.md | 5 ++++- SODA_POP/bands.h | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d7e7aa0..49268e2 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,8 @@ uploading the code to the chip. - `TUNING_STEP_DIGITS`: which digit to blink when in a tuning step. An array of the same length as `TUNING_STEPS`. Values should be taken from `BLINK_NONE`, `BLINK_0`, `_1`, `_2` and `_3` (`0` is the rightmost digit). -- There are several band plans. Define one of `PLAN_IARU1`, `_IARU2`, `_IARU3`. +- There are several band plans. Define one of `PLAN_IARU1`, `_IARU2`, `_IARU3`, + `_VK`. The exact boundary definitions are in `bands.h`. - Change the default operating frequency of a band by defining e.g. @@ -208,6 +209,8 @@ Some images of the connections: ## Changelog +- 2017-05-12: + - VK band plans (PR [#21](/../../pull/21) by VK3IL) - 2017-05-04: - Beacon mode (issue [#6](/../../issues/6)) - More logical UX for sending and storing memories, using RIT to cancel diff --git a/SODA_POP/bands.h b/SODA_POP/bands.h index f819089..497c4c6 100644 --- a/SODA_POP/bands.h +++ b/SODA_POP/bands.h @@ -224,7 +224,6 @@ const unsigned long BAND_OP_FREQS[] = , DEFAULT_OP_FREQ_10 }; #else /* End of PLAN_IARU3 */ - #ifdef PLAN_VK enum band : unsigned char { BAND_160, BAND_80, BAND_40, BAND_30, BAND_20, @@ -302,7 +301,7 @@ const unsigned long BAND_OP_FREQS[] = #endif #endif #endif - #endif + #endif // vim: tabstop=2 shiftwidth=2 expandtab: