Page 196 - MDP2020-2
P. 196

|    인천전자마이스터고등학교  ·············································································································
            190


                begin
                  if(!rst)
                      begin
                        step  <=  0;
                      end
                    else
                      begin
                        if(time_count  >=  SPEED)
                          begin
                              step  <=  step  +  1;
                            end
                        else
                          begin
                              step  <=  step;
                            end
                      end
                end
                /*
              always  @(step)
                begin
                  case(step)
                    0:  step_phase  <=  A;
                    1:  step_phase  <=  B;
                    2:  step_phase  <=  A_;
                    3:  step_phase  <=  B_;
                    endcase

                end
                */

              always  @(step)
                begin
                  case(step)
                    0:  step_phase  <=  A;
                    1:  step_phase  <=  A|B;
                    2:  step_phase  <=  B;
                    3:  step_phase  <=  B|A_;
                    4:  step_phase  <=  A_;
                    5:  step_phase  <=  A_|B_;
                    6:  step_phase  <=  B_;
                    7:  step_phase  <=  B_|A;
                    endcase
                end
            endmodule


            module  adc_conversion(clk,  rst,  eoc,  adc_clk,  channel,  ale,  start,  oe,  adc_out,  adc_in);
   191   192   193   194   195   196   197   198   199   200   201