From 28986aaf8fb5b3e159cca0e6120d4e4a0de772d8 Mon Sep 17 00:00:00 2001 From: Paul Lutus Date: Thu, 8 Nov 2012 05:40:43 +0000 Subject: [PATCH] IC-746/756, IC-PCR8500 fixes * The 746 has an APF, wasn't in its configuration, added, tested, works. * The 756Pro has an ANF function, wasn't in its configuration, added, tested, works. * The 756Pro's signal strength conversion table was way wrong. I noticed this while making scope plots in my program JRX -- the strong signals using the STRENGTH output would all flatten out at a rather low level, but the RAWSTR output showed the full range. Changed the conversion table, tested, fixed. R8500 notes: The R8500 on/off functions work differently than the other Icoms, in fact it's not too strong to say that this radio is a breed apart. Most Icom radios have a group command code for on/off functions (16), then a code for the function, then a flag for on or off. The R8500 combines the second and third into one, and this required a bit of recoding in "icom.c". Interestingly, someone had created some special designators in "icom_defs.h" for the R8500, but then never coded them to the degree that they worked. Now they work. :) So the AGC, NB and APF functions all work now. The R8500 doesn't have a preamp control, so I took that out. The R8500 does have IF shift and a 3-step attenuater, so I put those in. Signed-off-by: Nate Bargmann --- icom/ic746.c | 2 +- icom/ic756.c | 34 +++++++++++++++++----------------- icom/icom.c | 13 +++++++++---- icom/icr8500.c | 9 +++++---- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/icom/ic746.c b/icom/ic746.c index 10f6b4e51..e56db6b8b 100644 --- a/icom/ic746.c +++ b/icom/ic746.c @@ -58,7 +58,7 @@ #define IC746_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM) #define IC746_AM_TX_MODES (RIG_MODE_AM) -#define IC746_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_RESUME|RIG_FUNC_ARO) +#define IC746_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF|RIG_FUNC_APF|RIG_FUNC_VSC|RIG_FUNC_RESUME|RIG_FUNC_ARO) #define IC746_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR) diff --git a/icom/ic756.c b/icom/ic756.c index d7b1e23c2..87d50caa0 100644 --- a/icom/ic756.c +++ b/icom/ic756.c @@ -46,7 +46,7 @@ #define IC756_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM) #define IC756_AM_TX_MODES (RIG_MODE_AM) -#define IC756PRO_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF) +#define IC756PRO_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF) #define IC756PRO_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF|RIG_LEVEL_RAWSTR|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE) @@ -63,22 +63,22 @@ #define IC756PRO_STR_CAL { 16, \ { \ - { 0, -18 }, \ - { 10, -16 }, \ - { 27, -14 }, \ - { 45, -12 }, \ - { 60, -10 }, \ - { 76, -8 }, \ - { 89, -6 }, \ - { 100, -4 }, \ - { 110, -2 }, \ - { 120, 0 }, \ - { 125, 2 }, \ - { 129, 4 }, \ - { 133, 6 }, \ - { 138, 8 }, \ - { 142, 10 }, \ - { 146, 12 } \ + { 0, -60 }, \ + { 14, -52 }, \ + { 29, -44 }, \ + { 44, -36 }, \ + { 60, -28 }, \ + { 75, -20 }, \ + { 91, -12 }, \ + { 107, -4 }, \ + { 124, 4 }, \ + { 141, 12 }, \ + { 158, 20 }, \ + { 175, 28 }, \ + { 192, 36 }, \ + { 210, 44 }, \ + { 228, 52 }, \ + { 247 ,60 } \ } } /* diff --git a/icom/icom.c b/icom/icom.c index a6d8ca209..5027ecd0e 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -1897,17 +1897,20 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) unsigned char fctbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN]; int fct_len, acklen, retval; int fct_cn, fct_sc; /* Command Number, Subcommand */ + /* r8500, the problem rig */ + int r8500 = (rig->caps->rig_model == RIG_MODEL_ICR8500)? 1 : 0; /* * except for IC-R8500 */ fctbuf[0] = status? 0x01:0x00; - fct_len = rig->caps->rig_model == RIG_MODEL_ICR8500 ? 0 : 1; + fct_len = r8500 ? 0 : 1; switch (func) { case RIG_FUNC_FAGC: fct_cn = C_CTL_FUNC; - fct_sc = S_FUNC_AGC; + fct_sc = (r8500)?(status)?S_FUNC_AGCON:S_FUNC_AGCOFF:S_FUNC_AGC; + /* fct_sc = S_FUNC_AGC; */ /* note: should it be a LEVEL only, and no func? --SF */ if (status != 0) fctbuf[0] = 0x03; /* default to 0x03 in IC746 pro super-fast */ @@ -1916,7 +1919,8 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; case RIG_FUNC_NB: fct_cn = C_CTL_FUNC; - fct_sc = S_FUNC_NB; + fct_sc = (r8500)?(status)?S_FUNC_NBON:S_FUNC_NBOFF:S_FUNC_NB; + /* fct_sc = S_FUNC_NB; */ break; case RIG_FUNC_COMP: fct_cn = C_CTL_FUNC; @@ -1960,7 +1964,8 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; case RIG_FUNC_APF: fct_cn = C_CTL_FUNC; - fct_sc = S_FUNC_APF; + fct_sc = (r8500)?(status)?S_FUNC_APFON:S_FUNC_APFOFF:S_FUNC_APF; + /* fct_sc = S_FUNC_APF; */ break; case RIG_FUNC_MON: fct_cn = C_CTL_FUNC; diff --git a/icom/icr8500.c b/icom/icr8500.c index 5d8f478bd..da00ed408 100644 --- a/icom/icr8500.c +++ b/icom/icr8500.c @@ -35,7 +35,7 @@ #define ICR8500_FUNC_ALL (RIG_FUNC_FAGC|RIG_FUNC_NB|RIG_FUNC_TSQL|RIG_FUNC_APF) -#define ICR8500_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_APF|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR) +#define ICR8500_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_APF|RIG_LEVEL_SQL|RIG_LEVEL_IF|RIG_LEVEL_RAWSTR) #define ICR8500_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL) @@ -100,15 +100,16 @@ const struct rig_caps icr8500_caps = { .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, + [LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, }, .parm_gran = {}, .ctcss_list = NULL, /* FIXME: CTCSS/DCS list */ .dcs_list = NULL, -.preamp = { 10, RIG_DBLST_END, }, -.attenuator = { 20, RIG_DBLST_END, }, +.preamp = { RIG_DBLST_END, }, +.attenuator = { 10, 20, 30, RIG_DBLST_END, }, .max_rit = Hz(9999), .max_xit = Hz(0), -.max_ifshift = Hz(0), +.max_ifshift = kHz(1.2), .targetable_vfo = 0, .vfo_ops = ICR8500_OPS, .scan_ops = ICR8500_SCAN_OPS,