2013年11月30日 星期六

Stepper Motor Driver (Full Step).v

// File        : Stepper Motor Driver (Full Step).v


module stepper_motor_full_step ( start ,clk ,dout );

output [3:0] dout ;
reg [3:0] dout ;

input start ;
wire start ;
input clk ;
wire clk ;

reg [1:0] m ;

initial m = 0;

always @ (posedge (clk)) begin
if (start)
m <= m + 1;
end

always @ (m) begin
case (m)
0 : dout = 8;
1 : dout = 4;
2 : dout = 2;
default : dout = 1;
endcase
end

endmodule

沒有留言:

張貼留言

Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...