Page 985 - 3-2
P. 985

2 : begin
                            if(angle_set == 155)    current_sector <= 0;

                            if(angle_set == 250)    current_sector <= 1;
                        end

                    endcase
                  clk_cnt <= 0;

                 end
                 else

                 begin
                  motor_step_clk <= motor_step_clk + 1; // 실제 각도 * 2    의 값을 지닐 것.

                  step_clk <= ~step_clk; //Pulse
                  clk_cnt <= 0;

                end
               end

               else
               begin

                clk_cnt <= clk_cnt + 1;
                step_clk <= step_clk;

               end
              end

              else
              begin

               clk_cnt <= 0;
               motor_step_clk <= 0;

              end
             end

            end



            // 초 cnt
            always@(posedge clk,negedge rst)

             if(!rst) begin time_cnt <= 0; sec10 <= 0; sec1 <= 0; end
             else begin

              if(state == open_door || state == door_stop1 ||
                    state == door_close || state == rs_state) begin

               if(time_cnt >= 54000000) begin
                time_cnt <= 0;



                                                         - 985 -
   980   981   982   983   984   985   986   987   988   989   990