LibreVNA/Software/VNA_embedded/Application
Roger Henderson 1ea012aa57 implement FPGA-based CDS to avoid BRAM overflow
Move CDS phase computation from per-point config storage to FPGA logic.
The FPGA now computes the 180° phase shift internally (M/2) and loops
twice per point when CDS is enabled. This keeps config memory at 96 bits
instead of 112, avoiding BRAM overflow on the Spartan 6.

FPGA changes:
- Add CDS_ENABLED input to Sweep module (controlled via SPI register 6)
- Compute source_phase = M/2 for 180° shift when cds_phase=1
- State machine loops through all stages twice per point when CDS enabled
- RESULT_INDEX now includes cds_phase bit: stage[2:0] & point[11:0] & cds_phase

Firmware changes:
- Add FPGA::SetCDSEnabled() to control CDS via register 6 bit 11
- Update SamplingResult to include cdsPhase field (1 bit)
- Simplify VNA.cpp: FPGA handles phase switching, MCU combines results

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:19:57 +13:00
..
Communication add Correlated Double Sampling (CDS) support 2026-01-31 23:47:02 +13:00
Drivers implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
App.cpp option to restore default values of device configuration 2025-11-15 19:22:15 +01:00
App.h Main thread using FreeRTOS notifications, added missing commands for firmware update 2020-08-31 17:57:24 +02:00
Cal.cpp Fix floating point limitation in frequency correction 2022-06-07 16:13:45 +02:00
Cal.hpp TCXO offset calibration 2021-05-01 18:34:53 +02:00
Firmware.cpp Partial source calibration dialog 2020-11-16 20:05:29 +01:00
Firmware.hpp Partial source calibration dialog 2020-11-16 20:05:29 +01:00
Generator.cpp use PLL A to generate lowband source 2025-08-09 19:10:53 +02:00
Generator.hpp Refactoring, better code encapsulation for different operating modes 2020-09-17 09:53:52 +02:00
Hardware.cpp Working dwell time feature 2025-01-03 14:36:10 +01:00
Hardware.hpp Working dwell time feature 2025-01-03 14:36:10 +01:00
HW_HAL.cpp Partial source calibration dialog 2020-11-16 20:05:29 +01:00
HW_HAL.hpp Partial source calibration dialog 2020-11-16 20:05:29 +01:00
Led.cpp Version number increase + boot LED debug reverted 2022-10-01 23:27:03 +02:00
Led.hpp WIP: synchronization 2022-08-08 18:08:40 +02:00
Manual.cpp use PLL A to generate lowband source 2025-08-09 19:10:53 +02:00
Manual.hpp Renaming packet types, implementing different packet contents per hardware version 2023-02-20 13:08:31 +01:00
SpectrumAnalyzer.cpp improve PLL fractional divider algorithm 2025-08-17 19:37:10 +02:00
SpectrumAnalyzer.hpp Speed improvements 2020-10-03 21:56:09 +02:00
Trigger.cpp WIP: device synchronization 2022-08-07 03:01:22 +02:00
Trigger.hpp WIP: device synchronization 2022-08-07 03:01:22 +02:00
Util.cpp signal ID improved 2020-11-14 23:53:55 +01:00
Util.hpp signal ID improved 2020-11-14 23:53:55 +01:00
VNA.cpp implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
VNA.hpp refactor evaluation of standby waiting state 2022-12-20 11:14:02 -08:00