-//assign ssp_clk = ssp_clk_divider[4];
-
-// Divide SSP_CLK by 8 to produce the byte framing signal; the phase of
-// this is arbitrary, because it's just a bitstream.
-// One nasty issue, though: I can't make it work with both rx and tx at
-// once. The phase wrt ssp_clk must be changed. TODO to find out why
-// that is and make a better fix.
-reg [2:0] ssp_frame_divider_to_arm;
-always @(posedge ssp_clk)
-    ssp_frame_divider_to_arm <= (ssp_frame_divider_to_arm + 1);
-reg [2:0] ssp_frame_divider_from_arm;
-always @(negedge ssp_clk)
-    ssp_frame_divider_from_arm <= (ssp_frame_divider_from_arm + 1);
-
-
+// Produce the byte framing signal; the phase of this signal 
+// is arbitrary, because it's just a bit stream in this module.
+reg ssp_frame;
+always @(negedge adc_clk)
+begin
+       if (mod_type == `FPGA_HF_SIMULATOR_MODULATE_212K)
+       begin
+               if (ssp_clk_divider[8:5] == 4'd1)
+                       ssp_frame <= 1'b1;
+               if (ssp_clk_divider[8:5] == 4'd5)
+                       ssp_frame <= 1'b0;
+       end
+       else
+       begin
+               if (ssp_clk_divider[7:4] == 4'd1)
+                       ssp_frame <= 1'b1;
+               if (ssp_clk_divider[7:4] == 4'd5)
+                       ssp_frame <= 1'b0;
+       end
+end