Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Signal related problem ----Stop the output (Urgent)

Altera_Forum
Honored Contributor II
1,683 Views

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.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
570 Views

 

--- 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.
0 Kudos
Altera_Forum
Honored Contributor II
570 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
570 Views

 

--- 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.
0 Kudos
Altera_Forum
Honored Contributor II
570 Views

iT'S NOT WORKING... 

i just want to stop sending out the pulse
0 Kudos
Reply