LibreVNA/Software/VNA_embedded/Application/Drivers
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
..
FPGA implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
USB Startup and communication bugfixes 2025-01-06 17:34:46 +01:00
algorithm.cpp improve PLL fractional divider algorithm 2025-08-17 19:37:10 +02:00
algorithm.hpp improve PLL fractional divider algorithm 2025-08-17 19:37:10 +02:00
delay.cpp Fix further sweep timeout issues 2022-06-26 18:47:34 +02:00
delay.hpp Fix integer size bug for Delay::us 2022-06-26 12:46:11 +02:00
Exti.cpp Bugfixes and speed improvements 2020-09-26 23:34:31 +02:00
Exti.hpp embedded code copied from jankae/VNA and adjusted for STM32G4 2020-08-24 19:06:50 +02:00
Flash.cpp fw/flash: add IS25LP support 2021-07-21 15:04:56 -03:00
Flash.hpp 1us delay after CS high on SPI flash 2025-05-31 14:59:14 +02:00
Log.cpp Fix further sweep timeout issues 2022-06-26 18:47:34 +02:00
Log.h Bugfixes and improvements for new hardware 2020-09-14 23:13:32 +02:00
max2871.cpp improve PLL fractional divider algorithm 2025-08-17 19:37:10 +02:00
max2871.hpp WIP: detect integer spurs 2025-02-26 08:55:31 +01:00
Si5351C.cpp Bugfix: remove not used optional parameter 2025-08-17 20:18:38 +02:00
Si5351C.hpp Bugfix: remove not used optional parameter 2025-08-17 20:18:38 +02:00
stm.cpp Working dwell time feature 2025-01-03 14:36:10 +01:00
stm.hpp Fix STM temperature calculation 2022-06-25 19:36:06 +02:00