- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
module simplemotion(motion,key_0, CLK_50M,VCC);
output motion; input key_0; input CLK_50M; input VCC; slowclock(CLK_50M, pulse); wire pulse; reg motion; always @(posedge pulse) if (key_0==1) motion = pulse; stop(CLK_50M,c); wire c; always @(posedge c) if (c==1) motion =0; // in this step i am trying to stop the motion , however, i couldn't because motion cannot be multiple constant. endmodule module stop(CLK_50M,c); input CLK_50M; output c; reg [20:0] count; always @(CLK_50M) count = count+1; assign c = count[20]; endmodule module slowclock(CLK_50M, pulse); input CLK_50M; output pulse; reg [15:0] counter; always @(posedge CLK_50M) counter<=counter+1; assign pulse = counter[15]; endmodule My code is wrong, i have been working on this for weeks, still can't stop sending out the pulse to the motor at some specific time. Can anyone help? Thank you.Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- module simplemotion(motion,key_0, CLK_50M,VCC); output motion; input key_0; input CLK_50M; input VCC; slowclock(CLK_50M, pulse); wire pulse; reg motion; always @(posedge pulse) if (key_0==1) motion = pulse; stop(CLK_50M,c); wire c; always @(posedge c) if (c==1) motion =0; // in this step i am trying to stop the motion , however, i couldn't because motion cannot be multiple constant. endmodule module stop(CLK_50M,c); input CLK_50M; output c; reg [20:0] count; always @(CLK_50M) count = count+1; assign c = count[20]; endmodule module slowclock(CLK_50M, pulse); input CLK_50M; output pulse; reg [15:0] counter; always @(posedge CLK_50M) counter<=counter+1; assign pulse = counter[15]; endmodule My code is wrong, i have been working on this for weeks, still can't stop sending out the pulse to the motor at some specific time. Can anyone help? Thank you. --- Quote End --- Hi, It seems to me the problem with your output c. Better to declare before the call . Please check by displaying before stop call and after stop call. In this way, you will get know the problem why it is not stopping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI, kkr, Thanks
I have already declared c as wire, i can't compile it , it said Error (10028): Can't resolve multiple constant drivers for net "motion" at step.v(27) My will is to stop sending pulse to the motor,,,,,however i can't...Do u know why- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- HI, kkr, Thanks I have already declared c as wire, i can't compile it , it said Error (10028): Can't resolve multiple constant drivers for net "motion" at step.v(27) My will is to stop sending pulse to the motor,,,,,however i can't...Do u know why --- Quote End --- you just remove down declaration, and declare only above stop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iT'S NOT WORKING...
i just want to stop sending out the pulse
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page