Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ADC acquisitions / DAC actuation synchronized with the RF reference clock #2

Open
6 tasks
augustofg opened this issue Jul 17, 2023 · 0 comments
Open
6 tasks
Assignees

Comments

@augustofg
Copy link
Member

The current implementation of the power-supply current controller loop is not synchronised with anything, it will start a new ADC conversion immediately after the previous finished:

----------------------------------------
-- ADC start when both are ready
----------------------------------------
p_gen_adc_start_valid: process (clk_i)
begin
if rising_edge (clk_i) then
if rst_n_i = '0' then
adc_start <= '0';
else
adc_start <= adc_ready; -- FIXME: ADC conversions should start after
-- a integer number of clk_ref_i edges
end if;
end if;
end process;

Fixing this will require a major refactoring in rtmlamp_ohwr.vhd. The necessary steps to conclude this refactoring are the following:

  • Implement a configurable strobe generator that counts in RF/4 cycles;
  • Implement a CNV/LDAC pulse generator in a single core and use the readout (ADC) and writeout (DAC) interfaces directly;
  • Implement the state machines for waiting the strobe / generating the CNV/LDAC pulse, wait for the ADC and read the conversion result, write the DAC data;
  • Remove all CDC FIFOs and use gc_sync_word_rd / gc_sync_word_wr instead as we don't need to transfer data at consecutive clock cycles;
  • Implement current loop stuck detection and automatic disabling of the power amplifiers outputs;
  • Expose status flags via wishbone to indicate current loop stuck and strobe pulse lost conditions.
@augustofg augustofg self-assigned this Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant