Ignore:
Timestamp:
Mar 4, 2011, 10:16:36 AM (9 years ago)
Author:
neise
Message:
new data format implemented.
setting of DAC during run is possible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/spi_distributor_beha.vhd

    r9912 r10225  
    2828    clk               : IN                      std_logic; -- 50MHz
    2929    config_start      : IN                      std_logic;
    30     config_ready, config_started      : OUT   std_logic := '0';
     30    config_ready                : OUT   std_logic := '1';
    3131    sensor_valid      : OUT             std_logic := '0';
    3232    dac_array         : IN                      dac_array_type;
     33        current_dac_array : OUT                 dac_array_type := ( others => 0);
    3334    sensor_array      : OUT             sensor_array_type;
    3435    dac_config_start  : OUT   std_logic := '0';
    3536    dac_config_ready  : IN    std_logic;
     37    sclk_enable_override : OUT std_logic := '0';
    3638    sensor_read_start : OUT   std_logic := '0';
    3739    sensor_read_valid : IN    std_logic;
     
    5355  signal dac_id_cnt            : integer range 0 to 7 := 0;
    5456 
     57  signal internal_dac_array : dac_array_type;
     58  signal sclk_enable_override_sig : std_logic := '0';
    5559 
    5660BEGIN
     61  sclk_enable_override <= sclk_enable_override_sig;
    5762 
    5863  spi_distribute_proc: process (clk)
    5964  begin
     65   
    6066   
    6167    if rising_edge(clk) then
     
    6773          spi_distr_state <= READ_SENSOR;
    6874        when IDLE =>
     75                        sclk_enable_override_sig <= '0';
    6976          if (int_sensor_valid = '1') then
    7077            sensor_array <= int_sensor_array;
     
    7481         -- start DAC configuration
    7582          if (config_start = '1' AND int_sensor_valid = '1') then
    76             config_started <= '1';
    7783            config_ready <= '0';
     84                        sclk_enable_override_sig <= '1';
    7885            dac_config_start <= '1';
    7986            dac_id <= conv_std_logic_vector(dac_id_cnt, dac_id'length);
    8087            data <= conv_std_logic_vector(dac_array(dac_id_cnt),data'length);
     88                        internal_dac_array <= dac_array;
    8189            spi_distr_state <= CONFIG_DAC;
    8290          -- start temperature sensor reading
     
    111119          dac_config_start <= '1';
    112120          dac_id <= conv_std_logic_vector(dac_id_cnt, dac_id'length);
    113           data <= conv_std_logic_vector(dac_array(dac_id_cnt),data'length);
     121          data <= conv_std_logic_vector(internal_dac_array(dac_id_cnt),data'length);
    114122          if (dac_config_ready = '1') then
    115123            dac_config_start <= '0';
     
    120128            else
    121129              dac_id_cnt <= 0;
    122               config_started <= '0';
    123130              config_ready <= '1';
     131                          current_dac_array <= internal_dac_array;
    124132              spi_distr_state <= IDLE;
    125133            end if;
Note: See TracChangeset for help on using the changeset viewer.