|
|
|
@ -102,21 +102,22 @@ static freq_t old_freq[4] = { 0, 0, 0, 0};
|
|
|
|
static freq_t real_old_freq[4] = { 0, 0, 0, 0};
|
|
|
|
static freq_t real_old_freq[4] = { 0, 0, 0, 0};
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
const float si_drive_dBm [] = {-44.1, -30, -21.6, -17, -14, -11.7, -9.9, -8.4, -7.1, -6, -5, -4.2, -3.4, -2.7 , -2.1, -1.5, -1, -0.47, 0};
|
|
|
|
|
|
|
|
const float adf_drive_dBm[] = {-15,-12,-9,-6};
|
|
|
|
|
|
|
|
const uint8_t drive_register[] = {0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
|
|
|
|
|
|
|
|
float *drive_dBm = (float *) si_drive_dBm;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
const int8_t drive_dBm [16] = {-38, -32, -30, -27, -24, -19, -15, -12, -5, -2, 0, 3, 6, 9, 12, 16};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __ULTRA__
|
|
|
|
#ifdef __ULTRA__
|
|
|
|
int old_drive = -1;
|
|
|
|
int old_drive = -1;
|
|
|
|
int actual_drive = -1;
|
|
|
|
int actual_drive = -1;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define BELOW_MAX_DRIVE(X) (drive_dBm[X] - drive_dBm[MAX_DRIVE])
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
const float si_drive_dBm [] = {-44.1, -30, -21.6, -17, -14, -11.7, -9.9, -8.4, -7.1, -6, -5, -4.2, -3.4, -2.7 , -2.1, -1.5, -1, -0.47, 0};
|
|
|
|
|
|
|
|
const float adf_drive_dBm[] = {-15,-12,-9,-6};
|
|
|
|
|
|
|
|
const uint8_t drive_register[] = {0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
|
|
|
|
|
|
|
|
float *drive_dBm = (float *) si_drive_dBm;
|
|
|
|
|
|
|
|
const int min_drive = 0;
|
|
|
|
|
|
|
|
int max_drive = 18;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __NEW_SWITCHES__
|
|
|
|
#ifdef __NEW_SWITCHES__
|
|
|
|
#define SWITCH_ATTENUATION ((setting.mode == M_GENHIGH) ? 40 : 25.0 + config.out_switch_offset)
|
|
|
|
#define SWITCH_ATTENUATION ((setting.mode == M_GENHIGH) ? 40 : 25.0 + config.out_switch_offset)
|
|
|
|
#define MAX_DRIVE ((setting.mode == M_GENHIGH) ? 3 : 18)
|
|
|
|
#define MAX_DRIVE ((setting.mode == M_GENHIGH) ? 3 : 18)
|
|
|
|
@ -143,10 +144,190 @@ int actual_drive = -1;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#define MAX_ATTENUATE 31.5
|
|
|
|
#define MAX_ATTENUATE 31.5
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 0 1 2 3 4
|
|
|
|
|
|
|
|
enum {PATH_OFF, PATH_LOW, PATH_DIRECT, PATH_ULTRA, PATH_LEAKAGE};
|
|
|
|
|
|
|
|
int signal_path = PATH_OFF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_output_drive(int d)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (signal_path == PATH_LEAKAGE)
|
|
|
|
|
|
|
|
ADF4351_drive(d);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
#ifdef __SI4432__
|
|
|
|
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
|
|
|
|
SI4432_Drive(d);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __SI4463__
|
|
|
|
|
|
|
|
SI4463_set_output_level(d);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
setting.rx_drive = d;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_output_step_atten(int s)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setting.atten_step = s;
|
|
|
|
|
|
|
|
if (signal_path == PATH_LEAKAGE)
|
|
|
|
|
|
|
|
enable_ultra(!s);
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
#ifdef TINYSA3
|
|
|
|
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
|
|
|
|
if (s)
|
|
|
|
|
|
|
|
set_switch_receive();
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
set_switch_transmit();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
enable_rx_output(!s);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_output_path(freq_t f, float level)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (test_output) {
|
|
|
|
|
|
|
|
signal_path = test_path;
|
|
|
|
|
|
|
|
setting.mixer_output = (signal_path == PATH_ULTRA);
|
|
|
|
|
|
|
|
setting.atten_step = test_output_switch;
|
|
|
|
|
|
|
|
set_output_drive(test_output_drive);
|
|
|
|
|
|
|
|
PE4302_Write_Byte(test_output_attenuate);
|
|
|
|
|
|
|
|
goto set_path;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (setting.mute)
|
|
|
|
|
|
|
|
signal_path = PATH_OFF;
|
|
|
|
|
|
|
|
else if (f < MINIMUM_DIRECT_FREQ || (config.ultra && config.ultra_start != ULTRA_AUTO && f < config.ultra_start))
|
|
|
|
|
|
|
|
signal_path = PATH_LOW;
|
|
|
|
|
|
|
|
else if (f <= MAX_LOW_OUTPUT_FREQ && ( config.ultra_start == ULTRA_AUTO || f < config.ultra_start))
|
|
|
|
|
|
|
|
signal_path = PATH_DIRECT;
|
|
|
|
|
|
|
|
else if (config.ultra && setting.mixer_output)
|
|
|
|
|
|
|
|
signal_path = PATH_ULTRA;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
signal_path = PATH_LEAKAGE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (signal_path) {
|
|
|
|
|
|
|
|
case PATH_LEAKAGE:
|
|
|
|
|
|
|
|
drive_dBm = (float *)adf_drive_dBm;
|
|
|
|
|
|
|
|
max_drive = 2;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
drive_dBm = (float *)si_drive_dBm;
|
|
|
|
|
|
|
|
max_drive = 18;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (signal_path != PATH_LEAKAGE) {
|
|
|
|
|
|
|
|
float dt = Si446x_get_temp() - CENTER_TEMPERATURE;
|
|
|
|
|
|
|
|
if (dt > 0)
|
|
|
|
|
|
|
|
level += dt * DB_PER_DEGREE_ABOVE; // Temperature correction
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
level += dt * DB_PER_DEGREE_BELOW; // Temperature correction
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
level += 3.0; // Always 3dB in attenuator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int very_low_flag = false;
|
|
|
|
|
|
|
|
float a = level - level_max(); // convert to all settings maximum power output equals a = zero
|
|
|
|
|
|
|
|
if (a < -SWITCH_ATTENUATION) {
|
|
|
|
|
|
|
|
a = a + SWITCH_ATTENUATION;
|
|
|
|
|
|
|
|
very_low_flag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
set_output_step_atten(very_low_flag);
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
#define LOWEST_LEVEL (very_low_flag ? 0 : MIN_DRIVE)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define LOWEST_LEVEL MIN_DRIVE
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int d;
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
if (signal_path == PATH_LEAKAGE)
|
|
|
|
|
|
|
|
d = 1;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
d = MAX_DRIVE-8; // Start in the middle
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
d = MAX_DRIVE-3; // Start in the middle
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float blw = BELOW_MAX_DRIVE(d);
|
|
|
|
|
|
|
|
while (a > blw && d < MAX_DRIVE) { // Increase if needed
|
|
|
|
|
|
|
|
d++;
|
|
|
|
|
|
|
|
blw = BELOW_MAX_DRIVE(d);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
while (a + 28 < blw && d > LOWEST_LEVEL) { // reduce till it fits attenuator (31 - 3)
|
|
|
|
|
|
|
|
d--;
|
|
|
|
|
|
|
|
blw = BELOW_MAX_DRIVE(d);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
a -= blw;
|
|
|
|
|
|
|
|
set_output_drive(d);
|
|
|
|
|
|
|
|
a -= 3.0; // Always at least 3dB attenuation
|
|
|
|
|
|
|
|
if (a > 0) {
|
|
|
|
|
|
|
|
a = 0;
|
|
|
|
|
|
|
|
if (!level_error) redraw_request |= REDRAW_CAL_STATUS;
|
|
|
|
|
|
|
|
level_error = true;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (level_error) redraw_request |= REDRAW_CAL_STATUS;
|
|
|
|
|
|
|
|
level_error = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a < -31.5)
|
|
|
|
|
|
|
|
a = -31.5;
|
|
|
|
|
|
|
|
a = -a - 0.25; // Rounding
|
|
|
|
|
|
|
|
setting.attenuate_x2 = (int)(a * 2);
|
|
|
|
|
|
|
|
PE4302_Write_Byte(setting.attenuate_x2);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
if (SDU1.config->usbp->state == USB_ACTIVE)
|
|
|
|
|
|
|
|
shell_printf ("level=%f, drive=%d, atten=%f, switch=%d\r\n", level, d, a, (very_low_flag ? 1 : 0));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable_extra_lna(false);
|
|
|
|
|
|
|
|
set_path:
|
|
|
|
|
|
|
|
switch(signal_path) {
|
|
|
|
|
|
|
|
case PATH_OFF:
|
|
|
|
|
|
|
|
if (SI4463_is_in_tx_mode())
|
|
|
|
|
|
|
|
SI4463_init_rx();
|
|
|
|
|
|
|
|
enable_ADF_output(false,false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PATH_LEAKAGE:
|
|
|
|
|
|
|
|
if (SI4463_is_in_tx_mode())
|
|
|
|
|
|
|
|
SI4463_init_rx();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable_ADF_output(true, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable_direct(false);
|
|
|
|
|
|
|
|
enable_ultra(!setting.atten_step);
|
|
|
|
|
|
|
|
enable_high(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PATH_LOW:
|
|
|
|
|
|
|
|
enable_ultra(false);
|
|
|
|
|
|
|
|
enable_high(false);
|
|
|
|
|
|
|
|
enable_direct(false);
|
|
|
|
|
|
|
|
goto common;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case PATH_DIRECT:
|
|
|
|
|
|
|
|
enable_ADF_output(false, false);
|
|
|
|
|
|
|
|
enable_ultra(!setting.atten_step);
|
|
|
|
|
|
|
|
enable_direct(true);
|
|
|
|
|
|
|
|
enable_high(true);
|
|
|
|
|
|
|
|
goto common2;
|
|
|
|
|
|
|
|
case PATH_ULTRA:
|
|
|
|
|
|
|
|
enable_ultra(true);
|
|
|
|
|
|
|
|
enable_direct(false);
|
|
|
|
|
|
|
|
enable_high(false);
|
|
|
|
|
|
|
|
common:
|
|
|
|
|
|
|
|
enable_ADF_output(true, false);
|
|
|
|
|
|
|
|
common2:
|
|
|
|
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
|
|
|
|
SI4463_init_tx();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
const int8_t drive_dBm [16] = {-38, -32, -30, -27, -24, -19, -15, -12, -5, -2, 0, 3, 6, 9, 12, 16};
|
|
|
|
#define SWITCH_ATTENUATION (29 - config.switch_offset)
|
|
|
|
#define SWITCH_ATTENUATION (29 - config.switch_offset)
|
|
|
|
#define RECEIVE_SWITCH_ATTENUATION (24 + config.receive_switch_offset)
|
|
|
|
#define RECEIVE_SWITCH_ATTENUATION (24 + config.receive_switch_offset)
|
|
|
|
#define POWER_OFFSET 15
|
|
|
|
//#define POWER_OFFSET 15
|
|
|
|
#define MAX_DRIVE (setting.mode == M_GENHIGH ? 13 : 11) // The value of 13 is linked to the SL_GENHIGH_LEVEL_MAX of 9
|
|
|
|
#define MAX_DRIVE (setting.mode == M_GENHIGH ? 13 : 11) // The value of 13 is linked to the SL_GENHIGH_LEVEL_MAX of 9
|
|
|
|
#define MIN_DRIVE 8
|
|
|
|
#define MIN_DRIVE 8
|
|
|
|
#define SL_GENHIGH_LEVEL_MIN -38
|
|
|
|
#define SL_GENHIGH_LEVEL_MIN -38
|
|
|
|
@ -156,7 +337,6 @@ int actual_drive = -1;
|
|
|
|
#define MAX_ATTENUATE 31.5
|
|
|
|
#define MAX_ATTENUATE 31.5
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#define BELOW_MAX_DRIVE(X) (drive_dBm[X] - drive_dBm[MAX_DRIVE])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//float level_min;
|
|
|
|
//float level_min;
|
|
|
|
@ -862,7 +1042,7 @@ float level_range(void)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
float low_out_offset()
|
|
|
|
float low_out_offset(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (config.low_level_output_offset == 100)
|
|
|
|
if (config.low_level_output_offset == 100)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -874,7 +1054,7 @@ float low_out_offset()
|
|
|
|
return config.low_level_output_offset;
|
|
|
|
return config.low_level_output_offset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
float high_out_offset()
|
|
|
|
float high_out_offset(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (config.high_level_output_offset == 100)
|
|
|
|
if (config.high_level_output_offset == 100)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -1738,23 +1918,6 @@ void calculate_step_delay(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void apply_settings(void) // Ensure all settings in the setting structure are translated to the right HW setup
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
set_switches(setting.mode);
|
|
|
|
|
|
|
|
#ifdef __PE4302__
|
|
|
|
|
|
|
|
if (setting.mode == M_HIGH)
|
|
|
|
|
|
|
|
PE4302_Write_Byte(40); // Ensure defined input impedance of low port when using high input mode (power calibration)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
PE4302_Write_Byte((int)(setting.attenuate_x2));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (setting.mode == M_LOW) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
set_calibration_freq(setting.refer);
|
|
|
|
|
|
|
|
update_rbw();
|
|
|
|
|
|
|
|
calculate_step_delay();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------
|
|
|
|
//------------------------------------------
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
#define CORRECTION_POINTS 10
|
|
|
|
#define CORRECTION_POINTS 10
|
|
|
|
@ -1871,7 +2034,7 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#if 0 // Not implemented
|
|
|
|
#if 0 // Not implemented
|
|
|
|
int cf = (((f >> 28)+1)>>1) - 5; // Correction starts at 2,684,354,560Hz round to closest correction frequency
|
|
|
|
int cf = (((f >> 28)+1)>>1) - 5; // Correction starts at 2,684,354,560Hz round to closest correction frequency
|
|
|
|
int ca = setting.attenuate_x2 >> 2; // One data point per 2dB step
|
|
|
|
int ca = setting.attenuate_x2 >> 2; // One data point m 2dB step
|
|
|
|
if (cf >= 0 && cf < 16)
|
|
|
|
if (cf >= 0 && cf < 16)
|
|
|
|
cv -= scaled_atten_correction[cf][ca]<<2; // Shift is +5(pure RSSI) - 3 (scaled correction) = 2
|
|
|
|
cv -= scaled_atten_correction[cf][ca]<<2; // Shift is +5(pure RSSI) - 3 (scaled correction) = 2
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@ -2094,10 +2257,7 @@ void set_freq(int V, freq_t freq) // translate the requested frequency into a
|
|
|
|
else
|
|
|
|
else
|
|
|
|
target_drive = 2;
|
|
|
|
target_drive = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (old_drive != target_drive) {
|
|
|
|
ADF4351_drive(target_drive); // Max drive
|
|
|
|
ADF4351_drive(target_drive); // Max drive
|
|
|
|
|
|
|
|
old_drive = target_drive;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
real_old_freq[V] = ADF4351_set_frequency(V-ADF4351_LO,freq);
|
|
|
|
real_old_freq[V] = ADF4351_set_frequency(V-ADF4351_LO,freq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2185,9 +2345,7 @@ case M_LOW: // Mixed into 0
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
set_AGC_LNA();
|
|
|
|
set_AGC_LNA();
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
ADF4351_enable(true);
|
|
|
|
enable_ADF_output(true, setting.tracking_output);
|
|
|
|
ADF4351_enable_aux_out(setting.tracking_output);
|
|
|
|
|
|
|
|
ADF4351_enable_out(true);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __SI4432__
|
|
|
|
#ifdef __SI4432__
|
|
|
|
@ -2229,9 +2387,7 @@ mute:
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
set_AGC_LNA();
|
|
|
|
set_AGC_LNA();
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
ADF4351_enable_aux_out(false);
|
|
|
|
enable_ADF_output(false, setting.tracking_output);
|
|
|
|
ADF4351_enable_out(false);
|
|
|
|
|
|
|
|
ADF4351_enable(false);
|
|
|
|
|
|
|
|
if (setting.atten_step) {// use switch as attenuator
|
|
|
|
if (setting.atten_step) {// use switch as attenuator
|
|
|
|
enable_rx_output(true);
|
|
|
|
enable_rx_output(true);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -2268,13 +2424,12 @@ case M_GENLOW: // Mixed output from 0
|
|
|
|
SI4432_Transmit(12); // Fix LO drive a 10dBm
|
|
|
|
SI4432_Transmit(12); // Fix LO drive a 10dBm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
#ifdef __SI4468__
|
|
|
|
#ifdef __SI4468__
|
|
|
|
SI4463_init_tx();
|
|
|
|
SI4463_init_tx();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
ADF4351_enable_out(true);
|
|
|
|
enable_ADF_output(true, setting.tracking_output);
|
|
|
|
ADF4351_enable(true);
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(setting.tracking_output);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (setting.atten_step) { // use switch as attenuator
|
|
|
|
if (setting.atten_step) { // use switch as attenuator
|
|
|
|
enable_rx_output(false);
|
|
|
|
enable_rx_output(false);
|
|
|
|
@ -2290,6 +2445,7 @@ case M_GENLOW: // Mixed output from 0
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef __ULTRA__
|
|
|
|
#ifdef __ULTRA__
|
|
|
|
enable_ultra(false);
|
|
|
|
enable_ultra(false);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case M_GENHIGH: // Direct output from 1
|
|
|
|
case M_GENHIGH: // Direct output from 1
|
|
|
|
@ -2316,40 +2472,14 @@ case M_GENHIGH: // Direct output from 1
|
|
|
|
SI4432_Transmit(setting.lo_drive);
|
|
|
|
SI4432_Transmit(setting.lo_drive);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifdef TINYSA4
|
|
|
|
#ifndef __NEW_SWITCHES__
|
|
|
|
|
|
|
|
if (config.high_out_adf4350) {
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __SI4468__
|
|
|
|
#ifdef __SI4468__
|
|
|
|
SI4463_init_rx();
|
|
|
|
SI4463_init_rx();
|
|
|
|
enable_rx_output(true); // to protect the SI
|
|
|
|
enable_rx_output(true); // to protect the SI
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
ADF4351_enable(true);
|
|
|
|
enable_ADF_output(true, true);
|
|
|
|
#ifndef TINYSA4_PROTO
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(false);
|
|
|
|
|
|
|
|
ADF4351_enable_out(true);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(true);
|
|
|
|
|
|
|
|
ADF4351_enable_out(true); // Must be enabled to have aux output
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ADF4351_aux_drive(setting.lo_drive);
|
|
|
|
ADF4351_aux_drive(setting.lo_drive);
|
|
|
|
enable_extra_lna(false);
|
|
|
|
enable_extra_lna(false);
|
|
|
|
enable_ultra(true); // Open low output
|
|
|
|
enable_ultra(true); // Open low output
|
|
|
|
#ifndef __NEW_SWITCHES__
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(false);
|
|
|
|
|
|
|
|
ADF4351_enable_out(false);
|
|
|
|
|
|
|
|
#ifdef __SI4468__
|
|
|
|
|
|
|
|
SI4463_set_output_level(setting.lo_drive); // Must be before init_tx
|
|
|
|
|
|
|
|
SI4463_init_tx();
|
|
|
|
|
|
|
|
// if (setting.lo_drive < 32) {
|
|
|
|
|
|
|
|
// enable_rx_output(false); // use switch as attenuator
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
enable_rx_output(true);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -3012,6 +3142,7 @@ void clock_at_48MHz(void)
|
|
|
|
int test_output = false;
|
|
|
|
int test_output = false;
|
|
|
|
int test_output_switch = false;
|
|
|
|
int test_output_switch = false;
|
|
|
|
int test_output_drive = 0;
|
|
|
|
int test_output_drive = 0;
|
|
|
|
|
|
|
|
int test_path = 0;
|
|
|
|
int test_output_attenuate = 0;
|
|
|
|
int test_output_attenuate = 0;
|
|
|
|
bool level_error = false;
|
|
|
|
bool level_error = false;
|
|
|
|
static float old_temp = 0.0;
|
|
|
|
static float old_temp = 0.0;
|
|
|
|
@ -3041,7 +3172,16 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
calculate_correction(); // pre-calculate correction factor dividers to avoid float division
|
|
|
|
calculate_correction(); // pre-calculate correction factor dividers to avoid float division
|
|
|
|
limits_update();
|
|
|
|
limits_update();
|
|
|
|
apply_settings();
|
|
|
|
set_switches(setting.mode);
|
|
|
|
|
|
|
|
#ifdef __PE4302__
|
|
|
|
|
|
|
|
if (setting.mode == M_HIGH)
|
|
|
|
|
|
|
|
PE4302_Write_Byte(40); // Ensure defined input impedance of low port when using high input mode (power calibration)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
PE4302_Write_Byte((int)(setting.attenuate_x2));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
set_calibration_freq(setting.refer);
|
|
|
|
|
|
|
|
update_rbw();
|
|
|
|
|
|
|
|
calculate_step_delay();
|
|
|
|
old_a = -150; // clear cached level setting
|
|
|
|
old_a = -150; // clear cached level setting
|
|
|
|
// Initialize HW
|
|
|
|
// Initialize HW
|
|
|
|
scandirty = true; // This is the first pass with new settings
|
|
|
|
scandirty = true; // This is the first pass with new settings
|
|
|
|
@ -3138,10 +3278,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
else
|
|
|
|
else
|
|
|
|
target_drive = 3;
|
|
|
|
target_drive = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (old_drive != target_drive) {
|
|
|
|
ADF4351_drive(target_drive); // Max drive
|
|
|
|
ADF4351_drive(target_drive); // Max drive
|
|
|
|
|
|
|
|
old_drive = target_drive;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef TINYSA3
|
|
|
|
#ifdef TINYSA3
|
|
|
|
@ -3158,22 +3295,8 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------- START Set the output level ----------------------------------
|
|
|
|
// ------------------------------------- START Set the output level ----------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
if (( setting.frequency_step != 0 || setting.level_sweep != 0.0 || i == 0)) { // Initialize or adapt output levels
|
|
|
|
if (( setting.frequency_step != 0 || setting.level_sweep != 0.0 || (i == 0 && scandirty))) { // Initialize or adapt output levels
|
|
|
|
if (setting.mode == M_GENLOW) {// if in low output mode and level sweep or frequency weep is active or at start of sweep
|
|
|
|
if (setting.mode == M_GENLOW) {// if in low output mode and level sweep or frequency weep is active or at start of sweep
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
if (test_output) {
|
|
|
|
|
|
|
|
if (f < MAX_LOW_OUTPUT_FREQ || setting.mixer_output)
|
|
|
|
|
|
|
|
enable_rx_output(!test_output_switch);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
enable_direct(!test_output_switch);
|
|
|
|
|
|
|
|
if (f > MAX_LOW_OUTPUT_FREQ && !setting.mixer_output)
|
|
|
|
|
|
|
|
ADF4351_drive(test_output_drive);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
SI4463_set_output_level(test_output_drive);
|
|
|
|
|
|
|
|
PE4302_Write_Byte(test_output_attenuate);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float ls=setting.level_sweep; // calculate and set the output level
|
|
|
|
float ls=setting.level_sweep; // calculate and set the output level
|
|
|
|
if (ls > 0)
|
|
|
|
if (ls > 0)
|
|
|
|
ls += 0.5;
|
|
|
|
ls += 0.5;
|
|
|
|
@ -3182,52 +3305,23 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0 /* + get_level_offset() */ ;
|
|
|
|
float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0 /* + get_level_offset() */ ;
|
|
|
|
correct_RSSI_freq = get_frequency_correction(f);
|
|
|
|
correct_RSSI_freq = get_frequency_correction(f);
|
|
|
|
a += PURE_TO_float(correct_RSSI_freq);
|
|
|
|
a += PURE_TO_float(correct_RSSI_freq);
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
float dt = Si446x_get_temp() - CENTER_TEMPERATURE;
|
|
|
|
|
|
|
|
if (dt > 0)
|
|
|
|
|
|
|
|
a += dt * DB_PER_DEGREE_ABOVE; // Temperature correction
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
a += dt * DB_PER_DEGREE_BELOW; // Temperature correction
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
a += 3.0; // Always 3dB in attenuator
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (a != old_a) {
|
|
|
|
if (a != old_a) {
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
int very_low_flag = false;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
old_a = a;
|
|
|
|
old_a = a;
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
set_output_path(f, a);
|
|
|
|
|
|
|
|
#else
|
|
|
|
a = a - level_max(); // convert to all settings maximum power output equals a = zero
|
|
|
|
a = a - level_max(); // convert to all settings maximum power output equals a = zero
|
|
|
|
if (a < -SWITCH_ATTENUATION) {
|
|
|
|
if (a < -SWITCH_ATTENUATION) {
|
|
|
|
a = a + SWITCH_ATTENUATION;
|
|
|
|
a = a + SWITCH_ATTENUATION;
|
|
|
|
#ifdef TINYSA3
|
|
|
|
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
set_switch_receive();
|
|
|
|
set_switch_receive();
|
|
|
|
#else
|
|
|
|
|
|
|
|
enable_rx_output(false);
|
|
|
|
|
|
|
|
very_low_flag = true;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
#ifdef TINYSA3
|
|
|
|
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
set_switch_transmit();
|
|
|
|
set_switch_transmit();
|
|
|
|
#else
|
|
|
|
|
|
|
|
enable_rx_output(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
#define LOWEST_LEVEL (very_low_flag ? 0 : MIN_DRIVE)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define LOWEST_LEVEL MIN_DRIVE
|
|
|
|
#define LOWEST_LEVEL MIN_DRIVE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int d;
|
|
|
|
int d;
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
d = MAX_DRIVE-8; // Start in the middle
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
d = MAX_DRIVE-3; // Start in the middle
|
|
|
|
d = MAX_DRIVE-3; // Start in the middle
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float blw = BELOW_MAX_DRIVE(d);
|
|
|
|
float blw = BELOW_MAX_DRIVE(d);
|
|
|
|
while (a > blw && d < MAX_DRIVE) { // Increase if needed
|
|
|
|
while (a > blw && d < MAX_DRIVE) { // Increase if needed
|
|
|
|
d++;
|
|
|
|
d++;
|
|
|
|
@ -3238,41 +3332,20 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
blw = BELOW_MAX_DRIVE(d);
|
|
|
|
blw = BELOW_MAX_DRIVE(d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a -= blw;
|
|
|
|
a -= blw;
|
|
|
|
#ifdef __SI4432__
|
|
|
|
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
SI4432_Sel = SI4432_RX ;
|
|
|
|
SI4432_Drive(d);
|
|
|
|
SI4432_Drive(d);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __SI4463__
|
|
|
|
|
|
|
|
SI4463_set_output_level(d);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
a -= 3.0; // Always at least 3dB attenuation
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (a > 0) {
|
|
|
|
if (a > 0) {
|
|
|
|
a = 0;
|
|
|
|
a = 0;
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
if (!level_error) redraw_request |= REDRAW_CAL_STATUS;
|
|
|
|
|
|
|
|
level_error = true;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
if (level_error) redraw_request |= REDRAW_CAL_STATUS;
|
|
|
|
|
|
|
|
level_error = false;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a < -31.5)
|
|
|
|
if (a < -31.5)
|
|
|
|
a = -31.5;
|
|
|
|
a = -31.5;
|
|
|
|
a = -a - 0.25; // Rounding
|
|
|
|
a = -a - 0.25; // Rounding
|
|
|
|
#ifdef __PE4302__
|
|
|
|
|
|
|
|
setting.attenuate_x2 = (int)(a * 2);
|
|
|
|
setting.attenuate_x2 = (int)(a * 2);
|
|
|
|
PE4302_Write_Byte(setting.attenuate_x2);
|
|
|
|
PE4302_Write_Byte(setting.attenuate_x2);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
if (SDU1.config->usbp->state == USB_ACTIVE)
|
|
|
|
if (SDU1.config->usbp->state == USB_ACTIVE)
|
|
|
|
shell_printf ("level=%f, d=%d, a=%f, s=%d\r\n", setting.level, d, a, (very_low_flag ? 1 : 0));
|
|
|
|
shell_printf ("level=%f, d=%d, a=%f, s=%d\r\n", setting.level, d, a, (very_low_flag ? 1 : 0));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (setting.mode == M_GENHIGH) {
|
|
|
|
else if (setting.mode == M_GENHIGH) {
|
|
|
|
@ -3284,17 +3357,6 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
float a = setting.level - level_max();
|
|
|
|
float a = setting.level - level_max();
|
|
|
|
#ifdef TINYSA4
|
|
|
|
|
|
|
|
#ifndef __NEW_SWITCHES__
|
|
|
|
|
|
|
|
if (!config.high_out_adf4350) {
|
|
|
|
|
|
|
|
float dt = Si446x_get_temp() - CENTER_TEMPERATURE;
|
|
|
|
|
|
|
|
if (dt > 0)
|
|
|
|
|
|
|
|
a += dt * DB_PER_DEGREE_ABOVE; // Temperature correction
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
a += dt * DB_PER_DEGREE_BELOW; // Temperature correction
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (a <= -SWITCH_ATTENUATION) {
|
|
|
|
if (a <= -SWITCH_ATTENUATION) {
|
|
|
|
setting.atten_step = true;
|
|
|
|
setting.atten_step = true;
|
|
|
|
a = a + SWITCH_ATTENUATION;
|
|
|
|
a = a + SWITCH_ATTENUATION;
|
|
|
|
@ -3302,12 +3364,8 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
set_switch_receive();
|
|
|
|
set_switch_receive();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#ifndef __NEW_SWITCHES__
|
|
|
|
enable_ADF_output(true, false);
|
|
|
|
if (!config.high_out_adf4350)
|
|
|
|
;
|
|
|
|
enable_rx_output(false);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(false);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setting.atten_step = false;
|
|
|
|
setting.atten_step = false;
|
|
|
|
@ -3315,12 +3373,8 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
set_switch_transmit();
|
|
|
|
set_switch_transmit();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#ifndef __NEW_SWITCHES__
|
|
|
|
enable_ADF_output(true, true);
|
|
|
|
if (!config.high_out_adf4350)
|
|
|
|
|
|
|
|
enable_rx_output(true);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(true);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -3447,6 +3501,7 @@ modulation_again:
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (setting.mode == M_GENLOW) {
|
|
|
|
} else if (setting.mode == M_GENLOW) {
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if (ultra && (f > ultra_start || (setting.mixer_output && f > MAX_LOW_OUTPUT_FREQ))) { // Ultra mode output using both SI and ADF
|
|
|
|
if (ultra && (f > ultra_start || (setting.mixer_output && f > MAX_LOW_OUTPUT_FREQ))) { // Ultra mode output using both SI and ADF
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
SI4463_init_tx();
|
|
|
|
SI4463_init_tx();
|
|
|
|
@ -3460,21 +3515,17 @@ modulation_again:
|
|
|
|
if (SI4463_is_in_tx_mode())
|
|
|
|
if (SI4463_is_in_tx_mode())
|
|
|
|
SI4463_init_rx();
|
|
|
|
SI4463_init_rx();
|
|
|
|
|
|
|
|
|
|
|
|
ADF4351_enable_aux_out(true);
|
|
|
|
enable_ADF_output(true, true);
|
|
|
|
ADF4351_enable_out(true);
|
|
|
|
|
|
|
|
ADF4351_enable(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable_direct(false);
|
|
|
|
enable_direct(false);
|
|
|
|
enable_ultra(true);
|
|
|
|
enable_ultra(setting.atten_step);
|
|
|
|
enable_high(false);
|
|
|
|
enable_high(false);
|
|
|
|
|
|
|
|
|
|
|
|
} else { // Direct mode output using only SI
|
|
|
|
} else { // Direct mode output using only SI
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
SI4463_init_tx();
|
|
|
|
SI4463_init_tx();
|
|
|
|
enable_ADF_output(false);
|
|
|
|
enable_ADF_output(false, false);
|
|
|
|
ADF4351_enable_aux_out(false);
|
|
|
|
|
|
|
|
ADF4351_enable_out(false);
|
|
|
|
|
|
|
|
ADF4351_enable(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enable_ultra(true);
|
|
|
|
enable_ultra(true);
|
|
|
|
enable_direct(true);
|
|
|
|
enable_direct(true);
|
|
|
|
@ -3484,11 +3535,12 @@ modulation_again:
|
|
|
|
} else { // Normal output mode using both SI and ADF
|
|
|
|
} else { // Normal output mode using both SI and ADF
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
if (!SI4463_is_in_tx_mode())
|
|
|
|
SI4463_init_tx();
|
|
|
|
SI4463_init_tx();
|
|
|
|
enable_ADF_output(true);
|
|
|
|
enable_ADF_output(true, false);
|
|
|
|
enable_ultra(false);
|
|
|
|
enable_ultra(false);
|
|
|
|
enable_high(false);
|
|
|
|
enable_high(false);
|
|
|
|
enable_direct(false);
|
|
|
|
enable_direct(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// -------------------------------- Acquisition loop for one requested frequency covering spur avoidance and vbwsteps ------------------------
|
|
|
|
// -------------------------------- Acquisition loop for one requested frequency covering spur avoidance and vbwsteps ------------------------
|
|
|
|
@ -3817,7 +3869,7 @@ again: // Spur redu
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ADF4350_shift_ref(false);
|
|
|
|
ADF4350_shift_ref(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
if (get_sweep_frequency(ST_SPAN)<5000000) { // When scanning less then 5MHz
|
|
|
|
if (get_sweep_frequency(ST_SPAN)<5000000) { // When scanning less then 5MHz
|
|
|
|
if (actual_rbw_x10 <= 3000) {
|
|
|
|
if (actual_rbw_x10 <= 3000) {
|
|
|
|
setting.increased_R = true;
|
|
|
|
setting.increased_R = true;
|
|
|
|
@ -3939,10 +3991,7 @@ again: // Spur redu
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// ----------------- end duplication of code
|
|
|
|
// ----------------- end duplication of code
|
|
|
|
//
|
|
|
|
//
|
|
|
|
if (old_drive != actual_drive) {
|
|
|
|
ADF4351_drive(actual_drive); // Max drive
|
|
|
|
ADF4351_drive(actual_drive); // Max drive
|
|
|
|
|
|
|
|
old_drive = actual_drive;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set_freq(ADF4351_LO, target_f);
|
|
|
|
set_freq(ADF4351_LO, target_f);
|
|
|
|
#if 1 // Compensate frequency ADF4350 error with SI4468
|
|
|
|
#if 1 // Compensate frequency ADF4350 error with SI4468
|
|
|
|
|