diff --git a/TNC/Fsk9600Demodulator.hpp b/TNC/Fsk9600Demodulator.hpp index 80e694d..f2cab59 100644 --- a/TNC/Fsk9600Demodulator.hpp +++ b/TNC/Fsk9600Demodulator.hpp @@ -33,7 +33,7 @@ struct Fsk9600Demodulator : IDemodulator static_assert(audio::ADC_BUFFER_SIZE >= ADC_BLOCK_SIZE); static constexpr uint32_t SAMPLE_RATE = 192000; - static constexpr uint16_t VREF = 4095; + static constexpr uint16_t VREF = 16383; using bpf_coeffs_type = std::array; using bpf_bank_type = std::array; @@ -61,7 +61,7 @@ struct Fsk9600Demodulator : IDemodulator demod_filter.init(bpf); passall(kiss::settings().options & KISS_OPTION_PASSALL); - hadc1.Init.OversamplingMode = DISABLE; + hadc1.Init.OversamplingMode = ENABLE; if (HAL_ADC_Init(&hadc1) != HAL_OK) { CxxErrorHandler(); @@ -72,7 +72,7 @@ struct Fsk9600Demodulator : IDemodulator sConfig.Channel = AUDIO_IN; sConfig.Rank = ADC_REGULAR_RANK_1; sConfig.SingleDiff = ADC_SINGLE_ENDED; - sConfig.SamplingTime = ADC_SAMPLETIME_247CYCLES_5; + sConfig.SamplingTime = ADC_SAMPLETIME_6CYCLES_5; sConfig.OffsetNumber = ADC_OFFSET_NONE; sConfig.Offset = 0; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) diff --git a/TNC/Fsk9600Modulator.cpp b/TNC/Fsk9600Modulator.cpp index 8f4c3b9..5c7666d 100644 --- a/TNC/Fsk9600Modulator.cpp +++ b/TNC/Fsk9600Modulator.cpp @@ -38,7 +38,7 @@ void Fsk9600Modulator::init(const kiss::Hardware& hw) SysClock72(); - // Configure 80MHz clock for 192ksps. + // Configure 72MHz clock for 192ksps. htim7.Init.Period = 374; if (HAL_TIM_Base_Init(&htim7) != HAL_OK) { diff --git a/TNC/M17Demodulator.cpp b/TNC/M17Demodulator.cpp index 453be39..f017779 100644 --- a/TNC/M17Demodulator.cpp +++ b/TNC/M17Demodulator.cpp @@ -29,11 +29,11 @@ void M17Demodulator::start() polarity = kiss::settings().rx_rev_polarity() ? -1 : 1; audio::virtual_ground = (VREF + 1) / 2; -// hadc1.Init.OversamplingMode = DISABLE; -// if (HAL_ADC_Init(&hadc1) != HAL_OK) -// { -// CxxErrorHandler(); -// } + hadc1.Init.OversamplingMode = ENABLE; + if (HAL_ADC_Init(&hadc1) != HAL_OK) + { + CxxErrorHandler(); + } ADC_ChannelConfTypeDef sConfig;