Changeset 9911 for firmware/FTU/counter


Ignore:
Timestamp:
08/30/10 16:01:15 (14 years ago)
Author:
weitzel
Message:
FTU rate counting modified; now synthesis works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FTU/counter/FTU_rate_counter.vhd

    r9890 r9911  
    7575  begin
    7676
    77     if rising_edge(cntr_reset) then
    78      
    79       --formula to calculate counting period from prescaling value
    80       if (prescaling = "00000000") then
    81         counting_period <= COUNTER_FREQUENCY / (2 * CNTR_FREQ_DIVIDER);
    82       else
    83         counting_period <= ((conv_integer(unsigned(prescaling)) + 1) / 2) * (COUNTER_FREQUENCY / CNTR_FREQ_DIVIDER);
    84       end if;
    85      
     77    if cntr_reset = '1' then
     78         
    8679      clk_cntr := 0;     
    8780      period_finished <= '1';
     
    9184     
    9285    elsif rising_edge(clk_1M_sig) then
     86     
    9387      if (clk_cntr < counting_period - 1) then
    9488        clk_cntr := clk_cntr + 1;
     
    107101  process(trigger, period_finished)
    108102  begin
    109     if rising_edge(period_finished) then
     103    if period_finished = '1' then
    110104      trigger_counts <= 0;
    111105      overflow_sig <= '0';
     
    118112          overflow_sig <= '1';
    119113        end if;
     114      end if;
     115    end if;
     116  end process;
     117
     118  process(cntr_reset, prescaling)
     119  begin
     120    if rising_edge(cntr_reset) then
     121      --formula to calculate counting period from prescaling value
     122      if (prescaling = "00000000") then
     123        counting_period <= COUNTER_FREQUENCY / (2 * CNTR_FREQ_DIVIDER);
     124      else
     125        counting_period <= ((conv_integer(unsigned(prescaling)) + 1) / 2) * (COUNTER_FREQUENCY / CNTR_FREQ_DIVIDER);
    120126      end if;
    121127    end if;
Note: See TracChangeset for help on using the changeset viewer.