From 315387c0ad97efdaedd5d73a1a3b18b413f39513 Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 19 Jul 2022 11:41:40 +0200 Subject: [PATCH] Added some comments to the ALEX bits. --- alex.h | 84 ++++++++++++++++++++++++------------------------- new_protocol.c | 16 +++------- old_discovery.c | 9 ++---- 3 files changed, 49 insertions(+), 60 deletions(-) diff --git a/alex.h b/alex.h index 67fa08d..e3e124c 100644 --- a/alex.h +++ b/alex.h @@ -38,58 +38,59 @@ // ANAN-100 boards PS will not work, you have to use EXT1. // // -#define ALEX_RX_ANTENNA_NONE 0x00000000 // route Ant1,2,2 to RX1 -#define ALEX_RX_ANTENNA_XVTR 0x00000100 // route XVTR-in to RX1 (bit 8) -#define ALEX_RX_ANTENNA_EXT1 0x00000200 // route EXT1 to RX1 (bit 9) -#define ALEX_RX_ANTENNA_EXT2 0x00000400 // route EXT2 to RX1 (bit 10) -#define ALEX_RX_ANTENNA_BYPASS 0x00000800 // activate BYPASS (bit 11) +#define ALEX_RX_ANTENNA_NONE 0x00000000 // route Ant1,2,2 to RX1 +#define ALEX_RX_ANTENNA_XVTR 0x00000100 // route XVTR-in to RX1 (bit 8) +#define ALEX_RX_ANTENNA_EXT1 0x00000200 // route EXT1 to RX1 (bit 9) +#define ALEX_RX_ANTENNA_EXT2 0x00000400 // route EXT2 to RX1 (bit 10) +#define ALEX_RX_ANTENNA_BYPASS 0x00000800 // activate BYPASS (bit 11) #define ANAN7000_RX_SELECT 0x00004000 // Master RX select (bit 14) -#define ALEX_TX_ANTENNA_1 0x01000000 // route TX to ANT1 -#define ALEX_TX_ANTENNA_2 0x02000000 // route TX to ANT2 -#define ALEX_TX_ANTENNA_3 0x04000000 // route TX to ANT3 +#define ALEX_TX_ANTENNA_1 0x01000000 // route TX to ANT1 (bit 24) +#define ALEX_TX_ANTENNA_2 0x02000000 // route TX to ANT2 (bit 25) +#define ALEX_TX_ANTENNA_3 0x04000000 // route TX to ANT3 (bit 26) // -// Note: DO NOT SET attenuator bits on ANAN-7000/8000 +// Note: DO NOT SET attenuator bits (13 and 14) on ANAN-7000/8000 // since ALEX0(14) is used for a different purpose! // #define ALEX_ATTENUATION_0dB 0x00000000 -#define ALEX_ATTENUATION_10dB 0x00004000 // activate 10 dB attenuator for RX1 -#define ALEX_ATTENUATION_20dB 0x00002000 // activate 20 dB attenuator for RX1 -#define ALEX_ATTENUATION_30dB 0x00006000 // activate both attenuators for RX1 +#define ALEX_ATTENUATION_10dB 0x00004000 // activate 10 dB attenuator for first ADC +#define ALEX_ATTENUATION_20dB 0x00002000 // activate 20 dB attenuator for first ADC +#define ALEX_ATTENUATION_30dB 0x00006000 // activate both attenuators for first ADC // // Note: Anan 100/200: If RX signal comes from Ant1,2,3 it also goes // through the TX LPFs // -#define ALEX_30_20_LPF 0x00100000 // activate 30/20m TX LPF -#define ALEX_60_40_LPF 0x00200000 // activate 60/20m TX LPF -#define ALEX_80_LPF 0x00400000 // activate 80m TX LPF -#define ALEX_160_LPF 0x00800000 // activate 160m TX LPF -#define ALEX_6_BYPASS_LPF 0x20000000 // activate 6m TX LPF -#define ALEX_12_10_LPF 0x40000000 // activate 12/10m TX LPF -#define ALEX_17_15_LPF 0x80000000 // activate 17/15m TX LPF +#define ALEX_30_20_LPF 0x00100000 // activate 30/20m TX LPF (bit 20) +#define ALEX_60_40_LPF 0x00200000 // activate 60/40m TX LPF (bit 21) +#define ALEX_80_LPF 0x00400000 // activate 80m TX LPF (bit 22) +#define ALEX_160_LPF 0x00800000 // activate 160m TX LPF (bit 23) +#define ALEX_6_BYPASS_LPF 0x20000000 // activate 6m TX LPF (bit 30) +#define ALEX_12_10_LPF 0x40000000 // activate 12/10m TX LPF (bit 31) +#define ALEX_17_15_LPF 0x80000000 // activate 17/15m TX LPF (bit 32) // -// ALEX RX high-pass filters (Valid for ANAN-100/200) +// ALEX RX high-pass filters (Valid for ANAN-100/200 first ADC) +// NOTE: Anan-7000/8000 use band-pass filters here // -#define ALEX_13MHZ_HPF 0x00000002 -#define ALEX_20MHZ_HPF 0x00000004 -#define ALEX_6M_PREAMP 0x00000008 // 35 MHz HPF + low-noise amplifier -#define ALEX_9_5MHZ_HPF 0x00000010 -#define ALEX_6_5MHZ_HPF 0x00000020 -#define ALEX_1_5MHZ_HPF 0x00000040 -#define ALEX_BYPASS_HPF 0x00001000 +#define ALEX_13MHZ_HPF 0x00000002 // (bit 1) +#define ALEX_20MHZ_HPF 0x00000004 // (bit 2) +#define ALEX_6M_PREAMP 0x00000008 // (bit 3) 35 MHz HPF + low-noise amplifier +#define ALEX_9_5MHZ_HPF 0x00000010 // (bit 4) +#define ALEX_6_5MHZ_HPF 0x00000020 // (bit 5) +#define ALEX_1_5MHZ_HPF 0x00000040 // (bit 6) +#define ALEX_BYPASS_HPF 0x00001000 // (bit 12) // // Bit that controls the RX/TX relay // -#define ALEX_TX_RELAY 0x08000000 +#define ALEX_TX_RELAY 0x08000000 // (bit 27) // // Bit used for PURESIGNAL // -#define ALEX_PS_BIT 0x00040000 +#define ALEX_PS_BIT 0x00040000 // (bit 18) // // From this point on, we define bits that have a slightly @@ -107,22 +108,21 @@ // The TX bits are just as for the "generic" case. // -// These bits only have a function on ANAN-7000 +// These bits are valid both for ALEX0 and ALEX1 in the Anan-7000/8000 -#define ALEX_ANAN7000_RX_20_15_BPF 0x00000002 // bit 1, 11.0 - 22.0 MHz -#define ALEX_ANAN7000_RX_12_10_BPF 0x00000004 // bit 2, 22.0 - 35.6 MHz -#define ALEX_ANAN7000_RX_6_PRE_BPF 0x00000008 // bit 3, > 35.6 MHz with preamp -#define ALEX_ANAN7000_RX_40_30_BPF 0x00000010 // bit 4, 5.5 - 10.9 MHz -#define ALEX_ANAN7000_RX_80_60_BPF 0x00000020 // bit 5, 2.1 - 5.4 MHz -#define ALEX_ANAN7000_RX_160_BPF 0x00000040 // bit 6, 1.5 - 2.0 MHz -#define ALEX_ANAN7000_RX_BYPASS_BPF 0x00001000 // bit 12 +#define ALEX_ANAN7000_RX_20_15_BPF 0x00000002 // (bit 1), 11.0 - 22.0 MHz +#define ALEX_ANAN7000_RX_12_10_BPF 0x00000004 // (bit 2), 22.0 - 35.6 MHz +#define ALEX_ANAN7000_RX_6_PRE_BPF 0x00000008 // (bit 3), > 35.6 MHz with preamp +#define ALEX_ANAN7000_RX_40_30_BPF 0x00000010 // (bit 4), 5.5 - 10.9 MHz +#define ALEX_ANAN7000_RX_80_60_BPF 0x00000020 // (bit 5), 2.1 - 5.4 MHz +#define ALEX_ANAN7000_RX_160_BPF 0x00000040 // (bit 6), 1.5 - 2.0 MHz +#define ALEX_ANAN7000_RX_BYPASS_BPF 0x00001000 // (bit 12) -#define ALEX1_ANAN7000_RX_GNDonTX 0x00000100 // bit 8 +#define ALEX1_ANAN7000_RX_GNDonTX 0x00000100 // (bit 8), ground second ADC input during TX // -// For ANAN7000,8000 there also is byte 1400 in the high-priority packet -// which directs the output of the DUC directly to the "XVTR OUT" jack -// (bit0) and which we should set when using "XVRT IN" +// ANAN7000,8000 specific bits in byte 1400 of the high-priority packet // -#define ANAN7000_XVTR_OUT 0x00000001 // +#define ANAN7000_XVTR_OUT 0x00000001 // if PTT is set, Orion-II RF output is routed to the + // "XVTR Port" jack #endif diff --git a/new_protocol.c b/new_protocol.c index aeaf5fa..793f503 100644 --- a/new_protocol.c +++ b/new_protocol.c @@ -913,8 +913,8 @@ static void new_protocol_high_priority() { // // ALEX bits // - long alex0=0x00000000; - long alex1=0x00000000; + unsigned long alex0=0x00000000; + unsigned long alex1=0x00000000; if (device != NEW_DEVICE_ORION2) { // @@ -1150,7 +1150,7 @@ static void new_protocol_high_priority() { //g_print("ALEX0 bits: %02X %02X %02X %02X for rx=%lld tx=%lld\n",high_priority_buffer_to_radio[1432],high_priority_buffer_to_radio[1433],high_priority_buffer_to_radio[1434],high_priority_buffer_to_radio[1435],rxFrequency,txFrequency); // -// Orion2 boards: set RX2 filters according ro VFOB frequency +// Orion2 boards: set RX2 filters according to VFOB frequency // if (device == NEW_DEVICE_ORION2) { // @@ -1163,7 +1163,7 @@ static void new_protocol_high_priority() { rxFrequency=vfo[VFO_B].frequency-vfo[VFO_B].lo; } // -// new ANAN-7000/8000 band-pass RX filters +// new ANAN-7000/8000 "Alex1" band-pass RX filters // if(rxFrequency<1500000L) { alex1|=ALEX_ANAN7000_RX_BYPASS_BPF; @@ -1233,7 +1233,6 @@ static void new_protocol_high_priority() { pthread_mutex_unlock(&hi_prio_mutex); } -static unsigned char last_50=0; static void new_protocol_transmit_specific() { int txmode=get_tx_mode(); @@ -1301,11 +1300,6 @@ static void new_protocol_transmit_specific() { transmit_specific_buffer[50]|=0x10; } - if(last_50!=transmit_specific_buffer[50]) { - last_50=transmit_specific_buffer[50]; -//g_print("tx_specific: 50=%02X\n",transmit_specific_buffer[50]); - } - // 0..31 transmit_specific_buffer[51]=linein_gain; @@ -1381,7 +1375,7 @@ static void new_protocol_receive_specific() { receive_specific_buffer[19]=192; // sample rate LSB receive_specific_buffer[22]=24; // bits per sample - receive_specific_buffer[23]=n_adc; // TX-DAC associated with DDC1 + receive_specific_buffer[23]=n_adc; // TX-DAC (last ADC + 1) associated with DDC1 receive_specific_buffer[24]=0; // sample rate MSB receive_specific_buffer[25]=192; // sample rate LSB receive_specific_buffer[26]=24; // bits per sample diff --git a/old_discovery.c b/old_discovery.c index c38137f..08e9529 100644 --- a/old_discovery.c +++ b/old_discovery.c @@ -343,11 +343,11 @@ fprintf(stderr,"discover_receive_thread\n"); break; case DEVICE_HERMES_LITE: // - // It seems that some HermesLite V2 boards use + // HermesLite V2 boards use // DEVICE_HERMES_LITE as the ID and a software version // that is larger or equal to 40, while the original // (V1) HermesLite boards have software versions up to 31. - // Therefore this is possibly a HL2 board! + // if (discovered[devices].software_version < 40) { strcpy(discovered[devices].name,"HermesLite V1"); } else { @@ -358,11 +358,6 @@ g_print("discovered HL2: Gateware Major Version=%d Minor Version=%d\n",buffer[9] discovered[devices].frequency_min=0.0; discovered[devices].frequency_max=30720000.0; break; - case DEVICE_HERMES_LITE2: - strcpy(discovered[devices].name,"HermesLite V2"); - discovered[devices].frequency_min=0.0; - discovered[devices].frequency_max=30720000.0; - break; case DEVICE_ORION2: strcpy(discovered[devices].name,"Orion2"); discovered[devices].frequency_min=0.0; -- 2.45.2