Skip to content

Commit

Permalink
1.Upload hardware NanoVNA-H Rev3.4 schematic diagram;
Browse files Browse the repository at this point in the history
2.Since D2 in version 3.4 uses IN4148, the value of vbat_offset is changed to 480mV, which can be modified using the vbat_offset command.
3.Modify the DIV/4 switchpoint of the si5351 to 160MHz to avoid the HAM band.
  • Loading branch information
hugen79 committed Dec 18, 2019
1 parent b2df2ca commit 42cc6a8
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 141 deletions.
238 changes: 105 additions & 133 deletions .cproject

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -std=gnu11 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -flto
USE_OPT = -std=gnu11 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage
endif

# .
Expand Down
Binary file added doc/Schematic_nanovna-H_REV3_4_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[])
;
}

# if 0
static const int8_t gain_table[][2] = {
{ 0, 0 }, // 1st: 0 ~ 300MHz
{ 42, 40 }, // 2nd: 300 ~ 600MHz
Expand All @@ -280,6 +281,18 @@ static const int8_t gain_table[][2] = {
{ 95, 93 }, // 6th: 1400MHz ~
};

# endif

//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 ~
};

static int adjust_gain(int newfreq)
{
int delay = 0;
Expand Down Expand Up @@ -629,7 +642,7 @@ config_t config = {
.touch_cal = { 370, 540, 154, 191 }, //{ 620, 600, 160, 190 },
.default_loadcal = 0,
.harmonic_freq_threshold = 300000000,
.vbat_offset = 100,
.vbat_offset = 480,
.checksum = 0
};

Expand Down Expand Up @@ -2104,7 +2117,7 @@ static void cmd_color(BaseSequentialStream *chp, int argc, char *argv[])
}
#endif

/*

static void cmd_vbat_offset(BaseSequentialStream *chp, int argc, char *argv[])
{
if (argc != 1) {
Expand All @@ -2114,7 +2127,7 @@ static void cmd_vbat_offset(BaseSequentialStream *chp, int argc, char *argv[])
int offset = atoi(argv[0]);
config.vbat_offset = (int16_t)offset;
}
*/

static THD_WORKING_AREA(waThread2, /* cmd_* max stack size + alpha */510 + 32);

static const ShellCommand commands[] =
Expand Down Expand Up @@ -2161,7 +2174,7 @@ static const ShellCommand commands[] =
#ifdef __COLOR_CMD__
{ "color", cmd_color },
#endif
// { "vbat_offset", cmd_vbat_offset },
{ "vbat_offset", cmd_vbat_offset },
{ NULL, NULL }
};

Expand Down
2 changes: 1 addition & 1 deletion si5351.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ int si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_st
}
if (freq <= 100000000) {
band = 0;
} else if (freq < 150000000) {
} else if (freq < 160000000) {
band = 1;
} else {
band = 2;
Expand Down
4 changes: 2 additions & 2 deletions tlv320aic3204.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ static const uint8_t conf_data_routing[] = {
2, 0x36, 0x10, /* Route IN2R to LEFT_N with 10K */
2, 0x37, 0x04, /* Route IN3R to RIGHT_P with 10K */
2, 0x39, 0x04, /* Route IN3L to RIGHT_N with 10K */
2, 0x3b, 5, /* Unmute Left MICPGA, Gain selection of 32dB to make channel gain 2.5dB */
2, 0x3c, 5, /* Unmute Right MICPGA, Gain selection of 32dB to make channel gain 2.5dB */
2, 0x3b, 0, /* Unmute Left MICPGA, Gain selection of 32dB to make channel gain 0dB */
2, 0x3c, 0, /* Unmute Right MICPGA, Gain selection of 32dB to make channel gain 0dB */
0 // sentinel
};

Expand Down

0 comments on commit 42cc6a8

Please sign in to comment.