Sunday 28 July 2013

Design of Stepper Motor Driver (Full Step) using Behavior Modeling Style (Verilog CODE) .





Design of Stepper Motor Driver (Full Step) using Behavior Modeling Style -

Output Waveform :   Stepper Motor Driver (Full Step).



Verilog CODE -


//-----------------------------------------------------------------------------
//
// Title       : stepper_motor_full_step
// Design      : verilog upload 4
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise with Naresh Singh Dobal
//
//-----------------------------------------------------------------------------
//
// 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

0 comments :

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes