]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
Maybe works
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Fri, 20 Feb 2015 16:38:11 +0000 (17:38 +0100)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Sat, 13 Jun 2015 15:36:58 +0000 (17:36 +0200)
ADC/source/adc_processor_cfd.vhd

index 764827d513dc22d42eb83712c405e6aee024159f..71396b2a31368f52043febdf4ba8738effb68dcb 100644 (file)
@@ -125,12 +125,9 @@ begin
           state                 <= RELEASE_DIRECT;
         elsif READOUT_RX.valid_timing_trg = '1' then
           state <= CFD_READOUT;
-          channelselect := 0;
           -- if there's already new data present, 
           -- start moving the counter already now 
-          if ram_data_sys(channelselect) /= x"00000000" then
-            ram_counter(channelselect) <= ram_counter(channelselect) + 1;
-          end if;
+          ram_counter(channelselect) <= ram_counter(channelselect) + 1;
         end if;
 
       when RELEASE_DIRECT =>
@@ -159,6 +156,9 @@ begin
 
       when CFD_READOUT =>
         if ram_data_sys(channelselect) = x"00000000" then
+          -- for old channel, decrease count since we found the end
+          ram_counter(channelselect) <= ram_counter(channelselect) - 1;
+          -- go to next channel or finish readout
           if channelselect = 3 then
             state <= RELEASE_DIRECT;
             channelselect := 0;