Skip to content

Commit

Permalink
1.readjusted the gain table for NanoVNA-H rev3.4 and it looks better;
Browse files Browse the repository at this point in the history
2.Upload NanoVNA-H rev3.4 PCB Photo.
  • Loading branch information
hugen79 committed Dec 24, 2019
1 parent 42cc6a8 commit fbbceca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Binary file added doc/NanoVNA_Rev3.4_PCB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,19 @@ static const int8_t gain_table[][2] = {
//NanoVNA-H REV3.4
static const int8_t gain_table[][2] = {
{ 0, 0 }, // 1st: 0 ~ 300MHz
{ 40, 40 }, // 2nd: 300 ~ 600MHz
{ 50, 50 }, // 3rd: 600 ~ 900MHz
{ 80, 80 }, // 4th: 900 ~ 1200MHz
{ 90, 90 }, // 5th: 1200 ~ 1400MHz
{ 95, 95 }, // 6th: 1400MHz ~
{ 50, 50 }, // 2nd: 300 ~ 600MHz
{ 55, 55 }, // 3rd: 600 ~ 900MHz
{ 75, 75 }, // 4th: 900 ~ 1200MHz
{ 80, 80 }, // 5th: 1200 ~ 1500MHz
// { 90, 90 }, // 6th: 1500MHz ~1800MHz
// { 95, 95 }, // 7th: 1800MHz ~
};

static int adjust_gain(int newfreq)
{
int delay = 0;
int new_order = newfreq / FREQ_HARMONICS;
int old_order = frequency / FREQ_HARMONICS;
int new_order = (newfreq-1) / FREQ_HARMONICS; //Harmonics are switched after an integer multiple, and then the gain needs to be switched after an integer multiple.
int old_order = (frequency-1) / FREQ_HARMONICS;
if (new_order != old_order) {
tlv320aic3204_set_gain(gain_table[new_order][0], gain_table[new_order][1]);
delay += 10;
Expand Down
8 changes: 6 additions & 2 deletions si5351.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,14 @@ int si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_st
int delay = 3;
uint32_t ofreq = freq + offset;
uint32_t rdiv = SI5351_R_DIV_1;
if (freq >= config.harmonic_freq_threshold * 3) {
/* if (freq > config.harmonic_freq_threshold * 5 ) {
freq /= 7;
ofreq /= 9;
}else */
if (freq > config.harmonic_freq_threshold * 3) {
freq /= 5;
ofreq /= 7;
} else if (freq >= config.harmonic_freq_threshold) {
} else if (freq > config.harmonic_freq_threshold) {
freq /= 3;
ofreq /= 5;
}
Expand Down

0 comments on commit fbbceca

Please sign in to comment.