LibreVNA/Software/VNA_embedded
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
..
.settings improve GUI synchronization for compound device 2025-05-04 13:01:00 +02:00
Application implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
Drivers Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
Inc Version number increase + boot LED debug reverted 2022-10-01 23:27:03 +02:00
Middlewares/Third_Party/FreeRTOS/Source Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
Src WIP: rework 2.LO + add dwell time 2025-01-02 19:16:53 +01:00
Startup Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
.cproject Changelog + version bump 2025-05-31 16:05:21 +02:00
.gitignore remove installation dependent IDE settings file 2022-04-05 16:35:42 +02:00
.mxproject Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
.project Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
Makefile Changelog + version bump 2025-05-31 16:05:21 +02:00
STM32G431CBUX_FLASH.ld Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
VNA_embedded Debug into running system.launch Hardfault handler + FPGA abort/interrupt collision fix 2022-11-19 15:46:17 +01:00
VNA_embedded Debug.launch Update to STM32CubeIDE + longer settling time for point 0 2022-03-07 22:51:17 +01:00
VNA_embedded.ioc WIP: rework 2.LO + add dwell time 2025-01-02 19:16:53 +01:00