diff --git a/hdl/data_serializer.vhd b/hdl/data_serializer.vhd
index f2eddc16a66577b3249943504d6151c4ffadfc96..6323b766a022ff4d988878a42b7a1b6471ff5653 100644
--- a/hdl/data_serializer.vhd
+++ b/hdl/data_serializer.vhd
@@ -64,12 +64,12 @@ begin
         elsif rising_edge(clk) then
 
             if run_serial = '1' then
-                if cnt = 0 then
+                if cnt = C_N_MM_PSC-1 then
                     -- stop at the end
                     run_serial <= '0';
                 else
                     if m_axis_tready = '1' then
-                        cnt <= cnt-1;
+                        cnt <= cnt+1;
                     end if;
                 end if;
 
@@ -80,7 +80,7 @@ begin
                 if corrout_valid= '1' then
                     -- start on valid
                     run_serial <= '1';
-                    cnt <= to_unsigned(C_N_MM_PSC-1, cnt'length);
+                    cnt <= (others => '0');
 
                 end if;